cancel
Showing results for 
Search instead for 
Did you mean: 

IPv6 + FreeBSD gateway

avatastic
Grafter
Posts: 1,136
Thanks: 2
Registered: ‎30-07-2007

IPv6 + FreeBSD gateway

After much crashing around pulling out my IPv4 /30 from various config files, everything is working fine.
fxp0 is my LAN interface
rl0 is the interface plugged in to the modem
tun0 is the dialup tunnel device
Here are the relevant bits that get IPv6 running on FreeBSD and handing out addresses to (so far) Windows 7 clients.
---/etc/rc.conf---
ipv6_enable="YES"
ipv6_gateway_enable="YES"
ipv6_ipv4mapping="YES"
rtadvd_enable="YES"
rtadvd_interfaces="fxp0"
dhcp6c_interfaces="tun0"
dhcp6c_enable="YES"
dhcp6s_interface="fxp0"

---/etc/rtadvd.conf---
fxp0:\
  :tc=ether:

--- /etc/ppp/ppp.conf ---

default:
set log local phase lcp ipcp
plusnet_v6:
enable lqr
enable echo
set device PPPoE:re0
set dial
set login
set authname TESTUSER@plusdsl.net
set authkey TESTPASS
set server open
set redial 5 0
set reconnect 5 1
enable ipv6cp
add! default HISADDR
add! default HISADDR6

--- /usr/local/etc/dhcp6c.conf ----

interface fxp0 {
    information-only;
};
interface tun0 {
        send ia-pd 0;
};
id-assoc pd {
        prefix-interface fxp0 {
                sla-id 1;
                sla-len 8;
        };
};

--- /usr/local/etc/dhcp6s.conf --- (used to distribute DNS servers, the below address is my HE tunnel)
option domain-name-servers 2001:470:1f09:5f3::1;
option domain-name "avatastic.co.uk";


The end result:

fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 00:02:b3:eb:24:48
        inet 10.0.1.1 netmask 0xffffff00 broadcast 10.0.1.255
        inet6 fe80::202:b3ff:feeb:2448%fxp0 prefixlen 64 scopeid 0x2
        inet6 2a02:16c8:4080:301:202:b3ff:feeb:2448 prefixlen 64
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:25:22:34:93:30
        inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::225:22ff:fe34:9330%re0 prefixlen 64 scopeid 0x1
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1492
        options=80000<LINKSTATE>
        inet 81.174.168.63 --> 195.166.128.109 netmask 0xffffffff
        inet6 fe80::225:22ff:fe34:9330%tun0 prefixlen 64 scopeid 0x5
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
        Opened by PID 509

And the routes

Routing tables
Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            195.166.128.109    UGS        0    11914  tun0
10.0.1.0/24        link#2            U          9    42072  fxp0
10.0.1.1          link#2            UHS        0      631    lo0
127.0.0.1          link#4            UH          0      16    lo0
192.168.1.0/24    link#1            U          0      31    re0
192.168.1.3        link#1            UHS        0        0    lo0
195.166.128.109    link#5            UHS        0      33  tun0
Internet6:
Destination                      Gateway                      Flags      Netif Expire
::/96                            ::1                          UGRS        lo0 =>
default                          fe80::90:1a00:3a2:84f8%tun0  UGS        tun0
::1                              ::1                          UH          lo0
::ffff:0.0.0.0/96                ::1                          UGRS        lo0
2a02:16c8:4080:301::/64          link#2                        U          fxp0
2a02:16c8:4080:301:202:b3ff:feeb:2448 link#2                        UHS        lo0
fe80::/10                        ::1                          UGRS        lo0
fe80::%re0/64                    link#1                        U          re0
fe80::225:22ff:fe34:9330%re0      link#1                        UHS        lo0
fe80::%fxp0/64                    link#2                        U          fxp0
fe80::202:b3ff:feeb:2448%fxp0    link#2                        UHS        lo0
fe80::%lo0/64                    link#4                        U          lo0
fe80::1%lo0                      link#4                        UHS        lo0
fe80::%tun0/64                    link#5                        U          tun0
fe80::225:22ff:fe34:9330%tun0    link#5                        UHS        lo0
ff01:1::/32                      fe80::225:22ff:fe34:9330%re0  U          re0
ff01:2::/32                      fe80::202:b3ff:feeb:2448%fxp0 U          fxp0
ff01:4::/32                      ::1                          U          lo0
ff01:5::/32                      fe80::225:22ff:fe34:9330%tun0 U          tun0
ff02::/16                        ::1                          UGRS        lo0
ff02::%re0/32                    fe80::225:22ff:fe34:9330%re0  U          re0
ff02::%fxp0/32                    fe80::202:b3ff:feeb:2448%fxp0 U          fxp0
ff02::%lo0/32                    ::1                          U          lo0
ff02::%tun0/32                    fe80::225:22ff:fe34:9330%tun0 UGS        tun0

And the proof of the pudding (from a W7 client set to autoconfigure)
Tracing route to ipv6.bbc.co.uk [2001:4b10:bbc::1]
over a maximum of 30 hops:
  1    <1 ms    <1 ms    <1 ms  2a02:16c8:4080:301:202:b3ff:feeb:2448
  2    25 ms    21 ms    24 ms  2a02:16c8:0:1::3
  3    20 ms    21 ms    22 ms  2a02:16c8:1:8004::1
  4    22 ms    20 ms    23 ms  2a02:16c8::5
  5    19 ms    20 ms    23 ms  2001:7f8:4::1ad7:1
  6    31 ms    23 ms    25 ms  10gigabitethernet1-1.core1.lon1.he.net [2001:7f8
:4::1b1b:1]
  7    60 ms    22 ms    25 ms  2001:7f8:4::c8d:1
  8    20 ms    21 ms    23 ms  cr0-gi1-2.thdo.ipv6.bogons.net [2001:4b10:0:8001
::1]
  9    20 ms    19 ms    19 ms  2001:4b10:bbc::1
Trace complete.
F9 member since 4 Sep 1999
F9 ADSL customer since 27 Aug 2004
DLM manages your line the same way DRM manages your rights.
Look at all the pretty graphs! (now with uptime logging!)