[libvirt-users] Fixed Public IP to VM Guest

Laine Stump laine at laine.org
Mon Oct 13 08:45:54 UTC 2014

On 10/11/2014 03:08 PM, Joel A Divekar wrote:
> Hi All
> We have setup a Centos7 host server with KVM and have created multiple
> VM running Ubuntu 14.04 using virt-manager. All VMs are having forward
> mode as "NAT" and using internal DHCP IP address 192.168.122.x series
> and we gave them fixed ips based on their mac address. Now all these
> VMs are able to access Internet and able to run update on all these
> guest OS. But these VMs are web and API servers and they are required
> to be accessible from Internet.
> We have pool of public IPs and have assigned host with one public IP
> for example, we have pool like to We
> have assigned to Host server and would like to assign
> to Webserver and to API server. So we
> changed our virsh network settings from default to routed as <forward
> mode='route' dev='em1'> and struggling to configure fixed IPs for our VMs.

In order to use a libvirt network with forward mode='route', you must
have an *entire subnet* available to assign to the libvirt network, and
the rest of your physical network must have a route entry for that
subnet which points to your host's physical-side IP address as the
gateway. Since you say that you only have -
available, I am guessing that you don't have an entire subnet, and that
you probably aren't able to alter the routing tables of routers on the
physical network, so routed mode will not work for you.

If, instead, the case is that your host's physical-side (i.e. em1) IP
address is, you should instead investigate putting a Linux
host bridge on that interface, and configuring the guests for a bridged
network connection:


> We would like to do exactly as mentioned in this link
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/sub-sect-routed-mode-libvirt.html
> We have been struggling with this for last 3 days and no luck. Please
> can anybody guide us.
> Regards
> Joel Divekar
> <http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?>
> Get your own *FREE* website, *FREE* domain & *FREE* mobile app with
> Company email.  
> 	*Know More >*
> <http://track.rediff.com/click?url=___http://businessemail.rediff.com/email-ids-for-companies-with-less-than-50-employees?sc_cid=sign-1-10-13___&cmp=host&lnk=sign-1-10-13&nsrv1=host>
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20141013/1a977ae1/attachment.htm>

More information about the libvirt-users mailing list