Date: Thu, 14 Apr 2022 13:49:26 +0000 From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 255264] Unable to add default route for fib Message-ID: <bug-255264-7501-uOW70vRwdR@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-255264-7501@https.bugs.freebsd.org/bugzilla/> References: <bug-255264-7501@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D255264 Mitja Horvat <pinkfluid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pinkfluid@gmail.com --- Comment #6 from Mitja Horvat <pinkfluid@gmail.com> --- I'm running 13.1-RC3 and it looks like I'm experiencing exactly the same problem, except that the "net.add_addr_allfibs=3D1" did not fix my issue. My problem seems to be somehow related to the interface carrier. What I'm experiencing is that adding a default route to FIB 1 fails until carrier is detected on the interface (configuring the route via rc.conf fai= led, while adding it manually over SSH always succeeded). What I'm trying to do is to add an alternate default route that would go through 192.168.1.1 on re0. The default gateway for FIB 0 is on a VLAN interface (the XX.XXX.192.0 network below, hidden because it's a public IP), which has no issues. I did confirm this behavior by using the following rc.local file: #!/bin/sh set -x while ! setfib 1 netstat -rn | grep -q default do setfib 1 netstat -rn4 ifconfig re0 | grep -E 're0|inet|media:' setfib 1 route add default 192.168.1.1 -fib 1 sleep 0.5 done It basically tries to set the default route in a loop until it succeeds whi= le showing the re0 interface status and routes in FIB 1. This is an abridged output of the script above, but it shows that the `setf= ib 1 route add default 192.168.1.1` command fails until carrier is detected on t= he interface. Apr 14 15:21:14 marin kernel: Internet: Apr 14 15:21:14 marin kernel: Destination Gateway Flags= =20=20=20=20 Netif Expire Apr 14 15:21:14 marin kernel: XX.XXX.192.0/18 link#4 U=20=20= =20=20=20=20=20=20 vlan2 Apr 14 15:21:14 marin kernel: 127.0.0.1 link#2 UH=20= =20=20=20=20=20=20=20=20 lo0 Apr 14 15:21:14 marin kernel: 127.1.0.1 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:14 marin kernel: 127.1.0.2 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:14 marin kernel: 192.168.1.0/24 link#1 U=20=20= =20=20=20=20=20=20=20=20 re0 Apr 14 15:21:14 marin kernel: 192.168.10.0/24 link#5 U=20=20= =20=20=20=20=20=20=20=20 wg0 Apr 14 15:21:14 marin kernel: + ifconfig re0 Apr 14 15:21:14 marin kernel: + grep -E 're0|inet|media:' Apr 14 15:21:14 marin kernel: re0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 Apr 14 15:21:14 marin kernel: inet 192.168.1.2 netmask 0xffffff00 broadca= st 192.168.1.255 Apr 14 15:21:14 marin kernel: media: Ethernet autoselect (none) Apr 14 15:21:14 marin kernel: + setfib 1 route add default 192.168.1.1 -fib= 1 Apr 14 15:21:14 marin kernel: route: writing to routing socket: Network is unreachable Apr 14 15:21:14 marin kernel: add net default: gateway 192.168.1.1 fib 1: Network is unreachable Apr 14 15:21:14 marin kernel: + sleep 0.5 Apr 14 15:21:14 marin kernel: + setfib 1 netstat -rn Apr 14 15:21:14 marin kernel: + grep -q default Apr 14 15:21:14 marin kernel: + setfib 1 netstat -rn4 Apr 14 15:21:14 marin kernel: Routing tables (fib: 1) Apr 14 15:21:14 marin kernel:=20 Apr 14 15:21:14 marin kernel: Internet: Apr 14 15:21:14 marin kernel: Destination Gateway Flags= =20=20=20=20 Netif Expire Apr 14 15:21:14 marin kernel: XX.XXX.192.0/18 link#4 U=20=20= =20=20=20=20=20=20 vlan2 Apr 14 15:21:14 marin kernel: 127.0.0.1 link#2 UH=20= =20=20=20=20=20=20=20=20 lo0 Apr 14 15:21:14 marin kernel: 127.1.0.1 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:14 marin kernel: 127.1.0.2 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:14 marin kernel: 192.168.1.0/24 link#1 U=20=20= =20=20=20=20=20=20=20=20 re0 Apr 14 15:21:14 marin kernel: 192.168.10.0/24 link#5 U=20=20= =20=20=20=20=20=20=20=20 wg0 Apr 14 15:21:14 marin kernel: + ifconfig re0 Apr 14 15:21:14 marin kernel: + grep -E 're0|inet|media:' Apr 14 15:21:14 marin kernel: re0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 Apr 14 15:21:14 marin kernel: inet 192.168.1.2 netmask 0xffffff00 broadca= st 192.168.1.255 Apr 14 15:21:14 marin kernel: media: Ethernet autoselect (none) Apr 14 15:21:14 marin kernel: + setfib 1 route add default 192.168.1.1 -fib= 1 Apr 14 15:21:14 marin kernel: route: writing to routing socket: Network is unreachable Apr 14 15:21:14 marin kernel: add net default: gateway 192.168.1.1 fib 1: Network is unreachable Apr 14 15:21:14 marin kernel: + sleep 0.5 Apr 14 15:21:15 marin kernel: + setfib 1 netstat -rn Apr 14 15:21:15 marin kernel: + grep -q default Apr 14 15:21:15 marin kernel: + setfib 1 netstat -rn4 Apr 14 15:21:15 marin kernel: Routing tables (fib: 1) Apr 14 15:21:15 marin kernel:=20 Apr 14 15:21:15 marin kernel: Internet: Apr 14 15:21:15 marin kernel: Destination Gateway Flags= =20=20=20=20 Netif Expire Apr 14 15:21:15 marin kernel: XX.XXX.192.0/18 link#4 U=20=20= =20=20=20=20=20=20 vlan2 Apr 14 15:21:15 marin kernel: 127.0.0.1 link#2 UH=20= =20=20=20=20=20=20=20=20 lo0 Apr 14 15:21:15 marin kernel: 127.1.0.1 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:15 marin kernel: 127.1.0.2 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:15 marin kernel: 192.168.1.0/24 link#1 U=20=20= =20=20=20=20=20=20=20=20 re0 Apr 14 15:21:15 marin kernel: 192.168.10.0/24 link#5 U=20=20= =20=20=20=20=20=20=20=20 wg0 Apr 14 15:21:15 marin kernel: + ifconfig re0 Apr 14 15:21:15 marin kernel: + grep -E 're0|inet|media:' Apr 14 15:21:15 marin kernel: re0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 Apr 14 15:21:15 marin kernel: inet 192.168.1.2 netmask 0xffffff00 broadca= st 192.168.1.255 Apr 14 15:21:15 marin kernel: media: Ethernet autoselect (none) Apr 14 15:21:15 marin kernel: + setfib 1 route add default 192.168.1.1 -fib= 1 Apr 14 15:21:15 marin kernel: route: writing to routing socket: Network is unreachable Apr 14 15:21:15 marin kernel: add net default: gateway 192.168.1.1 fib 1: Network is unreachable Apr 14 15:21:15 marin kernel: + sleep 0.5 Apr 14 15:21:15 marin kernel: + setfib 1 netstat -rn Apr 14 15:21:15 marin kernel: + grep -q default Apr 14 15:21:15 marin kernel: + setfib 1 netstat -rn4 Apr 14 15:21:15 marin kernel: Routing tables (fib: 1) Apr 14 15:21:15 marin kernel:=20 Apr 14 15:21:15 marin kernel: Internet: Apr 14 15:21:15 marin kernel: Destination Gateway Flags= =20=20=20=20 Netif Expire Apr 14 15:21:15 marin kernel: XX.XXX.192.0/18 link#4 U=20=20= =20=20=20=20=20=20 vlan2 Apr 14 15:21:15 marin kernel: 127.0.0.1 link#2 UH=20= =20=20=20=20=20=20=20=20 lo0 Apr 14 15:21:15 marin kernel: 127.1.0.1 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:15 marin kernel: 127.1.0.2 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:15 marin kernel: 192.168.1.0/24 link#1 U=20=20= =20=20=20=20=20=20=20=20 re0 Apr 14 15:21:15 marin kernel: 192.168.10.0/24 link#5 U=20=20= =20=20=20=20=20=20=20=20 wg0 Apr 14 15:21:15 marin kernel: + ifconfig re0 Apr 14 15:21:15 marin kernel: + grep -E 're0|inet|media:' Apr 14 15:21:15 marin kernel: re0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 Apr 14 15:21:15 marin kernel: inet 192.168.1.2 netmask 0xffffff00 broadca= st 192.168.1.255 Apr 14 15:21:15 marin kernel: media: Ethernet autoselect (none) Apr 14 15:21:15 marin kernel: + setfib 1 route add default 192.168.1.1 -fib= 1 Apr 14 15:21:15 marin kernel: route: writing to routing socket: Network is unreachable Apr 14 15:21:15 marin kernel: add net default: gateway 192.168.1.1 fib 1: Network is unreachable Apr 14 15:21:15 marin kernel: + sleep 0.5 Apr 14 15:21:16 marin kernel: + setfib 1 netstat -rn Apr 14 15:21:16 marin kernel: + grep -q default Apr 14 15:21:16 marin kernel: + setfib 1 netstat -rn4 Apr 14 15:21:16 marin kernel: Routing tables (fib: 1) Apr 14 15:21:16 marin kernel:=20 Apr 14 15:21:16 marin kernel: Internet: Apr 14 15:21:16 marin kernel: Destination Gateway Flags= =20=20=20=20 Netif Expire Apr 14 15:21:16 marin kernel: XX.XXX.192.0/18 link#4 U=20=20= =20=20=20=20=20=20 vlan2 Apr 14 15:21:16 marin kernel: 127.0.0.1 link#2 UH=20= =20=20=20=20=20=20=20=20 lo0 Apr 14 15:21:16 marin kernel: 127.1.0.1 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:16 marin kernel: 127.1.0.2 link#3 UH=20= =20=20=20=20=20=20=20=20 lo1 Apr 14 15:21:16 marin kernel: 192.168.1.0/24 link#1 U=20=20= =20=20=20=20=20=20=20=20 re0 Apr 14 15:21:16 marin kernel: 192.168.10.0/24 link#5 U=20=20= =20=20=20=20=20=20=20=20 wg0 Apr 14 15:21:16 marin kernel: + ifconfig re0 Apr 14 15:21:16 marin kernel: + grep -E 're0|inet|media:' Apr 14 15:21:16 marin kernel: re0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 Apr 14 15:21:16 marin kernel: inet 192.168.1.2 netmask 0xffffff00 broadca= st 192.168.1.255 Apr 14 15:21:16 marin kernel: media: Ethernet autoselect (1000baseT <full-duplex>) Apr 14 15:21:16 marin kernel: + setfib 1 route add default 192.168.1.1 -fib= 1 Apr 14 15:21:16 marin kernel: add net default: gateway 192.168.1.1 fib 1 Apr 14 15:21:16 marin kernel: + sleep 0.5 Apr 14 15:21:16 marin kernel: + setfib 1 netstat -rn Apr 14 15:21:16 marin kernel: + grep -q default Apr 14 15:21:16 marin kernel: + echo . Apr 14 15:21:16 marin kernel: . Apr 14 15:21:16 marin kernel: + _return=3D0 Apr 14 15:21:16 marin kernel: + [ 0 -ne 0 ] Apr 14 15:21:16 marin kernel: + return 0 Apr 14 15:21:16 marin kernel: + _run_rc_postcmd Apr 14 15:21:16 marin kernel: + [ -n '' ] Apr 14 15:21:16 marin kernel: + return 0 Apr 14 15:21:16 marin syslogd: last message repeated 1 times I have set the following sysctls: - net.add_addr_allfibs=3D1 - net.fibs=3D2 What I have tried so far without any luck: - disabling pf - moving net.fibs=3D2 from /etc/sysctl.conf to /boot/loader.conf - using netwait (it's started after routing) The script above certainly works but I would like to understand what's the = core issue behind this and at this point I'm out of ideas. Any hint or help woul= d be really appreciated. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-255264-7501-uOW70vRwdR>