Wednesday, May 21, 2025

IPv6 - Part 4 - FreeBSD IPv6 configuration for Starnet

Starnet is one of the internet providers I use in my home lab setup here in Czechia.

I have been told they are IPv6 ready, so I connected my FreeBSD machine to the network segment we use as point-to-point (P2P /30) for IPv4. For IPv6, there is /64 subnet, where I can connect my IPv6 device.

Logical Network schema is depicted below.

Logical Network Schema

 

Let's start with configuration.
 

IPv6 Configuration 

IPv6 settings can be set dynamically (SLAAC, DHCP6) or statically. 

SLAAC Configuration


My FreeBSD System Configuration /etc/rc.conf

hostname="test-ipv6-01.home.uw.cz"
rtsold_enable="YES" # router solicitation daemon
rtsold_flags="-i -m vmx0"
ifconfig_vmx0_ipv6="inet6 accept_rtadv" # WAN Upstream - SLAAC
dhcp6c_enable="NO"
dhcp6c_interfaces="vmx0"
 
To apply rc.conf and test SLAAC, I run following commands
  • rm /etc/resolv.conf # to test if DNS will be assigned
  • service dhcp6c onestop # to be sure dhcp6c is not used
  • service netif restart vmx0 # to apply network configuration from /etc/rc.conf
In such configuration, the WAN interface (vmx0) and routing table looks like this ...
 root@test-ipv6-01:~ # ifconfig vmx0  
 vmx0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500  
     options=4e403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG>  
     ether 00:50:56:a9:12:77  
     inet6 fe80::250:56ff:fea9:1277%vmx0 prefixlen 64 scopeid 0x1  
     media: Ethernet autoselect  
     status: active  
     nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>  
 root@test-ipv6-01:~ # netstat -rn -f inet6  
 Routing tables  
 Internet6:  
 Destination            Gateway            Flags     Netif Expire  
 ::/96               link#4            URS       lo0  
 default              fe80::9e69:b4ff:fe61:aec4%vmx0 UG      vmx0  
 ::1                link#4            UHS       lo0  
 ::ffff:0.0.0.0/96         link#4            URS       lo0  
 2a02:768:d400:380::/64      link#1            U       vmx0  
 fe80::%lo0/10           link#4            URS       lo0  
 fe80::%vmx0/64          link#1            U       vmx0  
 fe80::250:56ff:fea9:1277%lo0   link#4            UHS       lo0  
 fe80::%vmx2/64          link#3            U       vmx2  
 fe80::250:56ff:fea9:3983%lo0   link#4            UHS       lo0  
 fe80::%lo0/64           link#4            U        lo0  
 fe80::1%lo0            link#4            UHS       lo0  
 ff02::/16             link#4            URS       lo0  
 root@test-ipv6-01:~ #  
  • WAN interface has local-link address fe80::250:56ff:fea9:1277%vmx0 
  • Default router (Starnet router) with local-link address fe80::9e69:b4ff:fe61:aec4%vmx0 has been assigned and add it to routing table.
  • I can ping Starnet router fe80::9e69:b4ff:fe61:aec4%vmx0
  • I cannot ping Google's DNS server 2001:4860:4860::8888 - because I do not have any globaly routed IPv6 address on vmx0 interface

SLAAC Configuration + DHCP6


My FreeBSD System Configuration /etc/rc.conf

hostname="test-ipv6-01.home.uw.cz"
ifconfig_vmx0_ipv6="inet6 accept_rtadv" # WAN Upstream - SLAAC + DHCP
dhcp6c_enable="YES"
dhcp6c_interfaces="vmx0"

My dhcp6c Configuration /usr/local/etc/dhcp6c.conf

interface vmx0 {
       send ia-na 0;            # Request a non-temporary address
};

id-assoc na 0 {
    # No additional settings needed unless you want to override lifetimes
};
 

Application and Observation

To apply rc.conf and test SLAAC, I run following commands
  • rm /etc/resolv.conf # to test if DNS will be assigned
  • service dhcp6c start # to be sure dhcp6c is started and can be used
  • service netif restart vmx0 # to apply network configuration from /etc/rc.conf
