Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable entry in main routing table if host_table is set for routed NIC #1559

Open
ibot3 opened this issue Jan 5, 2025 · 1 comment
Labels
API Changes to the REST API Documentation Documentation needs updating Easy Good for new contributors Feature New feature, not a bug
Milestone

Comments

@ibot3
Copy link

ibot3 commented Jan 5, 2025

For routed NICs, the host_table parameter can be specified to create a route in the specified routing table.
However, the same route is always installed in the main routing table too:

// Apply host-side static routes to main routing table.
r := ip.Route{
DevName: saveData["host_name"],
Route: fmt.Sprintf("%s/%d", addrStr, subnetSize),
Table: "main",
Family: ipFamilyArg,
}

It would be great if this behavior could be changed by another config option so that the route is only present in the specified routing table.

Our scenario:
We want to have VMs in different VRFs on the incus host.
But for routed NICs to work, ip_forwarding must be enabled on the host.
This causes that from the main VRF, all VMs with routed NICs can be reached, what we don't want, because they should only be reachable within their VRF.

@stgraber
Copy link
Member

stgraber commented Jan 5, 2025

Hmm, I don't recall how we settled on this behavior for host_table...

In hindsight, we'd have been better served by a host_tables config key taking a comma separated list of table names and not having that default behavior of always putting in the main table too.

I think the best path forward here is to implement ipv4.host_tables and ipv6.host_tables defined as a comma separated list of table IDs and whose default is 254. Making them conflict with ipv4.host_table and ipv6.host_table respectively and then mark the old keys as deprecated in documentation.

@stgraber stgraber added Documentation Documentation needs updating Feature New feature, not a bug Easy Good for new contributors API Changes to the REST API labels Jan 5, 2025
@stgraber stgraber added this to the soon milestone Jan 5, 2025
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 Easy Good for new contributors Feature New feature, not a bug
Development

No branches or pull requests

2 participants