[libvirt-users] assign static public IP to container

scar scar at drigon.com
Sun Dec 8 21:35:25 UTC 2013


hello i have a server colocated in a datacenter with several external IP
addresses available to use.  the physical server is using one of these
IPs, and i want to assign another, unused IP to the virtual machine.
both the host and guest are running ubuntu server 12.04.  i found
someone else asking the same thing[1] for CentOS, but i already have a
bridge setup so not sure if it pertains... either way the instructions
provided are for a different OS.  i followed these instructions[2] for
setting up my bridge.

anyway, i thought i could just do this by editing the container's
/etc/network/interfaces, setting a static IP address for eth0 much like
i did for br0 on the host machine.... but doesn't seem to be working.
ifconfig shows eth0 has the public address but i can't resolve any
hostnames nor telnet to a direct IP address (no route to host).   if i
change back to dhcp and let eth0 get a private address, i can at least
access the internet but cannot access the virtual machine from the
internet.  what is the trick to giving a VM a routable, public IP
address?  thanks

1. https://www.redhat.com/archives/libvirt-users/2011-December/msg00056.html
2.
https://help.ubuntu.com/12.04/serverguide/network-configuration.html#bridging




More information about the libvirt-users mailing list