In such configuration, the WAN interface (vmx0) and routing table looks absolutely same as with SLAAC configuration only. 
  • I do not have any globaly routed IPv6 address on vmx0 interface. 
  • /etc/resolv.conf is not created by dhcp6c, so no DNS servers are assigned
 

Static IPv6 Configuration

Due to issues obtaining IPv6 settings dynamically, I received the following static IP configuration from Starnet and set it manually.
  • WAN: 2a02:768:d400:380:0:ffff:0a1c:82e6
  • Gateway: 2a02:768:d400:380::1
  • LAN prefix: 2a02:768:d41c:82e6::/64
  • DNS: 2a02:768::2
  • DNS: 2a02:768::3 
 

My FreeBSD System Configuration /etc/rc.conf

hostname="test-ipv6-01.home.uw.cz"
ifconfig_vmx0_ipv6="inet6 2a02:768:d400:380:0:ffff:0a1c:82e6/64" # WAN Upstream - Static
dhcp6c_enable="NO"
dhcp6c_interfaces="vmx0"
 

My DNS Configuration /etc/resolv.conf

search home.uw.cz

# Google's public DNS servers
#
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
 

Application and Observation

To apply rc.conf and test SLAAC, I run following commands
  • service dhcp6c onestop # to be sure dhcp6c is not used
  • service netif restart vmx0 # to apply network configuration from /etc/rc.conf
In such configuration, the WAN interface (vmx0) and routing table looks like this ...

 root@test-ipv6-01:/etc # ifconfig vmx0  
 vmx0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500  
     options=4e403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG>  
     ether 00:50:56:a9:12:77  
     inet6 2a02:768:d400:380:0:ffff:a1c:82e6 prefixlen 64  
     inet6 fe80::250:56ff:fea9:1277%vmx0 prefixlen 64 scopeid 0x1  
     media: Ethernet autoselect  
     status: active  
     nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>  
 root@test-ipv6-01:/etc # netstat -rn -f inet6  
 Routing tables  
 Internet6:  
 Destination            Gateway            Flags     Netif Expire  
 ::/96               link#4            URS       lo0  
 default              fe80::9e69:b4ff:fe61:aec4%vmx0 UG      vmx0  
 ::1                link#4            UHS       lo0  
 ::ffff:0.0.0.0/96         link#4            URS       lo0  
 2a02:768:d400:380::/64      link#1            U       vmx0  
 2a02:768:d400:380:0:ffff:a1c:82e6 link#4            UHS       lo0  
 fe80::%lo0/10           link#4            URS       lo0  
 fe80::%vmx0/64          link#1            U       vmx0  
 fe80::250:56ff:fea9:1277%lo0   link#4            UHS       lo0  
 fe80::%vmx2/64          link#3            U       vmx2  
 fe80::250:56ff:fea9:3983%lo0   link#4            UHS       lo0  
 fe80::%lo0/64           link#4            U        lo0  
 fe80::1%lo0            link#4            UHS       lo0  
 ff02::/16             link#4            URS       lo0  
 root@test-ipv6-01:/etc #  
  • WAN interface has local-link address fe80::250:56ff:fea9:1277%vmx0 
    • That's correct.
  • WAN interface has  globaly routed address 2a02:768:d400:380:0:ffff:a1c:82e6
    • That's obvious because I have assigned it statically
  • Default router (Starnet router) with local-link address fe80::9e69:b4ff:fe61:aec4%vmx0 has been assigned and add it to routing table. 
    • That's correct. It is assiged by SLAAC. All routing is via local-link addresses.
  • I can ping Starnet router fe80::9e69:b4ff:fe61:aec4%vmx0
    • That's correct. It worked for SLAAC configuration as well.
  • I can ping Google's DNS server 2001:4860:4860::8888 - because I have statically assigned globaly routed IPv6 address on vmx0 interface
    • That's perfect. Routing works perfectly.
  • I can ping Google's web site www.google.com over IPv6
    • Perfect. IPv6 DNS resolving works.
    • The only problem I see is response time 19.5 ms
    • From my other servers with IPv4 I have response time 7.4 ms
    • I will focus on network peformance (thorughput and response time) in next section
 

