Jump to content

assign a static ip to a vm


luca2

Recommended Posts

Hi,

I would like to assign my vm´s a static ip. Was wondering if anyone can point me out how to do that? Is it possible just to add it to the xmlor do I need to follow what is described here:

http://wiki.libvirt.org/page/VirtualNetworking#Virtual_Networking

How does actually Unraid 6b14b handle virtual networks?

I looked for a virtual network definition in /var/lib/libvirt/network/ but did not find any network.xml file.

Has anyone had this done before and could share how he did it?

Rgrds.

Link to comment

Hey Luca2,

 

PLEASE PLEASE PLEASE let me know if you figure this out. I've been wracking my brains over this all day.

 

I have an Ubuntu Server on KVM on an unRaid host. Networking is set via bridge mode.

 

On the Ubuntu VM, I don't see a "br0" device. All I see are loopback (lo) and eth0.  By default, on my etc/network/interfaces, the setting for eth0 is to DHCP. If I change this to static, I get a Static IP address, that I can SSH into, but everything else is broken. My DNS crawls to a halt -- I can't even ping www.google.com.. When I try to check out my Apache2 web interface, I get a Gateway Timeout error. Sometimes I can't even SSH into it.

 

I would love to know if someone figured out how to do this.

Link to comment

We haven't experimented with this yet, but we only just implemented support for the libvirt virbr0 bridge in beta 15.

 

I can experiment more with this next week.  In the meantime, if you handle this via an unraid managed bridge, you can use your router to manage static IP addresses.

Link to comment

Hey Luca2,

 

PLEASE PLEASE PLEASE let me know if you figure this out. I've been wracking my brains over this all day.

 

I have an Ubuntu Server on KVM on an unRaid host. Networking is set via bridge mode.

 

On the Ubuntu VM, I don't see a "br0" device. All I see are loopback (lo) and eth0.  By default, on my etc/network/interfaces, the setting for eth0 is to DHCP. If I change this to static, I get a Static IP address, that I can SSH into, but everything else is broken. My DNS crawls to a halt -- I can't even ping www.google.com.. When I try to check out my Apache2 web interface, I get a Gateway Timeout error. Sometimes I can't even SSH into it.

 

I would love to know if someone figured out how to do this.

Have you also set up the DNS and gateway addresses?  If you have switched off DHCP then this will almost certainly be necessary as previously they were being supplied by the DHCP server.
Link to comment

Thanks so much!

 

I am embarrassed that it was so simple. I turned off DHCP but I never entered the GATEWAY and DNS-SERVERS into the /etc/networking/interfaces. I am such an idiot. Did what you suggested and immediately I had a static IP address with no problems.

 

Thank you again!

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...