Configuring a Static Network Address in VMware CentOS Environments

Adjust VMware Virtual Network Settings

Launch the Virtual Network Editor from the VMware interface. Administrative privileges may be required to modify these settings. Select the active virtual adapter (typically VMnet8 for NAT mode) and configure the following:

  • Ensure Use local DHCP service remains unchecked to allow manual assignment.
  • Record the dispalyed Subnet IP and Subnet mask; these parameters define the addressing scope. Click Apply and OK to persist the changes.

Modify the Guest OS Interface Configuration

Create a backup before altering system files:

sudo cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens33.bak

Open the network script for editing:

sudo vi /etc/sysconfig/network-scripts/ifcfg-ens33

Replace existing parameters with a static routing scheme:

DEVICE=ens33
TYPE=Ethernet
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.50.100
NETMASK=255.255.255.0
GATEWAY=192.168.50.2
DNS1=8.8.8.8
DNS2=1.1.1.1

The assigned address must not conflict with the gateway or broadcast ranges. Subnet masks align with /24 CIDR blocks, while resolvers reference external infrastructure.

Commit Changes & Verify Routing

Restart the network daemon to activate the new topology:

sudo systemctl restart network

Confirm internal reachability and DNS resolution:

ip addr show ens33
ping -c 4 192.168.50.2
ping -c 4 www.google.com

Establish Host-to-Guest Remote Access

NAT isolation restricts direct inbound traffic from the physical machine. Map the guest SSH service manually:

  1. Navigate back to Virtual Network Editor > NAT Settings.
  2. Define a forward rule:
    • Host Port: 2222
    • Guest IP: 192.168.50.100
    • Guest Port: 22
  3. Save the mapping.

Initiate the session by targeting the host loopback address:

ssh -p 2222 root@127.0.0.1

Tags: VMware centos Static IP Network Configuration Port Forwarding

Posted on Mon, 25 May 2026 23:29:02 +0000 by HostingTrade