Nat Network Issues

Discussions related to using VirtualBox on Linux hosts.
Post Reply
mattrickslauer
Posts: 1
Joined: 5. Jan 2024, 21:33

Nat Network Issues

Post by mattrickslauer »

Hello Everyone, I've been having some problems regarding my NatNetwork setup with VirtualBox. The situation is as follows:

I have 3 virtual machines running Ubuntu server 22.04 on a Ubuntu Desktop host. The three machine make up a Kubernetes cluster 1 master and 2 workers, so its imperative that they be LAN. I set up a NatNetwork called "Roley Net", and everything works splendidly until at some point access to the public internet cuts out (LAN still functions fine). All public pings fail and I'm unable to ssh into my machines from the internet. I have found a sort of ghetto solution, I run a script that checks for connectivity to the webpage hosted on the cluster and if no connection is present it stops and starts the natnetwork with the command below:

Code: Select all

vboxmanage natnetwork stop --netname "Roley Net"
vboxmanage natnetwork start --netname "Roley Net"
My hunch is that there is problems with the DHCP server and lease expiration on the IP addresses, the reason being that the network when restarted will work for some time until failing again, about 90 minutes sometimes less.

IMPORTANT NOTE: This problem only occurs on the NAT-NETWORK and doesn't happen with regular NAT, Ive found a few forums related to my issue but wasn't able to extract anything helpful.

https://forums.virtualbox.org/viewtopic.php?t=87891

I would be so helpful if someone could help me figure this out because its crashing my whole network and its quite frankly just annoying :D

Code: Select all

vm@launchpad:~$ vboxmanage list natnetworks
NetworkName:    Roley Net
IP:             10.0.2.1
Network:        10.0.2.0/24
IPv6 Enabled:   No
IPv6 Prefix:    fd17:625c:f037:2::/64
DHCP Enabled:   Yes
Enabled:        Yes
Port-forwarding (ipv4)
        auth api:tcp:[]:20045:[10.0.2.7]:20045
        kube api server:tcp:[]:20077:[10.0.2.7]:20077
        landing:tcp:[]:20025:[10.0.2.7]:20025
        messager:tcp:[]:20026:[10.0.2.7]:20026
        postgres:tcp:[]:5112:[10.0.2.7]:5112
        reverse ssh:tcp:[]:2345:[10.0.2.7]:2345
        selenium hub:tcp:[]:20044:[10.0.2.7]:20044
        ssh master:tcp:[]:3333:[10.0.2.7]:22
        ssh worker 1:tcp:[]:3334:[10.0.2.8]:22
        ssh worker 2:tcp:[]:3335:[10.0.2.9]:22
loopback mappings (ipv4)
        127.0.0.1=2

Code: Select all

vm@launchpad:~$ vboxmanage list dhcpservers
NetworkName:    Roley Net
Dhcpd IP:       10.0.2.1
LowerIPAddress: 10.0.2.2
UpperIPAddress: 10.0.2.254
NetworkMask:    255.255.255.0
Enabled:        Yes
Global Configuration:
    minLeaseTime:     default
    defaultLeaseTime: default
    maxLeaseTime:     default
    Forced options:   None
    Suppressed opts.: None
        1/legacy: 255.255.255.0
        3/legacy: 10.0.2.1
        6/legacy: 10.0.2.1
       15/legacy: this wont let me post but it says cs dot stevens dot edu
Groups:               None
Individual Configs:   None
some perhaps helpful vm info:

Code: Select all

anthony@master-roley:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    100    0        0 enp0s3
10.0.2.0        0.0.0.0         255.255.255.0   U     100    0        0 enp0s3
_gateway        0.0.0.0         255.255.255.255 UH    100    0        0 enp0s3
10.10.121.128   0.0.0.0         255.255.255.192 U     0      0        0 *
10.10.121.141   0.0.0.0         255.255.255.255 UH    0      0        0 calif722ea763f0
10.10.121.145   0.0.0.0         255.255.255.255 UH    0      0        0 cali8f01a008137
10.10.121.146   0.0.0.0         255.255.255.255 UH    0      0        0 cali9b50561b34b
10.10.121.147   0.0.0.0         255.255.255.255 UH    0      0        0 calib34e6eb0e1f
10.10.121.148   0.0.0.0         255.255.255.255 UH    0      0        0 cali643b3166fce
10.10.121.149   0.0.0.0         255.255.255.255 UH    0      0        0 cali049b538ad1f
10.10.130.128   10.0.2.8        255.255.255.192 UG    0      0        0 enp0s3
10.10.185.0     10.0.2.9        255.255.255.192 UG    0      0        0 enp0s3
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0

Code: Select all

anthony@master-roley:~$ ifconfig
cali049b538ad1f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 1000  (Ethernet)
        RX packets 370838  bytes 36405282 (36.4 MB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 380636  bytes 31796141 (31.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

cali643b3166fce: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 1000  (Ethernet)
        RX packets 38176  bytes 3306921 (3.3 MB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 37457  bytes 27199942 (27.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

cali8f01a008137: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 1000  (Ethernet)
        RX packets 32  bytes 2336 (2.3 KB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 5  bytes 446 (446.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

cali9b50561b34b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 1000  (Ethernet)
        RX packets 165200  bytes 81028612 (81.0 MB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 177292  bytes 26944597 (26.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calib34e6eb0e1f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 1000  (Ethernet)
        RX packets 371230  bytes 36255068 (36.2 MB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 380030  bytes 31716236 (31.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calif722ea763f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 1000  (Ethernet)
        RX packets 86236  bytes 26404803 (26.4 MB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 105361  bytes 15138163 (15.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:c3:c2:46:14  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.7  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fe24:4613  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:24:46:13  txqueuelen 1000  (Ethernet)
        RX packets 1264738  bytes 166115810 (166.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1377423  bytes 313142903 (313.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 14411765  bytes 2889072732 (2.8 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 14411765  bytes 2889072732 (2.8 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vxlan.calico: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet 10.10.121.128  netmask 255.255.255.255  broadcast 0.0.0.0
        inet6 fe80::6419:30ff:fec3:8ed1  prefixlen 64  scopeid 0x20<link>
        ether 66:19:30:c3:8e:d1  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 32 overruns 0  carrier 0  collisions 0
Post Reply