Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
When you create a NIC in your VM, you connect it to one of three "networks" in VMWare. Your choices are bridged, NAT'ed, or Host-Only.
Bridged mode means that the VM NIC is connected directly to the same network as the host OS NIC (when you run VMWare config, you can choose which physical NIC is bridged.)
NAT'ed means that (by default) the VM can talk out to the host OS, but nothing can get in to the VM. This is the same config as your home router - unless your forward ports, nothing can get in to your internal machines.
Host-Only is just that - a private network segment that only VMWare routes. Only other VM's on the host-only segment can talk to each other - there is no route off of that subnet.
Based on this, you cannot arbitrarily assign an IP to your VM on any subnet and expect it to work. If you want to use an IP in your VM on the 192.168 subnet, the NIC in the VM needs to be in bridged mode.
If the NIC in VM is NAT'ed, only a valid address on the 172.16.103.0 segment will work.
This is why your VM *can* connect out (using the 172 IP) and your Ubuntu *cannot* ping the guest via 192.168.
If your VM NIC is on the NAT'ed network (which your postings show it is), then the only way for anything to be passed from Ubuntu into CentOS is to forward the necessary ports in VMWare.
When you create a NIC in your VM, you connect it to one of three "networks" in VMWare. Your choices are bridged, NAT'ed, or Host-Only.
Bridged mode means that the VM NIC is connected directly to the same network as the host OS NIC (when you run VMWare config, you can choose which physical NIC is bridged.)
NAT'ed means that (by default) the VM can talk out to the host OS, but nothing can get in to the VM. This is the same config as your home router - unless your forward ports, nothing can get in to your internal machines.
Host-Only is just that - a private network segment that only VMWare routes. Only other VM's on the host-only segment can talk to each other - there is no route off of that subnet.
Based on this, you cannot arbitrarily assign an IP to your VM on any subnet and expect it to work. If you want to use an IP in your VM on the 192.168 subnet, the NIC in the VM needs to be in bridged mode.
If the NIC in VM is NAT'ed, only a valid address on the 172.16.103.0 segment will work.
This is why your VM *can* connect out (using the 172 IP) and your Ubuntu *cannot* ping the guest via 192.168.
If your VM NIC is on the NAT'ed network (which your postings show it is), then the only way for anything to be passed from Ubuntu into CentOS is to forward the necessary ports in VMWare.
Hereunder is the notes taken down previously on running
"vmware-config.pl"
Code:
Making sure services for VMware Server are stopped.
Stopping VMware services:
Virtual machine monitor done
Configuring fallback GTK+ 2.4 libraries.
In which directory do you want to install the mime type icons?
[/usr/share/icons] [Enter]
What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications] [Enter]
In which directory do you want to install the application's icon?
[/usr/share/pixmaps] [Enter]
Trying to find a suitable vmmon module for your running kernel.
None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes] [Enter]
What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.20-15-generic/build/include] [Enter]
The module loads perfectly in the running kernel.
Do you want networking for your virtual machines? (yes/no/help) [yes] [Enter]
Configuring a bridged network for vmnet0.
The following bridged networks have been defined:
. vmnet0 is bridged to eth0
All your ethernet interfaces are already bridged.
Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes] [Enter]
Configuring a NAT network for vmnet8.
Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes] [Enter]
Probing for an unused private subnet (this can take some time)...
The subnet 192.168.213.0/255.255.255.0 appears to be unused.
The following NAT networks have been defined:
. vmnet8 is a NAT network on private subnet 192.168.213.0.
Do you wish to configure another NAT network? (yes/no) [no] [Enter]
Do you want to be able to use host-only networking in your virtual machines?
[yes] [Enter]
Configuring a host-only network for vmnet1.
Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes] [Enter]
Probing for an unused private subnet (this can take some time)...
The subnet 172.16.77.0/255.255.255.0 appears to be unused.
The following host-only networks have been defined:
. vmnet1 is a host-only network on private subnet 172.16.77.0.
Do you wish to configure another host-only network? (yes/no) [no] [enter]
......
The module loads perfectly in the running kernel.
Please specify a port for remote console connections to use [902] [Enter]
....
Generating SSL Server Certificate
In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines] [Enter]
The path "/var/lib/vmware/Virtual Machines" does not exist currently. This
program is going to create it, including needed parent directories. Is this
what you want? [yes] [Enter]
Please enter your 20-character serial number.
.....
Please shed me some light on the mistake committed by me previously. I'll re-run "vmware-config.pl". TIA
There is no mistake in the VMWare config - but what you are trying to do with the NIC's/IP's in the virtual machine will not work.
In the config script you just posted, your virtual machine's NIC can be connected to one of 3 networks:
1. Bridged directly to eth0 (because bridges are transparent, there is nothing in ifconfig in Ubuntu for the bridge connection)
2. NAT'ed and on the subnet 192.168.213.0/255.255.255.0 (known as vmnet8 in Ubuntu ifconfig)
3. Host-Only on the subnet 172.16.77.0/255.255.255.0 (known as vmnet1 in Ubuntu ifconfig)
If your CentOS's NIC is on the NAT network, you cannot just pick any IP and use it - you need a valid IP for the subnet it's attached to (just like the real world.) In this case, it would need an IP in the 192.168.213.0/24 range. Also, VMWare runs a DHCP server on the NAT'ed and Host-Only networks, so guest OS's can just use DHCP as well.
VMWare is very flexible and you can create multiple bridges (assuming the host OS has multiple NIC's), you can create more than one NAT network, and you can create more than one host-only network.
This is how it works - so if your CentOS is on the NAT network, you must forward ports from Ubuntu into CentOS (through VMWare) in order to run any "server" applications. Previous link contains information on how to forward ports to the VMWare NAT network.
There is no mistake in the VMWare config - but what you are trying to do with the NIC's/IP's in the virtual machine will not work.
In the config script you just posted, your virtual machine's NIC can be connected to one of 3 networks:
1. Bridged directly to eth0 (because bridges are transparent, there is nothing in ifconfig in Ubuntu for the bridge connection)
2. NAT'ed and on the subnet 192.168.213.0/255.255.255.0 (known as vmnet8 in Ubuntu ifconfig)
3. Host-Only on the subnet 172.16.77.0/255.255.255.0 (known as vmnet1 in Ubuntu ifconfig)
If your CentOS's NIC is on the NAT network, you cannot just pick any IP and use it - you need a valid IP for the subnet it's attached to (just like the real world.) In this case, it would need an IP in the 192.168.213.0/24 range. Also, VMWare runs a DHCP server on the NAT'ed and Host-Only networks, so guest OS's can just use DHCP as well.
VMWare is very flexible and you can create multiple bridges (assuming the host OS has multiple NIC's), you can create more than one NAT network, and you can create more than one host-only network.
This is how it works - so if your CentOS is on the NAT network, you must forward ports from Ubuntu into CentOS (through VMWare) in order to run any "server" applications. Previous link contains information on how to forward ports to the VMWare NAT network.
# Linux NAT configuration file
[host]
# NAT gateway address
ip = 172.16.103.2
netmask = 255.255.255.0
# or ip = 172.16.103.2/24
# enable configuration; disabled by default for security reasons
#configport = 33445
# VMnet device if not specified on command line
device = /dev/vmnet8
# Allow PORT/EPRT FTP commands (they need incoming TCP stream...)
activeFTP = 1
# Allows the source to have any OUI. Turn this one if you change the OUI
# in the MAC address of your virtual machines.
#allowAnyOUI = 1
[udp]
# Timeout in seconds, 0 = no timeout, default = 60; real value might
# be up to 100% longer
timeout = 60
[incomingtcp]
# Use these with care - anyone can enter into your VM through these...
# FTP (both active and passive FTP is always enabled)
# ftp localhost 8887
#8887 = 172.16.103.128:21
# WEB (make sure that if you are using named webhosting, names point to
# your host, not to guest... And if you are forwarding port other
# than 80 make sure that your server copes with mismatched port
# number in Host: header)
lynx http://localhost:8888
8888 = 172.16.103.128:80
# SSH
# ssh -p 8889 root@localhost
#8889 = 172.16.103.128:22
[incomingudp]
# UDP port forwarding example
#6000 = 172.16.103.128:6001
$ sudo /usr/lib/vmware/net-services.sh restart
Code:
Bridged networking on /dev/vmnet0 done
DHCP server on /dev/vmnet1 done
Host-only networking on /dev/vmnet1 done
DHCP server on /dev/vmnet8 done
NAT service on /dev/vmnet8 done
Host-only networking on /dev/vmnet8 done
Bridged networking on /dev/vmnet0 done
Host-only networking on /dev/vmnet1 (background) done
Host-only networking on /dev/vmnet8 (background) done
NAT service on /dev/vmnet8 done
A) Why is the "lynx" line uncommented in the NAT config? You only need the 8888 line.
B) If you did not modify the httpd config in CentOS, you are running a *plaintext* httpd server on CentOS's port 80 - why are you using https:// in your address?
C) From your config, you are saying that when a packet hits port 8888 in Ubuntu, forward it to port 80 on the NAT'ed VMWare network - so you need to request port 8888 in an external web browser.
D) www.domain.com (I am assuming) resolves to an external, public IP - if you are testing this from Ubuntu, you are trying to get to an IP that would make your router "loopback" through itself. This is a bad thing and most routers won't do it. So using a name like www.domain.com *from inside* your private network is probably not going to work.
E) Have you verified the webserver is even running/working in CentOS? From command line in CentOS, try using something like wget to pull a webpage from IP 172.16.103.128 - port 80.
F) If THAT works, use Firefox on Ubuntu to open http://172.16.103.128 (Might want to ping 172.16.103.128 as well.)
A) Why is the "lynx" line uncommented in the NAT config? You only need the 8888 line.
B) If you did not modify the httpd config in CentOS, you are running a *plaintext* httpd server on CentOS's port 80 - why are you using https:// in your address?
C) From your config, you are saying that when a packet hits port 8888 in Ubuntu, forward it to port 80 on the NAT'ed VMWare network - so you need to request port 8888 in an external web browser.
D) www.domain.com (I am assuming) resolves to an external, public IP - if you are testing this from Ubuntu, you are trying to get to an IP that would make your router "loopback" through itself. This is a bad thing and most routers won't do it. So using a name like www.domain.com *from inside* your private network is probably not going to work.
E) Have you verified the webserver is even running/working in CentOS? From command line in CentOS, try using something like wget to pull a webpage from IP 172.16.103.128 - port 80.
F) If THAT works, use Firefox on Ubuntu to open http://172.16.103.128 (Might want to ping 172.16.103.128 as well.)
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done.
[ OK ]
On Ubuntu
$ sudo /etc/init.d/apache2 stop
Code:
Password:
* Stopping web server (apache2)... [ OK ]
Open Source Security Myths Dispelled Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization subscribe
InformationWeek InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology. subscribe