Date: Wed, 01 Oct 2025 15:33:23 +0100 From: Roy Marples <roy@marples.name> To: "Tom Pusateri" <pusateri@keehole.org> Cc: "net@freebsd.org" <net@FreeBSD.org> Subject: Re: IPv6 accept_rtadv for default route and prefix but force host portion of /64 address? Message-ID: <199a0313575.85dcc22144870.990103410983521718@marples.name> In-Reply-To: <BD1858FA-744F-465D-AD6D-C2659FC11D3F@keehole.org> References: <BD1858FA-744F-465D-AD6D-C2659FC11D3F@keehole.org>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_410162_1803434830.1759329203573 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi You can use dhcpcd from ports for this, rather than the FreeBSD Kernel. https://man.freebsd.org/cgi/man.cgi?query=3Ddhcpcd.conf=20 Example configuration in dhcpcd.conf interface igb0 =C2=A0 =C2=A0 slaac token ::123 Now, dhcpcd will generate SLAAC addresses using the token instead of the ha= rdware address. Fair warning, dhcpcd will take over some stuff on your router so you may wa= nt to limit it to some interfaces only and maybe some protocols only. See t= he fine man page for details. Good luck! Roy =20 =20 =20 ---- On Mon, 29 Sep 2025 22:32:59 +0100 Tom Pusateri<pusateri@keehole.org= > wrote ---- Is there a way to change the configuration in /etc/rc.conf to get the pref= ix from the router advertisement but fix the host portion to something like= ::123 so that I can change network cards in the server and never have to w= orry about the IPv6 address changing?=20 =20 I have a DMZ interface on a FreeBSD router with a prefix delegation from my= provider I assign to a downstream interface. I have another FreeBSD server= on the DMZ network and would like it to have a fixed address allocated out= of the assigned prefix from the router.=20 =20 The router (also FreeBSD) is running rtadvd providing SLAAC and router adve= rtisements.=20 =20 The /etc/rc.conf for the DMZ server currently looks like this:=20 =20 ifconfig_igb0_ipv6=3D"inet6 2605:1:2:3::123/64 accept_rtadv=E2=80=9D=20 =20 This works fine and manually assigns the address out of the assigned prefix= range as configured on the router.=20 =20 It also assigns a second IPv6 address via SLAAC that I don=E2=80=99t use.= =20 =20 ifconfig output looks like this:=20 =20 igb0: flags=3D1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metr= ic 0 mtu 1500=20 =C2=A0=C2=A0=C2=A0=C2=A0options=3D4e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAG= GING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO= ,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG>=20 =C2=A0=C2=A0=C2=A0=C2=A0ether ac:1f:6b:1a:04:c0=20 =C2=A0=C2=A0=C2=A0=C2=A0inet 1.2.3.123 netmask 0xfffffff8 broadcast 1.2.3.1= 27=20 =C2=A0=C2=A0=C2=A0=C2=A0inet6 fe80::ae1f:6bff:fe1a:4c0%igb0 prefixlen 64 sc= opeid 0x1=20 =C2=A0=C2=A0=C2=A0=C2=A0inet6 2605:1:2:3::123 prefixlen 64=20 =C2=A0=C2=A0=C2=A0=C2=A0inet6 2605:1:2:3:ae1f:6bff:fe1a:4c0 prefixlen 64 au= toconf pltime 604800 vltime 2592000=20 =C2=A0=C2=A0=C2=A0=C2=A0media: Ethernet autoselect (1000baseT <full-duplex>= )=20 =C2=A0=C2=A0=C2=A0=C2=A0status: active=20 =C2=A0=C2=A0=C2=A0=C2=A0nd6 options=3D23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKL= OCAL>=20 =20 I get the correct upstream next hop for a default route:=20 =20 % netstat -nra6=20 Routing tables=20 =20 Internet6:=20 Destination Gateway Flags = Netif Expire=20 ::/96 link#3 URS = lo0=20 default fe80::207:43ff:fe31:7078%igb0 UG = igb0=20 =20 =20 The problem with this is that the IPv6 prefix is configured on the router a= nd configured on the server.=20 =20 Thanks,=20 Tom ------=_Part_410162_1803434830.1759329203573 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>= <meta content=3D"text/html;charset=3DUTF-8" http-equiv=3D"Content-Type"></h= ead><body ><div style=3D'font-size:10pt;font-family:Verdana,Arial,Helvetica= ,sans-serif;color:#000000;'><div ><div>Hi</div><div><br></div><div>You can = use dhcpcd from ports for this, rather than the FreeBSD Kernel.</div><div><= br></div><div><a href=3D"https://man.freebsd.org/cgi/man.cgi?query=3Ddhcpcd= .conf">https://man.freebsd.org/cgi/man.cgi?query=3Ddhcpcd.conf</a><br></div= ><div><br></div><div>Example configuration in dhcpcd.conf</div><div><br></d= iv><div>interface igb0</div><div> slaac token ::123</div><div>= <br></div><div>Now, dhcpcd will generate SLAAC addresses using the token in= stead of the hardware address.</div><div><br></div><div>Fair warning, dhcpc= d will take over some stuff on your router so you may want to limit it to s= ome interfaces only and maybe some protocols only. See the fine man page fo= r details.</div><div><br></div><div>Good luck!</div><div><br></div><div><di= v>Roy</div></div> <br> </div><div class=3D"zmail_extra_hr" style=3D"border-= top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 20= 4); height: 0px; margin-top: 10px; margin-bottom: 10px; line-height: 0px;">= </div> <br> <div class=3D"replyHeader">---- On Mon, 29 Sep 2025 22:32:59 +0= 100 Tom Pusateri<pusateri@keehole.org> wrote ----</div><div><br></di= v><blockquote style=3D"border-left: 0px; padding-left: 0px; margin-left: 0p= x;"> <div>Is there a way to change the configuration in /etc/rc.conf to get= the prefix from the router advertisement but fix the host portion to somet= hing like ::123 so that I can change network cards in the server and never = have to worry about the IPv6 address changing? <br> <br>I have a DMZ interf= ace on a FreeBSD router with a prefix delegation from my provider I assign = to a downstream interface. I have another FreeBSD server on the DMZ network= and would like it to have a fixed address allocated out of the assigned pr= efix from the router. <br> <br>The router (also FreeBSD) is running rtadvd = providing SLAAC and router advertisements. <br> <br>The /etc/rc.conf for th= e DMZ server currently looks like this: <br> <br>ifconfig_igb0_ipv6=3D"inet= 6 2605:1:2:3::123/64 accept_rtadv=E2=80=9D <br> <br>This works fine and man= ually assigns the address out of the assigned prefix range as configured on= the router. <br> <br>It also assigns a second IPv6 address via SLAAC that = I don=E2=80=99t use. <br> <br>ifconfig output looks like this: <br> <br>igb= 0: flags=3D1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> m= etric 0 mtu 1500 <br> options=3D4e527bb<RXCSUM,TX= CSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_MAGIC,= VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG> <br>&nb= sp; ether ac:1f:6b:1a:04:c0 <br> in= et 1.2.3.123 netmask 0xfffffff8 broadcast 1.2.3.127 <br> &= nbsp;inet6 fe80::ae1f:6bff:fe1a:4c0%igb0 prefixlen 64 scopeid 0x1 <br> = ; inet6 2605:1:2:3::123 prefixlen 64 <br>  = ; inet6 2605:1:2:3:ae1f:6bff:fe1a:4c0 prefixlen 64 autoconf pltime 604= 800 vltime 2592000 <br> media: Ethernet autoselect (= 1000baseT <full-duplex>) <br> status: active <= br> nd6 options=3D23<PERFORMNUD,ACCEPT_RTADV,AUTO= _LINKLOCAL> <br> <br>I get the correct upstream next hop for a default r= oute: <br> <br>% netstat -nra6 <br>Routing tables <br> <br>Internet6: <br>D= estination Gateway Flags = Netif Expire <br>::/96 link#3 = URS lo0 <br>default fe80::207= :43ff:fe31:7078%igb0 UG igb0 <br> <br> <br>The problem with thi= s is that the IPv6 prefix is configured on the router and configured on the= server. <br> <br>Thanks, <br>Tom <br> <br> <br> <br></div> </blockquote></= div><br></body></html> ------=_Part_410162_1803434830.1759329203573--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199a0313575.85dcc22144870.990103410983521718>
