Symptoms
Virtual machine random network connectivity issues with VirtualBox. Using ping
command results in:
# ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=22.2 ms 64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=22.3 ms (DUP!) 64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=22.1 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=22.2 ms (DUP!) ^C --- 8.8.8.8 ping statistics --- 2 packets transmitted, 2 received, +2 duplicates, 0% packet loss, time 1009ms rtt min/avg/max/mdev = 22.106/22.248/22.368/0.142 ms
Solution
Disable host operating system’s IP forwarding:
# sysctl -w net.ipv4.ip_forward=0 net.ipv4.ip_forward = 0
If sysctl
command is not available execute:
# echo 0 > /proc/sys/net/ipv4/ip_forward