Is it mandatory to configure an ip address in a ovn network to route traffic?
What I am trying to do is to create an instance that work as router and dhcp server inside my ovn network because i need dnsmasq option and firewall specifics rules that i cannot setup directly on the network with incus as much i read the documentation. Now i have configured my instance with a static address 10.254.0.1/8 with a listening dhcp server on that address, but if my network has ipv4.address = none the other instances can’t receive their address from the dhcp server.
Thanks for your suggestion, but i already read that and I didn’t find a solution to my problem, since he is configuring a container for routing his home network and not my containers inside my cluster. For further information that’s my ovn network configuration:
Not an expert but I think OVN would intercept the DHCP packets from your instances.
Perhaps this might be what you are looking for which will be per OVN network: ipv4.dhcp.routes: OVN network - Incus documentation
I think with this you would then have an issue with your router-container also getting this route table via the OVN DHCP so maybe that instance needs to be a manual IP stack config. If it’s got netplan, you can merge and override parts of the options config that the primary interface gets from DHCP (and others), by using a file with larger number in the /etc/netplan directory. Normally there is one starting with 50- so you would override with 70-{some-file-name}.yaml and then reboot or issue netplan try to test and if good then netplan apply
Also you’ve got DNS settings as well in the above article, which we use… You can set dns.domaindns.nameservers & dns.search per each OVN network so that could cover resolution and if you need to add DDNS.
Otherwise OVN does support a number of other DHCP options but I’m not sure what are available via Incus management of OVN. Maybe you can get to override the router/gateway address via OVN itself or manually/Ansible configure the networking stack in your instances on your OVN network/s. But wait to see if someone with more knowledge advises before going this route.
Hi,
I am using systemd-networkd inside the container, it’s just easier. About setting the ovn logical router with the DHCP options, i already tried that but it doesn’t allow the same flexibility of dnsmasq. Doing further troubleshooting i noticed that the containers doesn’t see each other even at the layer 2 level, even if they are connected to the same logical switch. Thank you anyway for your suggestions
My working configuration sets the ovn network to “none” and allows dnsmasq to provide IP addresses to regular containers. The ovn network is configured with ipv4.address = 10.0.0.2/24
I create a router node which configures its ovn interface with the static router IP address provided by dnsmasq DHCP (10.0.0.1 in my case). The router node has a second interface for the uplink. In my case, I also configure an openvpn interface. A SNAT is also employed for my purposes.
The solution is not elegant, but it works reliably.
Finally found my notes. There seems to be a NAT setting in OVS which interferes with the setup. I removed it with a command similar to this, just with the X’s replaced with the pertinent value.
Thanks for your help but it doesn’t help with my case. I want my container to work not only as router but as dhcp server as well. Also my ovn network is isolated, i don’t need my containers to go to the internet
So you basically are looking at logical switch and logical switch port settings alone. Hopefully you on’t need too much micromanagement on the switch ports.