From 6c7623d07bbd44d81beb4aa60b0a1de12b622630 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Fri, 2 Feb 2024 00:09:37 +0100 Subject: netlink: Add support to fetch default gateway from multipath routes If the default route for a given IP version is a multipath one, instead of refusing to start because there's no RTA_GATEWAY attribute in the set returned by the kernel, we can just pick one of the paths. To make this somewhat less arbitrary, pick the path with the highest weight, if weights differ. Reported-by: Ed Santiago Link: https://github.com/containers/podman/issues/20927 Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- passt.1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'passt.1') diff --git a/passt.1 b/passt.1 index efd6bb7..cc678ed 100644 --- a/passt.1 +++ b/passt.1 @@ -171,8 +171,10 @@ Assign IPv4 \fIaddr\fR as default gateway via DHCP (option 3), or IPv6 \fIaddr\fR as source for NDP Router Advertisement and DHCPv6 messages. This option can be specified zero (for defaults) to two times (once for IPv4, once for IPv6). -By default, IPv4 and IPv6 addresses are taken from the host interface with the -first default route for the corresponding IP version. +By default, IPv4 and IPv6 gateways are taken from the host interface with the +first default route for the corresponding IP version. If the default route is a +multipath one, the gateway is the first nexthop router returned by the kernel +which has the highest weight in the set of paths. Note: these addresses are also used as source address for packets directed to the guest or to the target namespace having a loopback or local source address, -- cgit v1.2.3