Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Sep 2025 17:32:59 -0400
From:      Tom Pusateri <pusateri@keehole.org>
To:        "net@freebsd.org" <net@FreeBSD.org>
Subject:   IPv6 accept_rtadv for default route and prefix but force host portion of /64 address?
Message-ID:  <BD1858FA-744F-465D-AD6D-C2659FC11D3F@keehole.org>

next in thread | raw e-mail | index | archive | help
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 =
something like ::123 so that I can change network cards in the server =
and never have to worry about the IPv6 address changing?

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.

The router (also FreeBSD) is running rtadvd providing SLAAC and router =
advertisements.

The /etc/rc.conf for the DMZ server currently looks like this:

ifconfig_igb0_ipv6=3D"inet6 2605:1:2:3::123/64 accept_rtadv=E2=80=9D

This works fine and manually assigns the address out of the assigned =
prefix range as configured on the router.

It also assigns a second IPv6 address via SLAAC that I don=E2=80=99t =
use.

ifconfig output looks like this:

igb0: flags=3D1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> =
metric 0 mtu 1500
	=
options=3D4e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWC=
SUM,TSO4,TSO6,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IP=
V6,HWSTATS,MEXTPG>
	ether ac:1f:6b:1a:04:c0
	inet 1.2.3.123 netmask 0xfffffff8 broadcast 1.2.3.127
	inet6 fe80::ae1f:6bff:fe1a:4c0%igb0 prefixlen 64 scopeid 0x1
	inet6 2605:1:2:3::123 prefixlen 64
	inet6 2605:1:2:3:ae1f:6bff:fe1a:4c0 prefixlen 64 autoconf pltime =
604800 vltime 2592000
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
	nd6 options=3D23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

I get the correct upstream next hop for a default route:

% netstat -nra6
Routing tables

Internet6:
Destination                       Gateway                       Flags    =
     Netif Expire
::/96                             link#3                        URS      =
       lo0
default                           fe80::207:43ff:fe31:7078%igb0 UG       =
      igb0


The problem with this is that the IPv6 prefix is configured on the =
router and configured on the server.

Thanks,
Tom





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BD1858FA-744F-465D-AD6D-C2659FC11D3F>