[CentOS-virt] Centos + VM + public ip


ml-lists at agoris.net.ua
Sun Sep 13 12:47:00 UTC 2020

> Hi,
> I've got a dedicated server with OVH and I'd like to host a public VM. I'd like
> Centos OS 7 or 8, I installed KVM already, I got the VM and bought the IP and
> created a virtual mac id. I know I have to bridge it somehow but I can't seem
> to find a proper tutorial. Do you know where to start?

You can do next:
1) Create bridge interface (for example br0) on dedicated server. Associate this interface with your Ethernet interface and assign IP address to br0.
2a) When you would create VM add parameter --network=bridge:br0 to the virt-install in command line. Or smth similar if you create VM in another way.
2b) Or edit xml file for your VM and add or change config:
    <interface type='bridge'>
      <mac address='insert_you_virtual_mac_here'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
3) Inside the VM assign real/public IP to you Ethernet (probably eth0) interface.

That's all.

If you have additional questions or you need more detail explanation you can write me directly.

More information about the CentOS-virt mailing list