Skip to content

Add support for creating multiple internal subnets - #4033

Open
presztak wants to merge 12 commits into
lxc:mainfrom
presztak:multiple_internal_subnets
Open

presztak wants to merge 12 commits into
lxc:mainfrom
presztak:multiple_internal_subnets

Conversation

@presztak

Copy link
Copy Markdown
Member

Closes: #1970

…ction

Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
DeleteLogicalRouterNAT only matches on the external address, which can't
remove the rules of one network from a router shared by several. Add a
variant matching on the logical IP and move both onto a shared filter.

Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
In preparation for OVN networks sharing the logical router of a parent,
introduce a router owner. A network without a parent owns its router and
keeps its current OVN object names.

Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
Several places assumed the logical router belonged to a single network.
Scope the SNAT rules to the subnets of the network being configured,
compute the router policies across every network on the router, and only
delete the router with its owner.

Scoping the SNAT rules also fixes an existing bug. On update the network
setup removed every snat rule from the router, including the per-NIC egress
rules created from ipv4.address.external and ipv6.address.external, so any
change to an OVN network dropped those until the instance NIC was restarted.

Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
An OVN network can now be created with a parent, attaching its own switch
and subnet to that parent's logical router instead of creating a router of
its own. Several internal subnets can then be routed by one router and share
its uplink.

A child keeps its own switch, DHCP, DNS, ACLs and instance ports, resolves
the uplink through its parent, translates to the external port of the
parent's router when NAT is enabled, and leaves the router, external switch
and chassis group to the network owning them.

Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
…ncy group

An OVN network with a parent depends on another logical network, not on a
host interface like the physical networks keying off the same parent key.

Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
Forwards and load balancers install their listen address on the logical
router, so check for a conflict across every network sharing it and let a
child use the external address of its parent's router.

Reject peers on a child and peers targeting one, as a child has no router of
its own. Source the BGP next hop and DNS zone notification from the network
providing the uplink.

Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
Signed-off-by: Piotr Resztak <piotr.resztak@gmail.com>
@github-actions github-actions Bot added Documentation Documentation needs updating API Changes to the REST API labels Sep 20, 2026
@presztak

Copy link
Copy Markdown
Member Author

The first two commits allow us to specify the parent option, which is overall node specific but shouldn't be for the OVN network type. We could come up with a different name to avoid these changes, but I guess parent makes sense.

@presztak
presztak marked this pull request as ready for review September 21, 2026 16:11
@presztak
presztak requested a review from stgraber as a code owner September 21, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes to the REST API Documentation Documentation needs updating

Development

Successfully merging this pull request may close these issues.

Allow to create multiple internal subnets

1 participant