With Linux kernel 4.14, when I add IPv6 multipath routes with weights (10 & 30), they are getting added with same weight '1'. IPv4 route does not have this issue.
I checked with exact same steps in a different machine with Linux kernel 4.19, where the weights displayed in output seems to match the configuration.
Please help to find what is causing this difference. Could any changes that went into iproute or kernel versions be causing this, or is any specific kernel configuration needs to be enabled for multipath with weight support?
Both machines have CONFIG_IP_ROUTE_MULTIPATH=y
.
Configuration:
# ip link add link eth0 name eth0.100 type vlan id 100
# ip link add link eth0 name eth0.200 type vlan id 200
# ip link set eth0.100 up
# ip link set eth0.200 up
# ip -6 addr add 20::1/120 dev eth0.100
# ip -6 addr add 30::1/120 dev eth0.200
# ip -6 route add 40::/120 nexthop via 20::2 weight 10 nexthop via 30::2 weight 30
From 4.14:
# ip -6 r l
20::/120 dev eth0.100 proto kernel metric 256 pref medium
30::/120 dev eth0.200 proto kernel metric 256 pref medium
40::/120 metric 1024 pref medium
nexthop via 20::2 dev eth0.100 weight 1
nexthop via 30::2 dev eth0.200 weight 1
# ip -V
ip utility, iproute2-ss200330
# uname -r
4.14.231-pc64
From 4.19:
# ip -6 r l
::1 dev lo proto kernel metric 256 pref medium
20::/120 dev eth0.100 proto kernel metric 256 pref medium
30::/120 dev eth0.200 proto kernel metric 256 pref medium
40::/120 metric 1024
nexthop via 20::2 dev eth0.100 weight 10
nexthop via 30::2 dev eth0.200 weight 30 pref medium
# ip -V
ip utility, iproute2-ss190107
# uname -r
4.19.0-16-cloud-amd64