Xen: How to fix “SIOCSIFADDR: No such device”

December 11th, 2009 by Ariejan de Vroom

Yesterday I had to clone a VPS to run some CPU and memory intensive tests. With our current setup (Xen + LVM), cloning an image on the fly is easy.

After configuring a new IP address for the clone, I booted up the system. Nice, but I ran into a problem:

Configuring network interfaces...SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
eth0: ERROR while getting interface flags: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.

After some investigation I found that the MAC address for eth0 is stored on disk in /etc/udev/rules.d/z25_persistent-net.rules. That makes sense, because the whole file system was cloned. But, I swapped the virtual network card, and I’d expect is to work. It didn’t.

The solution is quite easy. Empty /etc/udev/rules.d/z25_persistent-net.rules. Then shutdown and start your VPS. You must do a full shutdown, a reboot won’t work.

For the lazy folk out there, here’s how to quickly empty the file:

echo "" > /etc/udev/rules.d/z25_persistent-net.rules

After you have started your VPS back up again, you should be able to ping out over the network. If you peek in /etc/udev/rules.d/z25_persistent-net.rules you should see a line that contains the MAC address for your virtual network device.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • Hyves
  • Reddit
  • StumbleUpon
  • Twitter

Tags: , , , ,

  • gcphost

    great article – the solution was what i needed for xen center using the debian 4 install – works like a charm.

  • Computadora

    Thanx! I’ve got this problem with a new install Xen 4.0 on Lenny and your solution works. Every new generated vm has this same problem… and solution!

  • http://xentutorial.com/xen/xen-how-to-fix-“siocsifaddr-no-such-device”- xentutorial.com

    Xen: How to fix “SIOCSIFADDR: No such device”…

    Yesterday I had to clone a VPS to run some CPU and memory intensive tests. With our current setup (Xen + LVM), cloning an image on the fly is easy. After configuring a new IP address for the clone, I booted up the system. Nice, but I ran into a problem…

  • http://www.facebook.com/ronabop Ronald Gundlach-Chmara

    Wow, same problem here, only Debian/KVM… same solution, though.

  • Ssolomy

    with sudo ifup wlan0
    i get the following.please i need some help

    auth@auth-G41-M7:~$ sudo ifup wlan0
    [sudo] password for auth:
    SIOCSIFADDR: No such device
    wlan0: ERROR while getting interface flags: No such device
    SIOCSIFNETMASK: No such device
    wlan0: ERROR while getting interface flags: No such device
    Failed to bring up wlan0.

  • Vik

    super!!

  • http://kpfindings.wordpress.com Kp Webhosting
  • YUCER

    It works very well !

    Thank you.

  • Turha

    Thanks, this save me a lot of time.