0

I created an Ubuntu-16.04 VM via VirtualBox on my osx machine. I'm using 2 network adapters: Bridged Adapter [en0: Wi-Fi (Airport)] and Host-only Adapter (vboxnet0).

This is the ifconfig o/p from the 2 machines, osx first:

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 3c:15:c2:c8:27:d0
    inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
    media: autoselect
    status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=63<RXCSUM,TXCSUM,TSO4,TSO6>
    ether 3e:15:c2:8c:a2:00
    Configuration:
            id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
            maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
            root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
            ipfilter disabled flags 0x2
    member: en1 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 5 priority 0 path cost 0
    member: en2 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 6 priority 0 path cost 0
    media: <unknown type>
    status: inactive
vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:00
    inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255

Ubuntu next:

enp0s3    Link encap:Ethernet  HWaddr 08:00:27:7a:ba:0d
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::f296:f0:610e:2b37/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8596 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7017 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7956786 (7.9 MB)  TX bytes:945469 (945.4 KB)

enp0s8    Link encap:Ethernet  HWaddr 08:00:27:b6:c9:6e
          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::ba63:3f0e:321:ee37/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3864 (3.8 KB)  TX bytes:7966 (7.9 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1065 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1065 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:100747 (100.7 KB)  TX bytes:100747 (100.7 KB)

I'm unable to ping osx from ubuntu:

$ ping 192.168.1.5
PING 192.168.1.5 (192.168.1.5) 56(84) bytes of data.
^C
--- 192.168.1.5 ping statistics ---
480 packets transmitted, 0 received, 100% packet loss, time 490401ms

But I can ping ubuntu (guest) from osx. How can I fix this?

Note: Firewall is disabled on both the machines

I just ran tcpdumps on both the machines and this is the output from the Guest (Ubuntu):

inet 127.0.0.1 netmask 0xff000000
$ sudo tcpdump -nni any dst host 192.168.1.5
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
07:18:46.141730 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1992, seq 1, length 64
07:18:47.156510 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1992, seq 2, length 64
07:18:48.179200 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1992, seq 3, length 64
07:18:49.203053 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1992, seq 4, length 64
07:18:50.227545 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1992, seq 5, length 64
07:18:51.251328 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1992, seq 6, length 64
07:18:51.316782 ARP, Request who-has 192.168.1.5 tell 192.168.1.2, length 28

$ sudo tcpdump -nni any src host 192.168.1.5
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
07:19:43.027612 ARP, Reply 192.168.1.5 is-at 3c:15:c2:c8:27:d0, length 46
07:20:25.011455 ARP, Reply 192.168.1.5 is-at 3c:15:c2:c8:27:d0, length 46
^C
2 packets captured
2 packets received by filter
0 packets dropped by kernel

And on the Host (osx):

$ sudo tcpdump -nni any icmp
tcpdump: data link type PKTAP
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type PKTAP (Packet Tap), capture size 65535 bytes
07:59:37.858801 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1941, seq 6, length 64
07:59:38.882701 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1941, seq 7, length 64
07:59:39.905794 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1941, seq 8, length 64
07:59:40.928857 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1941, seq 9, length 64
07:59:41.953113 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1941, seq 10, length 64
07:59:42.975912 IP 192.168.1.2 > 192.168.1.5: ICMP echo request, id 1941, seq 11, length 64

This means that the Host is indeed receiving ping requests from the guest but isn't responding to them?

1

Have you tried turning the OS X firewall off? Or at least make sure that 'Enable stealth mode' (System Preferences > Security & Privacy > Firewall > Firewall Options...) is unchecked as shown below. It worked for me, but I hadn't set a second network adapter. I had only set a bridged adapter.

Enable stealth mode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.