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.
Something like this:

virsh # net-info nat
Name            nat
UUID            b09d09a8-ebbd-476d-9045-e66012c9e83d
Active:         yes
Persistent:     yes
Autostart:      yes
Bridge:         natbr0

virsh # net-list --all
Name                 State      Autostart
-----------------------------------------
nat                  active     yes
vdsm-natbr0          active     yes
vdsm-ovirtmgmt       active     yes

virsh #

virsh # net-edit nat
<network>
  <name>nat</name>
  <uuid>b09d09a8-ebbd-476d-9045-e66012c9e83d</uuid>
  <forward mode='nat'/>
  <bridge name='natbr0' stp='on' delay='0' />
  <mac address='52:54:00:9D:82:DE'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
    </dhcp>
  </ip>
</network>

Set net.ipv4.ip_forward = 1 in sysctl.conf

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.
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:
table: network
table: network_cluster
table: vds_interface
table: vds_interface_statistics

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.

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.

- DHC
_______________________________________________
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users

Reply via email to