I have tried to create a NAT network within ovirt for guests to use via libvirt/virsh as the vdsm@rhevh on an ovirt node.<br>Something like this:<br><br>virsh # net-info nat<br>Name nat<br>UUID b09d09a8-ebbd-476d-9045-e66012c9e83d<br>
Active: yes<br>Persistent: yes<br>Autostart: yes<br>Bridge: natbr0<br><br>virsh # net-list --all<br>Name State Autostart<br>-----------------------------------------<br>nat active yes <br>
vdsm-natbr0 active yes <br>vdsm-ovirtmgmt active yes <br><br>virsh # <br><br>virsh # net-edit nat<br><network><br> <name>nat</name><br> <uuid>b09d09a8-ebbd-476d-9045-e66012c9e83d</uuid><br>
<forward mode='nat'/><br> <bridge name='natbr0' stp='on' delay='0' /><br> <mac address='52:54:00:9D:82:DE'/><br> <ip address='192.168.122.1' netmask='255.255.255.0'><br>
<dhcp><br> <range start='192.168.122.2' end='192.168.122.254' /><br> </dhcp><br> </ip><br></network><br><br>Set net.ipv4.ip_forward = 1 in sysctl.conf<br><br>This is basically the default libvirt NAT network. Connecting a VM directly to it via cli (qemu-kvm) works perfectly fine on the ovirt host itself but the ovirt manager UI does not seem to pick up on it or allow for creation of such a network for guests to use.<br>
Since the ovirt manager UI did not allow I dug into the database and added entries which seem to have been necessary by hand to the following engine database tables:<br>table: network<br>table: network_cluster<br>table: vds_interface<br>
table: vds_interface_statistics<br><br>The result was the network did show up under cluster logical networks. However the network still does not show up under the host Network Interfaces UI. Was able to create VM and attach the natbr0 network to it and NAT was indeed working. (EG: DNSmasq assigned address). The guest was able to communicate out and without extensive testing things seemed to work.<br>
<br>This was very painful to do (and hacky). Thus it would be very nice if since this is OOB functionality of libvirt/KVM, if ovirt would allow for it to be used. The ability to provide NAT or internal networks to guests would quite useful.<br>
<br>- DHC<br>