LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Cannot ping host from guest (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/cannot-ping-host-from-guest-803178/)

cucolin@ 04-20-2010 09:25 PM

Cannot ping host from guest
 
Not sure if this post belongs here, but here it is. This is a dedicated win 2003.
Host: Win server 2003
Guest: Ubuntu server

Host: IS able to ping guest. Firewall is OFF. NOT able to access guest (which is a web-server) at browser.
Guest: NOT able to ping host. Running a web server, you can check the website: (pegajosa.com) is running under that virtual linux server.

Problem: guest needs to access host's sql database and/or any resources.

Network: is bridged.

ifconfig output for linux:

inet addr:208.85.240.163 Bcast:208.85.240.175 Mask:255.255.255.240


for host (win 2003) ipcofing /all:

Ethernet adapter VMware Network Adapter VMnet8:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
Physical Address. . . . . . . . . : 00-50-56-C0-00-08
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.239.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . : 208.85.240.162

Ethernet adapter VMware Network Adapter VMnet1:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.248.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) 82566DC Gigabit Network Connection
Physical Address. . . . . . . . . : 00-1C-C0-F2-A7-A8
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 208.85.240.xxx
Subnet Mask . . . . . . . . . . . : 255.255.255.240
IP Address. . . . . . . . . . . . : 208.85.240.xxx
Subnet Mask . . . . . . . . . . . : 255.255.255.240
IP Address. . . . . . . . . . . . : 208.85.240.xxx
Subnet Mask . . . . . . . . . . . : 255.255.255.240
IP Address. . . . . . . . . . . . : 208.85.240.xxx
Subnet Mask . . . . . . . . . . . : 255.255.255.240
IP Address. . . . . . . . . . . . : 208.85.240.xxx
Subnet Mask . . . . . . . . . . . : 255.255.255.240
IP Address. . . . . . . . . . . . : 208.85.240.xxx
Subnet Mask . . . . . . . . . . . : 255.255.255.240
Default Gateway . . . . . . . . . : 208.85.240.xxx
DNS Servers . . . . . . . . . . . : 209.9.238.7
208.85.242.24
Primary WINS Server . . . . . . . : 209.9.238.7

jiml8 04-21-2010 01:20 AM

The guest's address, as specified, is not in the subnet of either vmnet virtual adapter that you have specified. From what I see, it looks like you have specified the external IP address of the client system, which presumably is how it is accessed from outside. I do know that if I enter that IP in a browser I do get to a site, presumably yours.

