Hello,
I have three CentOS 6 machines running in VMware workstation 9. My laptop (running Windows 7 Pro, 64-bit) has an IPv4 address of 192.168.0.10 & a gateway of 192.168.0.1; my VMware adapter assigned 192.168.81.1 for an IPv4. Inside the machine, I see /etc/resolv.conf containing a nameserver address of 192.168.81.2.
I put the applicable addresses in /etc/hosts (192.168.81.3 to 192.168.81.5 for the 3 machines). On the first machine (x.3), I ran "route add default gw 192.168.81.2" (to match nameserver in /etc/resolv.conf) and am now able to ping www.google.com. However, on the other two boxes (196.168.81.4, and <same>.5), I ran the same route command and am not able to ping google.com (it says, "ping: host unreachable").
Perhaps it's because there's only one eth0 interface (or port). But I thought I solved that by binding the multiple IPs to eth0 by doing eth0:0, eth0:1, and eth0:2. For example, in /etc/sysconfig/network-scripts, on the first machine, I put IPADDR=192.168.81.3 in file ifcfg-eth0:0; on the 2nd box, I put IPADDR=192.168.81.4 in the file ifcfg=eth0:1; & on the 3rd box, I put IPADDR=192.168.81.5 in the file ifcfg-eth0:2. On all three machines, DEVICE=eth0:x (where x = the applicable number), BOOTPROTO=static, NETMASK=255.255.255.0, and ONBOOT=yes.
What gives?