IPv6 tunnel: here is how I brought up a secondary iface, gif1, in rc.conf

On FreeBSD 14.0, my rc.conf has these lines,
Code:
ifconfig_em0_ipv6="inet6 accept_rtadv"
ipv6_activate_all_interfaces="YES"                                      #WARNING: $ipv6_enable is obsolete.  Use $ipv6_activate_all_interfaces instead.

# No need to use IP here.
ipv6_defaultrouter="-interface gif0"
ipv6_network_interfaces="em0 gif0 gif1"

# I have this secondary tunnel for different usage and failover.
ipv6_static_routes="gif1"
ipv6_route_gif1="default <IPv6 apex zone for secondary tunnel, i.e. wwww:xxxx:yyyy:zzzz>::"

# I found that I could not have aliases unless I set this first line to include an IP address ending in :2.
# Maybe that's just Hurricane Electric (HE, my [URL="http://www.tunnelbroker.com"]www.tunnelbroker.com[/URL] - a "free" service
# requiring a test, the not-free part, of one's knowledge of IPv6).
ifconfig_gif0_ipv6="inet6 <IPv6 apex zone for primary tunnel, i.e. aaaa:bbbb:cccc:2> prefixlen 128"
ifconfig_gif0_alias0="inet6 <IPv6 apex zone for primary tunnel>:eeee:ffff:gggg:hhhh prefixlen 128"
# I have other aliases: 1 and 2". I omit these for clarity.

ifconfig_gif1_ipv6="inet6 <IPv6 apex zone for secondary tunnel>::2 /64"

# Initially, gif1 showed stability; later the same day, not.
# In a screen session, I ping6 but to <my ping6's target's IPv6>
# because the tunnel's IPv6 exit, <IPv6 apex zone for secondary tunnel>::1, was unresponsive.
# screen
# ping6 -I gif1 <my ping target's IPv6>

gif_interfaces="gif0 gif1"
gifconfig_gif0="<my IPv4 IP> <primary tunnel's IPv4>"
gifconfig_gif1="<my IPv4 IP> <secondary tunnel's IPv4>"
rtadvd_enable="YES"
rtadvd_interfaces="em0 ue0"
ipv6_gateway_enable="YES"
# ue0 still requires proper configuration of ue0 for "Routed IPs" from HE.
#cat /etc/rtadvd.conf
#em0:\
 #   :addrs#1:addr="<IPv6 apex zone for primary tunnel>:prefixlen#64"
  #  :addrs#2:addr="<IPv6 apex zone for secondary tunnel>:prefixlen#64"
## ue0:\ omitted as it allows ping6 only, meaning its gateway is either not set or improperly set.
dhcp6c_enable="YES"
dhcp6c_interfaces="ue0"
# The above gives an IPv6 IP on ue0 from an internal source. Neither ue0 nor its IPv6 are of concern to me yet.
 
I have these lines (for just one tunnel):

Code:
ipv6_activate_all_interfaces="NO"
ipv6_defaultrouter="⋯"

cloned_interfaces="gif0"
create_args_gif0="tunnel ⋯ ⋯ mtu 1480"
ifconfig_gif0_ipv6="inet6 ⋯ prefixlen 128 NOAUTO"

netif_nic_seq="em0 wlan0 gif0"

The result is up by default, which I rarely want, so I habitually run this after starting the OS:

ifconfig gif0 down && ifconfig wlan0 down
 
Back
Top