No network connection after changing MAC address within Debian guest
Posted: 1. May 2017, 14:24
I use the latest VirtualBox version under Windows 10 Home x64. I created a VM with Debian 8.7 x64. Everything works fine, except one thing:
When I change the MAC address within the Debian system, I do not have a working network connection to or from the VM anymore. No LAN, no Internet, no IPv4, no IPv6. But "ifconfig", "ip addr show" and "ip route show" do not show any hints what's wrong.
I already googled for many hours and tried many things, it does not work. What's working is the changing of the MAC address.
I know that you now have the question why I want to change the MAC address from within Debian. Of course I'm aware of the fact that I can change the MAC address in the VM settings. The background is that I want to test the network settings of my dedicated root server which hosts my websites (which has nothing to do with the VM or my local PC). My provider forces me to set a specific MAC address for every IP (I have several IPs and I want to use several). And to prevent that I cannot reach my remote server anymore I test the settings in the VM first.
Now back to my problem. I guess it has do to something with VirtualBox and not Debian itself. I changed the MAC address in several ways (not simultaneously, of course), via "hwaddress" or "hwaddress ether" in the "/etc/network/interfaces", via "/etc/systemd/network/00-default.link" or via "ip link set dev interface address XX:XX:XX:XX:XX:XX". The MAC address is set then, but the connection is gone every time.
I often read of a new network interface which is generated in the "/etc/udev/rules.d/70-persistent-net.rules", but that's not the problem here. In this file only one interface (eth0) is defined, even if I change the MAC address in the VM settings.
Attached a screenshot of my network settings of the VM.
What can I do? Or is this impossible within a VirtualBox VM?
When I change the MAC address within the Debian system, I do not have a working network connection to or from the VM anymore. No LAN, no Internet, no IPv4, no IPv6. But "ifconfig", "ip addr show" and "ip route show" do not show any hints what's wrong.
I already googled for many hours and tried many things, it does not work. What's working is the changing of the MAC address.
I know that you now have the question why I want to change the MAC address from within Debian. Of course I'm aware of the fact that I can change the MAC address in the VM settings. The background is that I want to test the network settings of my dedicated root server which hosts my websites (which has nothing to do with the VM or my local PC). My provider forces me to set a specific MAC address for every IP (I have several IPs and I want to use several). And to prevent that I cannot reach my remote server anymore I test the settings in the VM first.
Now back to my problem. I guess it has do to something with VirtualBox and not Debian itself. I changed the MAC address in several ways (not simultaneously, of course), via "hwaddress" or "hwaddress ether" in the "/etc/network/interfaces", via "/etc/systemd/network/00-default.link" or via "ip link set dev interface address XX:XX:XX:XX:XX:XX". The MAC address is set then, but the connection is gone every time.
I often read of a new network interface which is generated in the "/etc/udev/rules.d/70-persistent-net.rules", but that's not the problem here. In this file only one interface (eth0) is defined, even if I change the MAC address in the VM settings.
Attached a screenshot of my network settings of the VM.
What can I do? Or is this impossible within a VirtualBox VM?