IPv6 Network Performance Testing 

Everything must be thoroughly tested before it can be considered production-ready. Let's do some tests.

traceroute6

 dpasek@test-ipv6-01:~ $ traceroute6 www.google.com  
 traceroute6 to www.google.com (2a00:1450:400a:804::2004) from 2a02:768:d400:380:0:ffff:a1c:82e6, 64 hops max, 28 byte packets  
  1 2a02:768:d400:380::1 3.368 ms 1.586 ms 1.579 ms  
  2 2a02:768:0:3422::3422 6.269 ms 6.206 ms 6.241 ms  
  3 2a01:28:c:77::1 6.117 ms  
   cust-starnet.sh.cz 6.275 ms  
   2a01:28:c:77::1 8.262 ms  
  4 vl13.prg-sit-sh-core-1.sh.cz 6.358 ms  
   vl16.prg-sit-sh-core-2.sh.cz 6.402 ms  
   vl15.prg-sit-sh-core-2.sh.cz 6.268 ms  
  5 google.peering.cz 6.392 ms 6.438 ms 6.222 ms  
  6 2001:4860:0:1::7f33 6.360 ms  
   2001:4860:0:1::7ee3 6.323 ms  
   2001:4860:0:1::7f33 6.364 ms  
  7 2001:4860:0:1::7e6a 26.836 ms  
   2001:4860:0:1::7f2c 7.332 ms  
   2001:4860:0:1::7eee 7.427 ms  
  8 2001:4860::9:4003:6d46 19.847 ms 21.094 ms 19.352 ms  
  9 2001:4860::c:4003:364f 21.768 ms  
   2001:4860::c:4003:364e 13.442 ms 13.443 ms  
 10 2001:4860::9:4002:10f 19.549 ms  
   2001:4860:0:1::862d 18.885 ms  
   2001:4860::c:4003:3648 20.111 ms  
 11 2001:4860:0:1::7b99 20.671 ms  
   2001:4860:0:1::8627 22.558 ms  
   pnzrha-aj-in-x04.1e100.net 18.894 ms  

ping

 dpasek@test-ipv6-01:~ $ ping -c 15 www.google.com  
 PING(56=40+8+8 bytes) 2a02:768:d400:380:0:ffff:a1c:82e6 --> 2a00:1450:400a:804::2004  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=0 hlim=116 time=18.917 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=1 hlim=116 time=25.675 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=2 hlim=116 time=18.997 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=3 hlim=116 time=19.330 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=4 hlim=116 time=20.405 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=5 hlim=116 time=19.017 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=6 hlim=116 time=18.933 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=7 hlim=116 time=18.932 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=8 hlim=116 time=18.914 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=9 hlim=116 time=19.052 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=10 hlim=116 time=18.937 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=11 hlim=116 time=19.068 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=12 hlim=116 time=18.861 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=13 hlim=116 time=18.941 ms  
 16 bytes from 2a00:1450:400a:804::2004, icmp_seq=14 hlim=116 time=18.971 ms  
 --- www.google.com ping statistics ---  
 15 packets transmitted, 15 packets received, 0.0% packet loss  
 round-trip min/avg/max/stddev = 18.861/19.530/25.675/1.683 ms  
Attention! IPv6 response time 19.5 ms is much (almost 3x) worse than IPv4 7.4 ms.