I presume you are doing forwarding somehow (I don't know how it is done in Windows Server) to forward from the external address to the internal guest address.

Alternatively, you have defined the guest as having the specified external address, in which case it is not part of a subnet with the host, and this is why you can't connect with the host. If this is the case, you need to set up the routing table on the guest system properly.

You also haven't specified the version of VMWare. I think that the default configuration of VMWare has vmnet0 as bridged, vmnet1 as host-only, and vmnet8 as NAT.

You apparently don't have a vmnet0, and have not provided enough information to identify whether vmnet1 and vmnet8 are as defined by default.

From the information you have provided, I can't tell a thing.

I need to see ifconfig -a for the Linux client, and the complete routing tables for both the host and the client.

cucolin@ 04-21-2010 10:16 AM

VMware: Guest cannot ping Host
 
jiml8, thanks for trying to help me. below is the information you requested, let me know if you need more information.

I don't think I'm doing forwarding. This win server has various IPs assign to it. This is a dedicated server. I took one of the IPs .163 from the available IP list this host provider assigned.

1. Version of VMware:
VMware Infrastructure Web Access
VMware Server
Version 2.0.0
Build 128374

2. You are right I only have vmnet1 and vmnet8.
3. How do I find out your question: "have not provided enough information to identify whether vmnet1 and vmnet8 are as defined by default."
4. Do I need a vmnet0?


5. ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0c:29:57:54:ad
inet addr:208.85.240.163 Bcast:208.85.240.175 Mask:255.255.255.240
inet6 addr: fe80::20c:29ff:fe57:54ad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:399728 errors:0 dropped:0 overruns:0 frame:0
TX packets:463720 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:56199935 (56.1 MB) TX bytes:410283205 (410.2 MB)
Interrupt:19 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:92141 errors:0 dropped:0 overruns:0 frame:0
TX packets:92141 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16170921 (16.1 MB) TX bytes:16170921 (16.1 MB)

5. netstat -rn (linux)
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
208.85.240.160 0.0.0.0 255.255.255.240 U 0 0 0 eth0
0.0.0.0 208.85.240.161 0.0.0.0 UG 0 0 0 eth0

6. IPv4 Route Table (win server 2003)
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 50 56 c0 00 08 ...... VMware Virtual Ethernet Adapter for VMnet8
0x3 ...00 50 56 c0 00 01 ...... VMware Virtual Ethernet Adapter for VMnet1
0x10005 ...00 1c c0 f2 a7 a8 ...... Intel(R) 82566DC Gigabit Network Connection
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 208.85.240.161 208.85.240.162 10
67.131.198.194 255.255.255.255 208.85.240.161 208.85.240.162 10
67.230.145.97 255.255.255.255 208.85.240.161 208.85.240.162 10
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
173.206.6.243 255.255.255.255 208.85.240.161 208.85.240.162 10
173.206.17.185 255.255.255.255 208.85.240.161 208.85.240.162 10
192.168.239.0 255.255.255.0 192.168.239.1 192.168.239.1 20
192.168.239.1 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.239.255 255.255.255.255 192.168.239.1 192.168.239.1 20
192.168.248.0 255.255.255.0 192.168.248.1 192.168.248.1 20
192.168.248.1 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.248.255 255.255.255.255 192.168.248.1 192.168.248.1 20
208.85.240.160 255.255.255.240 208.85.240.162 208.85.240.162 10
208.85.240.162 255.255.255.255 127.0.0.1 127.0.0.1 10
208.85.240.163 255.255.255.255 127.0.0.1 127.0.0.1 10
208.85.240.164 255.255.255.255 127.0.0.1 127.0.0.1 10
208.85.240.165 255.255.255.255 127.0.0.1 127.0.0.1 10
208.85.240.166 255.255.255.255 127.0.0.1 127.0.0.1 10
208.85.240.167 255.255.255.255 127.0.0.1 127.0.0.1 10
208.85.240.255 255.255.255.255 208.85.240.162 208.85.240.162 10
224.0.0.0 240.0.0.0 192.168.239.1 192.168.239.1 20
224.0.0.0 240.0.0.0 192.168.248.1 192.168.248.1 20
224.0.0.0 240.0.0.0 208.85.240.162 208.85.240.162 10
255.255.255.255 255.255.255.255 192.168.239.1 192.168.239.1 1
255.255.255.255 255.255.255.255 192.168.248.1 192.168.248.1 1
255.255.255.255 255.255.255.255 208.85.240.162 208.85.240.162 1
Default Gateway: 208.85.240.161
===========================================================================
Persistent Routes:
None

jiml8 04-21-2010 01:29 PM

you should put the information in code tags so that it will be spaced properly. Much easier to read.

I was right. Your Linux guest has no route to find the Windows host, and you have directly assigned it an internet-facing address.

Your guest is only showing one interface, and that interface is directly facing the internet. With that configuration, I don't think you will be able to get your guest to see the host at all since the host is on a 192.168 subnet which is non-routable.

Your choices, I think, are to use the VMWare networking setup to bind an additional virtual network adapter into your linux guest, then route to the host through that. VMWare Server 2.0 supports up to 10 virtual network connections per virtual machine.

Alternatively, you may reconfigure your network so that your guest system has a 192.168 address. It then will be able to see the host since it is on the same subnet, and you can use the host's facilities to masquerade the internal 192.168 guest address to the desired external 208.85 address. This is certainly possible using Windows Server and, if I was sitting in front of the computer I am sure I could figure it out, but from here I can't tell you because it has been a decade since I've used Windows Server.

I think the simpler choice is to add the new virtual network adapter to the guest and assign it a 192.168 address. The guest's network setup should then handle all the details, and if it doesn't, one new line in the routing table would be all you'd need. The VMWare networking wizard will take you right through all the setup stuff for the additional network adapter.

cucolin@ 04-21-2010 09:22 PM

Quote:

I think the simpler choice is to add the new virtual network adapter to the guest and assign it a 192.168 address. The guest's network setup should then handle all the details, and if it doesn't, one new line in the routing table would be all you'd need. The VMWare networking wizard will take you right through all the setup stuff for the additional network adapter.

I don't see the option to do this in my version of vmware server (this is the web based one).
I believe I found it: http://www.virtuatopia.com/index.php...irtual_Machine

I needed to shut down the vm machine first! thanks..

cucolin@ 04-22-2010 11:20 PM

jiml8,
i'm confused! i added the new virtual network adapter following these instrutions:
http://www.virtuatopia.com/index.php...k_Architecture

i tried assigning the new virtual adapter: eth1 (i created this as bridge).
i made it 192.168.240.1 / 255.255.255.0
i follow these instructions: http://en.kioskea.net/faq/979-having...er-ubuntu-8-10
after restarting the network, i got disconnected and everything went down: website, ssh, vmware console.
i had to revert to a snapshot.

maybe i'm doing something wrong, can you assist? thanks..

jiml8 04-23-2010 01:01 AM

You have nothing to bridge to. you don't want to add a bridge; you want to add a host-only network adapter. You won't want to assign it as 192.168.240.1 (though you could...) because that normally would be the gateway address, and VMWare will most probably assign it to the vmnet# virtual adapter that it creates in the host machine.

The description in the first link you provided tells you what is happening. VMWare sets up a virtual switch. Think of it as being a physical box, and your host as one physical computer and your guest as another physical computer. In this case, you need two cables: one from the guest to the switch and the other from the host to the switch. Thus, you obviously need two addresses: one for the host and one for the guest.

Of course, the host and the guest and the switch aren't in distinct physical boxes, so all of this is virtual. That it is virtual makes it nonetheless real. You don't need physical cables to hook things together; you need virtual ones - and VMWare will handle that for you unless you over-think it.

So, VMWare will assign a non-routable address to the vmnet# adapter it provides for the host, and you have to tell it to provide another network adapter in the guest, and you have to provide an address on the same subnet for the adapter in the guest.

The point is to put both the host and the client on the same subnet so that they can talk to each other.

Your host configuration already shows a vmnet1 (which VMWare usually defines as host-only...though you might have changed that...) with an address of 192.168.239.1 and that would be fine for you. Just set up a host-only adapter in the guest and assign it with a 192.168.239.xxx address and you should be good to go.

You set up the adapter in the guest using the Preferences requester in the virtual machine's settings options. I don't know exactly how it is done in Server since I have Workstation.

cucolin@ 04-23-2010 08:18 AM

hey thanks,
I will try that in a moment and post the results here.

cucolin@ 04-23-2010 01:46 PM

Hi,
this is what i have now at the linux box:
Quote:

eth0 Link encap:Ethernet HWaddr 00:0c:29:57:54:ad
inet addr:208.85.240.163 Bcast:208.85.240.175 Mask:255.255.255.240
inet6 addr: fe80::20c:29ff:fe57:54ad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:579 errors:0 dropped:0 overruns:0 frame:0
TX packets:762 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:79319 (79.3 KB) TX bytes:745686 (745.6 KB)
Interrupt:19 Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:0c:29:57:54:b7
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:18 Base address:0x2080

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:104 errors:0 dropped:0 overruns:0 frame:0
TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:10296 (10.2 KB) TX bytes:10296 (10.2 KB)
I'm having issues finding the 'Preferences requester' for configuring that host-only nic. should I do this at the linux command line instead?

jiml8 04-23-2010 02:49 PM

That looks right. You now have to assign an address to eth1. The address should be a 192.168.239.xxx address, and specify a default gateway for it of 192.168.239.1.

Also, the Preferences should be on the VMWare server system, which is running on the host. Like I say, I use Workstation here, not server, so I don't know exactly how server does things.

cucolin@ 04-23-2010 03:01 PM

Quote:

That looks right. You now have to assign an address to eth1. The address should be a 192.168.239.xxx address, and specify a default gateway for it of 192.168.239.1.
do I assign this at the linux virtual box or at the host network management?

jiml8 04-23-2010 03:43 PM

You do it IN LINUX.

cucolin@ 04-25-2010 01:02 AM

This is how it looks now:

ifconfig -a
Quote:

eth0 Link encap:Ethernet HWaddr 00:0c:29:57:54:ad
inet addr:208.85.240.163 Bcast:208.85.240.175 Mask:255.255.255.240
inet6 addr: fe80::20c:29ff:fe57:54ad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:203631 errors:0 dropped:0 overruns:0 frame:0
TX packets:244872 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28887266 (28.8 MB) TX bytes:245318245 (245.3 MB)
Interrupt:19 Base address:0x2000

eth0:1 Link encap:Ethernet HWaddr 00:0c:29:57:54:b7
inet addr:192.168.239.101 Bcast:192.168.239.255 Mask:255.255.255.0
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:980 (980.0 B) TX bytes:7387 (7.3 KB)
Interrupt:18 Base address:0x2080

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:53836 errors:0 dropped:0 overruns:0 frame:0
TX packets:53836 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6530680 (6.5 MB) TX bytes:6530680 (6.5 MB)
when i try to ping 192.168.239.1, I get:
From 192.168.239.101 icmp_seq=2 Destination Host Unreachable
From 192.168.239.101 icmp_seq=3 Destination Host Unreachable
From 192.168.239.101 icmp_seq=4 Destination Host Unreachable

i would communicate to the host by using this ip: 192.168.239.1(win host)
this is my interfaces file:

iface eth0:1 inet static
address 192.168.239.101
netmask 255.255.255.0
gateway 192.168.239.1

jiml8 04-25-2010 04:40 AM

You have specified a second name for eth0. You don't want to do that because that is sending your communications out of eth0, and thus onto the net regardless of destination, and the 192.168 address range is not routable, so those packets don't find their way to the host.

Your Windows host already has an internal vmnet adapter (vmnet1) that has the address 192.168.239.1. You want to connect with THAT adapter.

Get rid of eth0:1. Install a virtual network interface into your virtual machine using VMWare's networking, identify that interface as eth1, and make eth1 have the address 192.168.239.101.

The guest system's networking setup should then figure out that anything going to 192.168.239.0/24 should go through eth1. If it doesn't figure that out, tell it with a route add command.

Then it will work.

cucolin@ 04-25-2010 11:25 AM

when i do the configuration below, i lose all connections to the linux box:

Quote:

iface eth1 inet static
address 192.168.239.101
netmask 255.255.255.0
gateway 192.168.239.1
i had to go to the vmware console to fix things.
according to most wiki/how-tos this is the way to set that second nic in ubuntu:
Quote:

auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x
what network,broadcast and gateway would be in this case?

this is the windows ipconfig for 192.168.239.1:
Ethernet adapter VMware Network Adapter VMnet8:

Quote:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
Physical Address. . . . . . . . . : 00-50-56-C0-00-08
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.239.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . : 208.85.240.162
at the linux box i still see this after an ifconfig -a:
ifconfig -a
Quote:

eth0 Link encap:Ethernet HWaddr 00:0c:29:57:54:ad
inet addr:208.85.240.163 Bcast:208.85.240.175 Mask:255.255.255.240
inet6 addr: fe80::20c:29ff:fe57:54ad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:239047 errors:0 dropped:0 overruns:0 frame:0
TX packets:280889 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:33829319 (33.8 MB) TX bytes:277964762 (277.9 MB)
Interrupt:19 Base address:0x2000

eth0:1 Link encap:Ethernet HWaddr 00:0c:29:57:54:ad
inet addr:192.168.239.101 Bcast:192.168.239.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:19 Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:0c:29:57:54:b7
inet addr:192.168.239.101 Bcast:192.168.239.255 Mask:255.255.255.0
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:63 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1474 (1.4 KB) TX bytes:7855 (7.8 KB)
Interrupt:18 Base address:0x2080

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:57045 errors:0 dropped:0 overruns:0 frame:0
TX packets:57045 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7289450 (7.2 MB) TX bytes:7289450 (7.2 MB)
when i go to the virtual network editor vmnet0 says: "bridged to an automatically chosen adapter"
can i still use vmnet8? create a vmnet2?

thanks for you help and apologies for not being so savvy.


All times are GMT -5. The time now is 02:23 AM.