GNOME Bugzilla – Bug 751264
Fails to delete automatic routes with metric=0 after connecting to VPN
Last modified: 2015-07-01 14:16:26 UTC
After I connect to Wi-Fi network, my route table looks like this: default via 192.168.1.1 dev wlp3s0 proto static metric 600 192.168.1.0/24 dev wlp3s0 proto kernel scope link src 192.168.1.32 metric 600 After that I try to connect to OpenVPN (tap), and I see that route table now contains duplicate routes: default via 192.168.1.1 dev tap0 proto static metric 50 default via 192.168.1.1 dev wlp3s0 proto static metric 600 xxx.xxx.xxx.xxx via 192.168.1.1 dev wlp3s0 proto static metric 600 192.168.1.0/24 dev wlp3s0 proto kernel scope link src 192.168.1.32 192.168.1.0/24 dev tap0 proto kernel scope link src 192.168.1.16 192.168.1.0/24 dev tap0 proto kernel scope link src 192.168.1.16 metric 50 192.168.1.0/24 dev wlp3s0 proto kernel scope link src 192.168.1.32 metric 600 Routes with metric 0 are auto-created by kernel when interface comes up, and normally NetworkManager should remove them in nm_platform_ip4_address_sync(), but it doesn't, so networking works wrongly. Route table should look like this: default via 192.168.1.1 dev tap0 proto static metric 50 default via 192.168.1.1 dev wlp3s0 proto static metric 600 xxx.xxx.xxx.xxx via 192.168.1.1 dev wlp3s0 proto static metric 600 192.168.1.0/24 dev tap0 proto kernel scope link src 192.168.1.16 metric 50 192.168.1.0/24 dev wlp3s0 proto kernel scope link src 192.168.1.32 metric 600 Part of log after connecting to Wi-Fi: NetworkManager[634]: <debug> [1434815160.882630] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: 192.168.1.0/24 via 0.0.0.0 dev wlp3s0 metric 600 mss 0 src kernel (src: 192.168.1.32) NetworkManager[634]: <debug> [1434815160.882773] [platform/nm-platform.c:2040] nm_platform_ip4_route_delete(): route: deleting IPv4 route 192.168.1.0/24, metric=0, ifindex 3 dev wlp3s0 NetworkManager[634]: <debug> [1434815160.882962] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: 0.0.0.0/0 via 192.168.1.1 dev wlp3s0 metric 600 mss 0 src user Part of log after connecting to VPN: NetworkManager[634]: <debug> [1434815201.850263] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: 192.168.1.0/24 via 0.0.0.0 dev tap0 metric 50 mss 0 src kernel (src: 192.168.1.16) NetworkManager[634]: <debug> [1434815201.850933] [platform/nm-platform.c:2040] nm_platform_ip4_route_delete(): route: deleting IPv4 route 192.168.1.0/24, metric=0, ifindex 38 dev tap0 NetworkManager[634]: <debug> [1434815201.852353] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: xxx.xxx.xxx.xxx/32 via 192.168.1.1 dev wlp3s0 metric 600 mss 0 src vpn NetworkManager[634]: <debug> [1434815201.871332] [platform/nm-platform.c:1998] nm_platform_ip4_route_add(): route: adding or updating IPv4 route: 0.0.0.0/0 via 192.168.1.1 dev tap0 metric 50 mss 0 src vpn I'm on Gentoo, NM version is 1.0.2, Linux 4.0.4, OpenVPN 2.3.6, libnl 3.2.26.
Pushed branch for review: th/device-route-bgo751264
Looks all fine to me. > 604cf36 platform/trivial: rename enum value NM_IP_CONFIG_SOURCE_RTPROT_KERNEL remove 'platform internal flag used to mark routes with protocol RTPROT_KERNEL' comment > 551597f route-manager: manage IPv4 device-routes with NMRouteManager please add a reference to the kernel ipv4 nodeviceroute bug to the timeout paragraph
merged upstream. master: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=1749ad4068b27ab3955b35128c833096e7c195e4 nm-1-0: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=b774bde8ed1f790441318748a307fc834fbb11f4