iperf3 (Throughput) upload test

 root@test-ipv6-01:~ # iperf3 -c iperf3.moji.fr -t60 -i5  
 Connecting to host iperf3.moji.fr, port 5201  
 [ 5] local 2a02:768:d400:380:0:ffff:a1c:82e6 port 45833 connected to 2a06:c484:6::3:1 port 5201  
 [ ID] Interval      Transfer   Bitrate     Retr Cwnd  
 [ 5]  0.00-5.01  sec  126 MBytes  211 Mbits/sec  0  3.00 MBytes  
 [ 5]  5.01-10.00 sec  128 MBytes  215 Mbits/sec  0  3.00 MBytes  
 [ 5] 10.00-15.01 sec  126 MBytes  211 Mbits/sec  67  1.83 MBytes  
 [ 5] 15.01-20.01 sec  122 MBytes  205 Mbits/sec  25  1.52 MBytes  
 [ 5] 20.01-25.01 sec  129 MBytes  216 Mbits/sec  0  1.61 MBytes  
 [ 5] 25.01-30.01 sec  129 MBytes  216 Mbits/sec  0  1.66 MBytes  
 [ 5] 30.01-35.11 sec  131 MBytes  215 Mbits/sec  0  2.09 MBytes  
 [ 5] 35.11-40.01 sec  125 MBytes  214 Mbits/sec  0  3.00 MBytes  
 [ 5] 40.01-45.01 sec  128 MBytes  215 Mbits/sec  0  3.00 MBytes  
 [ 5] 45.01-50.00 sec  126 MBytes  213 Mbits/sec 119  2.50 MBytes  
 [ 5] 50.00-55.01 sec  128 MBytes  215 Mbits/sec  0  2.94 MBytes  
 [ 5] 55.01-60.00 sec  128 MBytes  215 Mbits/sec  0  3.00 MBytes  
 - - - - - - - - - - - - - - - - - - - - - - - - -  
 [ ID] Interval      Transfer   Bitrate     Retr  
 [ 5]  0.00-60.00 sec 1.49 GBytes  213 Mbits/sec 211      sender  
 [ 5]  0.00-60.07 sec 1.49 GBytes  213 Mbits/sec         receiver  
 iperf Done.  
 root@test-ipv6-01:~ #  


iperf3 (Throughput) dowload test

 root@test-ipv6-01:~ # iperf3 -c iperf3.moji.fr -t60 -i5 -R  
 Connecting to host iperf3.moji.fr, port 5201  
 Reverse mode, remote host iperf3.moji.fr is sending  
 [ 5] local 2a02:768:d400:380:0:ffff:a1c:82e6 port 30661 connected to 2a06:c484:6::3:1 port 5201  
 [ ID] Interval      Transfer   Bitrate  
 [ 5]  0.00-5.00  sec  116 MBytes  195 Mbits/sec  
 [ 5]  5.00-10.01 sec  122 MBytes  205 Mbits/sec  
 [ 5] 10.01-15.01 sec  124 MBytes  208 Mbits/sec  
 [ 5] 15.01-20.05 sec  123 MBytes  204 Mbits/sec  
 [ 5] 20.05-25.01 sec  125 MBytes  211 Mbits/sec  
 [ 5] 25.01-30.05 sec  120 MBytes  199 Mbits/sec  
 [ 5] 30.05-35.01 sec  122 MBytes  206 Mbits/sec  
 [ 5] 35.01-40.01 sec  124 MBytes  208 Mbits/sec  
 [ 5] 40.01-45.01 sec  124 MBytes  208 Mbits/sec  
 [ 5] 45.01-50.01 sec  121 MBytes  202 Mbits/sec  
 [ 5] 50.01-55.01 sec  124 MBytes  207 Mbits/sec  
 [ 5] 55.01-60.01 sec  117 MBytes  197 Mbits/sec  
 - - - - - - - - - - - - - - - - - - - - - - - - -  
 [ ID] Interval      Transfer   Bitrate     Retr  
 [ 5]  0.00-60.04 sec 1.43 GBytes  205 Mbits/sec 3577      sender  
 [ 5]  0.00-60.01 sec 1.43 GBytes  204 Mbits/sec         receiver  
 iperf Done.  
 root@test-ipv6-01:~ #  


Conclusion

Globaly routed Iv6 addresses must be assign statically. SLAAC dynamically assigns link-local addresses only. DHCP6 does not help either. 

I can live with static IP addresses, but the biggest issue is that IPv6 has significantly (almost 3x) higher response time than IPv4.

  • PING IPv6 response time 19.5 ms
  • PING Pv4 response time 7.4 ms
  • I can achieve the expected symmetric 200 Mbps throughput on both protocols, so network throughput works perfectly fine, the only problem is the response time.


    Series

    No comments:

    Post a Comment