0

I have a Fedora 22 laptop with a VirtualBox VM on it. All worked fine when I attached the VM to my wireless network card, but I want to attach it to my hardwired card because the wireless changes. But I cannot ping the VM from my host. Any suggestions?

Here is what I've done:

  • Configured my hardwired nic. Set it to not be managed by Networkmanager. I have brought it up, and I can ping it. ifconfig shows:

    enp0s25: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500`
        inet 10.0.1.1  netmask 255.255.255.0  broadcast 10.0.1.255`
        ether 3c:97:0e:38:c4:9d  txqueuelen 1000  (Ethernet)
    
  • Configured my VM with an IP of 10.0.1.100

  • Ensured that the VM network device is enabled and attached to "Bridged Adapter", and that it is indeed the hardwired nic.

I start tcpdump -i enp0s25 -n on my host. When I ping out from my VM- that is, i ping my host's interface using ping 10.0.1.1, I get the following on my host:

01:11:57.831609 ARP, Request who-has 10.0.1.1 tell 10.0.1.100, length 46
01:11:59.827699 ARP, Request who-has 10.0.1.1 tell 10.0.1.100, length 46
01:12:00.827591 ARP, Request who-has 10.0.1.1 tell 10.0.1.100, length 46

the VM says, "Destination host unreachable" (as you would expect when ARP does not reply).

BTW, I checked with Wireshark and I have verified that the incoming arp packet is not VLAN tagged. Just to be sure.

Thanks

  • Note that I have no cable connected to my nic. ...I wonder if that's apropros...? Because if I try to ping, Linux will not send out any packet even though the nic is "UP" according to ifconfig. – Mike S Dec 6 '15 at 8:17
0

There was no network cable in the nic. Linux will not send out a network packet if Link detected showed "No".

  • Now the question is: Can I create a device for virtual machines only, which won't use a genuine nic, so I can circumvent this issue? I want to be able to travel (== no network connection) and have my network still operate. – Mike S Dec 6 '15 at 8:27
  • 1
    Do a NAT config. Not every places where you connect will give you the necessary IP addresses. – Rui F Ribeiro Dec 6 '15 at 8:31
  • Yeah, I think you're on to it. I wanted to be able to serve PXE requests from my VM, so I was thinking bridged mode. But I can't have my cake and eat it too. So I'm going to create a host-only network, serve up PXE locally to my other VMs, and add a NATed nic to the VM for connecting to the Internet. Thanks. – Mike S Dec 6 '15 at 8:42
  • off-topic, are you toying with vagrant? using ansible here. – Rui F Ribeiro Dec 6 '15 at 9:59
  • No, but thanks for the suggestion. It looks interesting! I'm a salt person myself, we'll see if I can use it with salt. – Mike S Dec 8 '15 at 0:04

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.