FreeBSD Configure IPv6 Networking / Static IP Address

How do I configure IPv6 networking under FreeBSD 7.x server? How do I assign IPv6 IP address using command line utility?

IPv6 (IP next generation) can be easily configured under FreeBSD 7.x or 6.x. You need to know:


  1. A default router IPv6 address such as 2001:470:1e04:5ea::1
  2. 128 bit IPv6 IP such as 2001:470:1e04:5ea::10

FreeBSD IPv6 Network Configuration

Edit /etc/rc.conf file, enter:
# vi /etc/rc.conf

WARNING! Following configuration requires that the kernel has been compiled with options INET6 (a default in FreeBSD 6.x+ or above version)

Append following configurations:


  • ipv6_enable=”YES” : Turn on IPv6 networking support.
  • ipv6_ifconfig_fxp0=”2001:470:1e04:5ea::10″ : Assign an IP address
  • ipv6_defaultrouter=”2001:470:1e04:5ea::1″ : assign a default router

Save and close the file. Restart IPv6 networking, enter:
# /etc/rc.d/network_ipv6 restart
To view newly assigned IP address, enter:
# ifconfig
# ifconfig | grep inet6

How do I test my FreeBSD IPv6 networking connectivity?

Simply use ping6 or traceroute6 commands, enter:
$ ping6
Try traceroute6 command, enter
$ traceroute6

 1?: [LOCALHOST]                      pmtu 1280
 1:  2001:5c0:8fff:fffe::a68c                 312.051ms 
 2:  no reply
 3: 388.794ms 
 4: asymm  5 345.947ms 
 5: asymm  6 364.053ms 
 6:  2001:5a0:400:200::1                      asymm  7 387.877ms 
 7:  2001:5a0:400:200::6                      381.125ms 
 8:  2001:5a0:600:100::5                      asymm  6 357.572ms 
 9:  2001:5a0:600::5                          asymm  7 363.006ms 
10:                asymm  9 386.211ms !A
     Resume: pmtu 1280 

Try host command to obtian both IPv6 and IPv6 address, enter:
$ host
Sample output: has address has IPv6 address 2001:200:0:8002:203:47ff:fea5:3085

Finally, you can always visit and see dancing kame to confirm IPv6. You can also try IPv6 Google search.

How do I assign IP address using command line ifconfig utility?

Use ifconfig command as follows to assign an IP address:
# ifconfig {interface-name} inet6 {IPv6-Address} prefixlen {routed-bit}
# ifconfig le0 inet6 001:470:1e04:5ea::10 prefixlen 64

To add a default router, enter:
# route -n add -inet6 default {IPv6-Router-IP}
# route -n add -inet6 default 2001:470:1e04:5ea::1

Further readings:

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

3 comments… add one
  • golfreeze Apr 19, 2011 @ 13:38

    Thank you krub

  • farhang Oct 18, 2012 @ 5:23

    very good,merc

  • Denard Thomas Apr 15, 2016 @ 8:37

    I have been toiling with turning up IPv6 on my FreeBSD terminal all night. Thank you very much for this explanation!

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.