I am using Debian stretch to run a Debian jessie guest. I have the guest setup with a NAT and a Host-only adapter. When I try to ping my guest from my host, my ping gets routed to my wireless Internet adapter instead of the virtual network.
ifconfig -a, the virtual host-only network:
vboxnet1: flags=4098<BROADCAST,MULTICAST> mtu 1500 inet 172.16.57.1 netmask 255.255.0.0 broadcast 172.16.255.255 ether 0a:00:27:00:00:01 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 0 overruns 0 carrier 0 collisions 0
and my wireless adapter:
wlp4s1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.103 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::218:39ff:fe19:2edd prefixlen 64 scopeid 0x20<link> ether 00:18:39:19:2e:dd txqueuelen 1000 (Ethernet) RX packets 473074 bytes 138461228 (132.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 438482 bytes 389764274 (371.7 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
My routing table:
$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlp4s1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp4s1
I would expect there to be some routes in
netstat -rn directing relevant traffic to the virtual host-only nextwork, but I don't see this.
When I try to ping my guest (puffin) from my host:
$ ping puffin PING puffin (172.16.57.101) 56(84) bytes of data. From 1-128-201-31.ftth.glasoperator.nl (184.108.40.206) icmp_seq=1 Packet filtered
I have my guest's IP address (on eth1/the host-only adapter) set statically to 172.16.57.101 (and it is up) and dhcp is disabled on vboxnet1 (the host-only network).
I found the problem with:
ip link ... 5: vboxnet1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 0a:00:27:00:00:01 brd ff:ff:ff:ff:ff:ff