NAT Network - No Connection

Discussions related to using VirtualBox on Linux hosts.
Post Reply
AD
Posts: 3
Joined: 15. Aug 2018, 18:18

NAT Network - No Connection

Post by AD »

Hi Everyone,

I've been struggling with this issue for a few weeks now and could use some help getting a NAT Network up and running. I want to be able to connect multiple VMs to the same NAT network and have them able be on the same subnet, while still being able to exit the gateway and onto the internet. It seems that the Gateway/DHCP Server is down.

From the Linux Host:

Code: Select all

$ vboxmanage list natnets
NetworkName:    VBoxNATNetwork
IP:             192.168.132.1
Network:        192.168.132.0/24
IPv6 Enabled:   No
IPv6 Prefix:    fd17:625c:f037:2::/64
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2


vboxmanage list dhcpservers
NetworkName:    VBoxNATNetwork
IP:             192.168.132.1
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.132.50
upperIPAddress: 192.168.132.99
Enabled:        Yes
and from the Linux guest:

Code: Select all

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:84:c6:e6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.132.50/24 brd 192.168.132.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe84:c6e6/64 scope link 
       valid_lft forever preferred_lft forever


$ ip r
default via 192.168.132.1 dev eth0 
192.168.132.0/24 dev eth0 proto kernel scope link src 192.168.132.50 
But when I try to ping the gateway, I get nothing:

Code: Select all

$ ping 192.168.132.1
PING 192.168.132.1 (192.168.132.1) 56(84) bytes of data.
^C
--- 192.168.132.1 ping statistics ---
20 packets transmitted, 0 received, 100% packet loss, time 19453ms
Any ideas what I'm doing wrong here?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: NAT Network - No Connection

Post by socratis »

AD wrote:Any ideas what I'm doing wrong here?
Maybe...
AD wrote:
$ vboxmanage list natnets
NetworkName:    VBoxNATNetwork
IP:             192.168.132.1
AD wrote:
vboxmanage list dhcpservers
NetworkName:    VBoxNATNetwork
IP:             192.168.132.1
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.132.50
upperIPAddress: 192.168.132.99
Your DHCP server has the same address as your gateway. Try to change the DHCP server to its "defaults", i.e. IP: 192.168.132.100, and DHCP range: 192.168.132.101-192.168.132.254.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: NAT Network - No Connection

Post by Martin »

I also did a quick test and the example from the manual + 'dhcp on'

Code: Select all

VBoxManage natnetwork add --netname natnet1 --network "192.168.15.0/24" --enable --dhcp on
created the dhcp server at .3

Code: Select all

$ VBoxManage list dhcpservers
NetworkName:    natnet1
IP:             192.168.15.3
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.15.4
upperIPAddress: 192.168.15.254
Enabled:        Yes
The client did get the address .4 and can ping the gateway at .1
The dhcp server address doesn't respond to a ping but appears in the arp table:

Code: Select all

>arp -a
Schnittstelle: 192.168.15.4 --- 0xa
  Internetadresse       Physische Adresse     Typ
  192.168.15.1          52-54-00-12-35-00     dynamisch
  192.168.15.3          08-00-27-5f-eb-d9     dynamisch
AD
Posts: 3
Joined: 15. Aug 2018, 18:18

Re: NAT Network - No Connection

Post by AD »

No Dice to either -

I changed the DHCP server address to 192.168.132.100 and the defaults, still can't ping .1 or the outside world.

I deleted all DHCP Servers and NatNetworks via host command line, then ran verbatim

Code: Select all

VBoxManage natnetwork add --netname natnet1 --network "192.168.15.0/24" --enable --dhcp on
Guest displayed this:

Code: Select all

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:84:c6:e6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.15.4/24 brd 192.168.15.255 scope global dynamic noprefixroute eth0
       valid_lft 1053sec preferred_lft 1053sec
    inet6 fe80::a00:27ff:fe84:c6e6/64 scope link 
       valid_lft forever preferred_lft forever
But still unable to ping anything:

Code: Select all

$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.15.4 icmp_seq=1 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, +1 errors, 100% packet loss, time 2013ms

$ ping 192.168.15.1
PING 192.168.15.1 (192.168.15.1) 56(84) bytes of data.
From 192.168.15.4 icmp_seq=1 Destination Host Unreachable
From 192.168.15.4 icmp_seq=2 Destination Host Unreachable
From 192.168.15.4 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.15.1 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3055ms
pipe 4

$ ping 192.168.15.3
PING 192.168.15.3 (192.168.15.3) 56(84) bytes of data.
^C
--- 192.168.15.3 ping statistics ---
9 packets transmitted, 0 received, 100% packet loss, time 8146ms
Additional route info:

Code: Select all

$ ip r
default via 192.168.15.1 dev eth0 proto dhcp metric 100 
192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.4 metric 100 
EDIT: Add Host DHCP info:

Code: Select all

$ vboxmanage list dhcpservers
NetworkName:    natnet1
IP:             192.168.15.3
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.15.4
upperIPAddress: 192.168.15.254
Enabled:        Yes
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: NAT Network - No Connection

Post by socratis »

Post in a ZIPPED file the following two:
  • "VirtualBox.xml", located either in "$HOME/.config/VirtualBox", or "$HOME/.VirtualBox".
  • The recipe of the VM. Right-click on the VM in the VirtualBox Manager, Show in <something>. That "<VM>.vbox" file is the VM recipe.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
AD
Posts: 3
Joined: 15. Aug 2018, 18:18

Re: NAT Network - No Connection

Post by AD »

Attached:
Attachments
vbox.tar.gz
(2.77 KiB) Downloaded 28 times
Post Reply