CentOS ifcfg-eth0 configuration in VMWare for CentOS
These configurations are based on VMware Network Adapter VMnet8. Assume that my VMware Network Adapter VMnet8 IP address is 192.168.106.1.
For example:
Then my ifcfg-eth0 file configuration is as follows:
[Plain] view plaincopy
- DEVICE = eth0
- TYPE = Ethernet
- UUID = f9f0898c-bf2c-4183-857a-eab291cd904d
- ONBOOT = yes
- NM_CONTROLLED = yes
- BOOTPROTO = static
- IPADDR = 192.168.106.130
- NETMASK = 255.255.255.0
- BROADCAST = 192.168.106.255
- GATEWAY = 192.168.106.2
- DNS1 = 114.114.114.114
- DNS2 = 8.8.8.8
- DEFROUTE = yes
- 20174_failure_fatal = yes
- IPV6INIT = no
- NAME = "Systemeth0"
- HWADDR = 00: 0C: 29: 22: D2: 64
- PEERDNS = yes
- PEERROUTES = yes
- LAST_CONNECT = 1456741165
I set my CentOS IPaddress to 192.168.106.130 and VMware Network Adapter VMnet8 in the same Network segment.
Note: The Path to the ifcfg-eth0 file in CentOS is:/etc/sysconfig/network-scripts/ifcfg-eth0
After modifying the file, run the command # service network restart or #/etc/init. d/network restart to make the modification take effect.