Date: Tue, 21 Jun 2022 10:26:22 -0700 From: Lee Brown <leeb@ratnaling.org> To: freebsd-net <freebsd-net@freebsd.org> Subject: Re: fib 1 DHCP and RA default route Message-ID: <CAFPNf59eH3ywi2hf5epKS7VUD6QgJS3zh8yRTL1eWhxcGgEe7Q@mail.gmail.com> In-Reply-To: <6B824787-2D1D-4811-8EB3-0C59E253DBE3@lassitu.de> References: <6B824787-2D1D-4811-8EB3-0C59E253DBE3@lassitu.de>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000bc301705e1f885a8 Content-Type: text/plain; charset="UTF-8" On Tue, Jun 21, 2022 at 10:11 AM Stefan Bethke <stb@lassitu.de> wrote: > I'm setting up a new router that has both an ADSL/PPPoE and a cable modem > upstream. I've configured mpd5 for the PPPoE connection, and I'd like to > have the cable modem provide a second, independent connection through FIB 1 > over igb2. > > rc.conf (partially): > ifconfig_igb2_descr="Cable Modem" > ifconfig_igb2="DHCP fib 1" > ifconfig_igb2_ipv6="inet6 accept_rtadv defaultif" > > gateway_enable="YES" > ipv6_gateway_enable="YES" > pf_enable="YES" > > dhclient_flags="-b" > dhcp6c_enable="YES" > dhcp6c_interfaces="igb2" > dhcp6c_fib=1 > > I think this should be sufficient to receive both an IPv4 and IPv6 address > and a default route, however, neither one is added. When I manually add > them, they are removed after a while. > > $ ifconfig igb2 > igb2: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 > description: Cable Modem > > options=4e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP> > ether 00:0d:b9:xx:xx:62 > inet6 fe80::20d:b9ff:fe58:5262%igb2 prefixlen 64 scopeid 0x3 > inet6 2a02:8108:0:90:xxxx:8eb4:28c2:6315 prefixlen 128 > inet 31.16.xxx.4 netmask 0xffffff00 broadcast 31.16.xxx.255 > fib: 1 > media: Ethernet autoselect (1000baseT <full-duplex>) > status: active > nd6 options=8023<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL,DEFAULTIF> > > $ setfib 1 netstat -rnfinet > Routing tables (fib: 1) > > Internet: > Destination Gateway Flags Netif Expire > 31.16.xxx.0/24 link#3 U igb2 > 31.16.xxx.4 link#3 UHS lo0 > 127.0.0.1 link#4 UHS lo0 > > $ setfib 1 netstat -rnfinet6 > Routing tables (fib: 1) > > Internet6: > Destination Gateway Flags > Netif Expire > ::/96 ::1 UGRS > lo0 > ::1 link#4 UHS > lo0 > ::ffff:0.0.0.0/96 ::1 UGRS > lo0 > 2a02:8108:0:90:xxxx:8eb4:28c2:6315 link#3 UHS > lo0 > 2a02:8108:xxxx:9d00::/64 link#17 U > br103 > 2a02:8108:xxxx:9d00:0:ff:fe00:367 link#17 UHS > lo0 > fe80::/10 ::1 UGRS > lo0 > fe80::%igb2/64 link#3 U > igb2 > fe80::20d:b9ff:fe58:5262%igb2 link#3 UHS > lo0 > ff02::/16 ::1 UGRS > lo0 > > > For IPv6, I thought that setting defaultif would make the kernel add the > default route when an appropriate RA is received, and on my old router, > that was working; I can't seem to see what difference I have in the config, > apart from using FIB 1 instead of the default. > > And for IPv4, I see that I get the default router through DHCP, but > somehow /sbin/dhclient-script is not adding a default route. If I add it > manually, it will be removed eventually. > > Any suggestions? > > > Stefan > > -- > Stefan Bethke <stb@lassitu.de> Fon +49 151 14070811 > > I had a similar issue, no IPv6, but wanted DHCP to populate FIB 1 as FIB 0 was being adjusted by quagga. I just hacked the /etc/dhclient-enter-hooks and /etc/dhclient-exit-hooks to do the work as I couldn't find the correct place to place "fib 1" and have it work. The enter hook is looking for the interface and REBOOT or BOUND and ${old_routers} != ${new_routers} to delete the route with -fib 1. The exit hook is the same but adds the route with -fib 1 --000000000000bc301705e1f885a8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br><div><br></div></div><br><div class= =3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jun 21, 2022= at 10:11 AM Stefan Bethke <<a href=3D"mailto:stb@lassitu.de">stb@lassit= u.de</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"mar= gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1= ex">I'm setting up a new router that has both an ADSL/PPPoE and a cable= modem upstream. I've configured mpd5 for the PPPoE connection, and I&#= 39;d like to have the cable modem provide a second, independent connection = through FIB 1 over igb2.<br> <br> rc.conf (partially):<br> ifconfig_igb2_descr=3D"Cable Modem"<br> ifconfig_igb2=3D"DHCP fib 1"<br> ifconfig_igb2_ipv6=3D"inet6 accept_rtadv defaultif"<br> <br> gateway_enable=3D"YES"<br> ipv6_gateway_enable=3D"YES"<br> pf_enable=3D"YES"<br> <br> dhclient_flags=3D"-b"<br> dhcp6c_enable=3D"YES"<br> dhcp6c_interfaces=3D"igb2"<br> dhcp6c_fib=3D1<br> <br> I think this should be sufficient to receive both an IPv4 and IPv6 address = and a default route, however, neither one is added. When I manually add the= m, they are removed after a while.<br> <br> $ ifconfig igb2<br> igb2: flags=3D8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 m= tu 1500<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 description: Cable Modem<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 options=3D4e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLA= N_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_MAGIC,VLAN_HWFILTER,VLA= N_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP><br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 ether 00:0d:b9:xx:xx:62<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 inet6 fe80::20d:b9ff:fe58:5262%igb2 prefixlen 6= 4 scopeid 0x3<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 inet6 2a02:8108:0:90:xxxx:8eb4:28c2:6315 prefix= len 128<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 inet 31.16.xxx.4 netmask 0xffffff00 broadcast 3= 1.16.xxx.255<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 fib: 1<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 media: Ethernet autoselect (1000baseT <full-= duplex>)<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 status: active<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 nd6 options=3D8023<PERFORMNUD,ACCEPT_RTADV,A= UTO_LINKLOCAL,DEFAULTIF><br> <br> $ setfib 1 netstat -rnfinet<br> Routing tables (fib: 1)<br> <br> Internet:<br> Destination=C2=A0 =C2=A0 =C2=A0 =C2=A0 Gateway=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 Flags=C2=A0 =C2=A0 =C2=A0Netif Expire<br> 31.16.xxx.0/24=C2=A0 =C2=A0 =C2=A0link#3=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0U=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 igb2<br> 31.16.xxx.4=C2=A0 =C2=A0 =C2=A0 =C2=A0 link#3=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0UHS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lo0<br> 127.0.0.1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 link#4=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0UHS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lo0<br> <br> $ setfib 1 netstat -rnfinet6<br> Routing tables (fib: 1)<br> <br> Internet6:<br> Destination=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=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A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0::1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0UGRS=C2=A0 =C2=A0 =C2=A0 = =C2=A0 lo0<br> <br> <br> For IPv6, I thought that setting defaultif would make the kernel add the de= fault route when an appropriate RA is received, and on my old router, that = was working; I can't seem to see what difference I have in the config, = apart from using FIB 1 instead of the default.<br> <br> And for IPv4, I see that I get the default router through DHCP, but somehow= /sbin/dhclient-script is not adding a default route. If I add it manually,= it will be removed eventually.<br> <br> Any suggestions?<br> <br> <br> Stefan<br> <br> --<br> Stefan Bethke <<a href=3D"mailto:stb@lassitu.de" target=3D"_blank">stb@l= assitu.de</a>>=C2=A0 =C2=A0Fon +49 151 14070811<br> <br></blockquote><div><div>I had a similar issue, no IPv6, but wanted DHCP = to populate FIB 1 as FIB 0 was being adjusted by quagga.<br></div><div><br>= </div><div>I just hacked the /etc/dhclient-enter-hooks and /etc/dhclient-exit-hooks=20 to do the work as I couldn't find the correct place to place "fib = 1" and have it work.</div><div>The enter hook is looking for the inter= face and REBOOT or BOUND and ${old_routers} !=3D ${new_routers} to delete t= he route with -fib 1.=C2=A0 The exit hook is the same but adds the route wi= th -fib 1<br></div>=C2=A0</div></div></div> --000000000000bc301705e1f885a8--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFPNf59eH3ywi2hf5epKS7VUD6QgJS3zh8yRTL1eWhxcGgEe7Q>