News Stay informed about the latest enterprise technology news and product updates.

Fixing the network in Dom-Us for Ubuntu hosts running Xen

I ran into problem recently where the network would not come up in a Dom-U after the initial domain creation. All subsequent reboots would result in an unprivileged domain without network connectivity. Here is an example of the error that would occur if I attempted to restart the network manually:

root@odin:~# /etc/init.d/networking restart
* Reconfiguring network interfaces...
eth0: ERROR while getting interface flags: No such device
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.

So what is going on? Well, it turns out that udev was binding the domain’s NIC to the initial MAC address of the vswif (which changes on reboot by default). Hence when the domain comes online for a second (and third, and so forth) time with a new MAC address, the domain does not recognize the NIC.

The solution is quite simple: edit the udev rules that bind NICs to MAC addresses. In Ubuntu this is in two places. You need to edit “/etc/udev/rules.d/70-persistent-net.rules” and comment out any lines that look like this:

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:16:3e:2b:2e:7b", NAME="eth0"

And because the aforementioned file is automatically generated, you also need to edit “/etc/udev/rules.d/75-persistent-net-generator.rules” and comment out any lines that look like this:

SUBSYSTEMS=="xen", ENV{COMMENT}="Xen virtual device"

I also commented out the following line for good measure:

ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth*|ath*|wlan*|ra*|sta*" NAME!="?*", DRIVERS=="?*", GOTO="persistent_net_generator_do"

This will prevent *any* generation. Anyway, once you make these changes and restart the Dom-U, the network will come up every time without a hitch.

Hope this helps!

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close