Ubuntu – Assign public and private IP addresses for a KVM guest

bridgecentoskvm-virtualizationUbuntu

I would like to create a KVM guest with two different IPs, like one public IP and another private IP for the same KVM guest.

My host is 210.x.x.x. Series and Guest are also configured with the 220.x.x.x. series. Can I config one more IP with another set of IP series like 172.x.x.x.?

Best Answer

You can do that. I would recommend to setup your guest with two virtual NIC.

  1. NIC with external IP and Default Route
  2. NIC with internal IP

In this scenario your virtualiastion Host should be either setup with bridged networking, openvswitch or macvtap but not with libvirt default network virbr0 Nat Switch

enter image description here

Source LibVirt Docs