VMware Communities
dragon1988
Contributor
Contributor
Jump to solution

Guest can't connect to Internet in NAT mode

3 virtual machines are in my network, all running Ubuntu Desktop. I've configured one of them as a router and the other two can ping each other flawlessly in LAN. But after adding a NAT adapter(ens37), when I ping google.com, it still asks my Ubuntu router(ens33) for it. Something wrong with default gateway? How to make it work?

Pinging google from the guest after adding NAT:

 

PING google.com (216.239.38.120) 56(84) bytes of data.
From _gateway (10.0.0.1) icmp_seq=1 Destination Net Unreachable
From _gateway (10.0.0.1) icmp_seq=2 Destination Net Unreachable

--- google.com ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1002ms

 

The guest's gateway:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    20100  0        0 ens33
0.0.0.0         192.168.26.2    0.0.0.0         UG    20101  0        0 ens37
10.0.0.0        0.0.0.0         255.0.0.0       U     100    0        0 ens33
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 ens33
192.168.26.0    0.0.0.0         255.255.255.0   U     101    0        0 ens37

 

Thanks.

 

Labels (3)
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

Remove the default gateway for ens33, and configure static routes for internal networks instead.

André

View solution in original post

3 Replies
a_p_
Leadership
Leadership
Jump to solution

Remove the default gateway for ens33, and configure static routes for internal networks instead.

André

dragon1988
Contributor
Contributor
Jump to solution

Thanks, this way it works.

But what was wrong with the default gateway thing?

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

With two default gateways configured, Ubuntu will use one of them, so that correct routing is either a hit, or miss.

André