Unifix knowledge database - The original one

Dashboard - News - Search - List - About - Admin


IPv6 router under FreeBSD

Author:mike - Sun Apr 27 03:22:46 2003

First set up the IPv6 native for the router(mostly done by tunneling)
  
   XS26.net's scripts

#!/bin/sh
#MYIPv4="80.196.157.241" # My IPv4 address
#XSIPv4="62.61.157.209"     # PoP's IPv4 address
#MYIPv6="3ffe:80ee:5f8::1" # Choose any IPv6 address from the range
                           # you've got from XS26
##TUNLIF="gif0"

ifconfig gif0 create tunnel 80.196.157.241 62.61.157.209 up
route add -inet6 default -interface gif0
ifconfig lo0 inet6 3ffe:80ee:5f8::1 prefixlen 128


Then we need to compile firewall support for IPv6 into the kernel, add these and rebuild kernel:

options         IPV6FIREWALL
options         IPV6FIREWALL_VERBOSE


By default everything is disallowed so to allow everything(IMPORTENT: Just because almost nobody uses IPv6 you cant drop the security here, so you have to get back later to set up a prober firewall) type:

ip6fw add accept all from any to any


Then our local ipv6 is running, to share it we first have to make our local machines able to talk to each other trough ipv6, to do this the local interface have to have an ipv6 ip:

ifconfig rl0 inet6 3ffe:80ee:5f8::1 prefixlen 64

Note that this is the same ip as the machine has on the global interface, but here with 64 bit prefix instead meaning that the network 3ffe:80ee:5f8:: can be reached trough this interface.

Then enable routing by typing:
sysctl net.inet6.ip6.forwarding=1

and now it should be running, this can be done automaticly by a dirty litle quick hack in you init scripts, or you can try to figure out how to do as much as posible of it from standard initscripts.

This works in a pure setup, if you mix it with other technologies you might encounter odd problems which requires newthinking.
Copyright(c) Unifix.org 2002-2011


Dashboard - News - Search - List - About - Admin
 
Powered by Mikjaer Consulting Solutions - Hosted by Specialhosting.dk