Posted on 2009-11-06 18:00:00
Tags: FreeBSD, IPv6
Internode has announced IPv6 capabilities for their ADSL users and I have volunteered for the pilot. My ADSL router, a Linksys WAG54G2 running version 1.00.17, didn't support it out of the box, so I needed to do it via the FreeBSD host sitting behind it. The FreeBSD host is running 8.0-RC2 at this moment, but it should work with previous versions too:
The first step is to turn the ADSL router into an ADSL modem by changing the Encapsulation on the WAN side from RFC 2516 PPPoE to Bridged Mode Only. From that moment in time you have lost your internet connection :-)
Add to your /etc/rc.conf:
` That was simple. Reboot :-)ipv6_enable="YES"
Setup PPP on the FreeBSD host, add this to your /etc/ppp/ppp.conf:
Notes:pppoe6: set authname "edwing@ipv6.internode.on.net" set authkey "secret" set device PPPoE:sk0 enable lqr echo nat enable yes set cd 5 set dial set login set redial 0 0 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 add default HISADDR # Add a (sticky) default route add default HISADDR6 # Add a (sticky) default route
and the the PPP interface has been setup:[~] root@k7>ppp pppoe6 Loading /lib/libalias_cuseeme.so Loading /lib/libalias_ftp.so Loading /lib/libalias_irc.so Loading /lib/libalias_nbt.so Loading /lib/libalias_pptp.so Loading /lib/libalias_skinny.so Loading /lib/libalias_smedia.so Working in interactive mode Using interface: tun0 ppp ON k7> dial ppp ON k7> Warning: deflink: Reducing configured MRU from 1500 to 1492 Ppp ON k7> Warning: deflink: Reducing configured MRU from 1500 to 1492 PPp ON k7> Warning: ::/: Change route failed: errno: No such process PPp ON k7> PPP ON k7>
And the default gateways have been set:[~] root@k7>ifconfig tun0 tun0: flags=8051metric 0 mtu 1492 inet6 fe80::20f:eaff:fe2c:d518%tun0 prefixlen 64 scopeid 0x4 inet 150.101.113.58 --> 150.101.197.23 netmask 0xffffff00 Opened by PID 35920
Now we have the IPv6 configuration setup, but can't do much except for pinging out default gateway:[~] edwin@k7>netstat -rn | grep default default 150.101.197.23 UGS 0 340 tun0 default fe80::20c:86ff:fe75:241b%tun0 UGS tun0
[~] edwin@k7>ping6 -c 1 fe80::20c:86ff:fe75:241b PING6(56=40+8+8 bytes) fe80::20f:eaff:fe2c:d518%tun0 --> fe80::20c:86ff:fe75:241b 16 bytes from fe80::20c:86ff:fe75:241b%tun0, icmp_seq=0 hlim=64 time=10.544 ms --- fe80::20c:86ff:fe75:241b ping6 statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 10.544/10.544/10.544/0.000 ms [~] edwin@k7>ping6 -c 1 www.freebsd.org PING6(56=40+8+8 bytes) fe80::20f:eaff:fe2c:d518%tun0 --> 2001:4f8:fff6::21 --- www.freebsd.org ping6 statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss
The next step is to grab an allocation of IPv6 addresses for our network: First install the net/dhcp6 port and use the following configuration for /usr/local/etc/dhcp6c.conf:
Notes:interface sk0 { information-only; }; interface tun0 { send ia-pd 0; }; id-assoc pd { prefix-interface sk0 { sla-id 1; sla-len 4; }; };
But ifconfig sk0 now gives the proper output:[~] root@k7>dhcp6c -f -d tun0 Nov/06/2009 11:59:35: dhcp6_ctl_authinit: failed to open /usr/local/etc/dhcp6cctlkey: No such file or directory Nov/06/2009 11:59:35: client6_init: failed initialize control message authentication Nov/06/2009 11:59:35: client6_init: skip opening control port
I don't know why it says there that the prefix-length is 64 bits, but the IPv6 connectivity is there:[~] root@k7>ifconfig sk0 sk0: flags=8843metric 0 mtu 1500 options=b ether 00:0f:ea:2c:d5:18 inet6 2001:44b8:7bf1:a51:20f:eaff:fe2c:d518 prefixlen 64 media: Ethernet autoselect (100baseTX ) status: active
[~] root@k7>ping6 -c 1 www.freebsd.org PING6(56=40+8+8 bytes) 2001:44b8:7bf1:a51:20f:eaff:fe2c:d518 --> 2001:4f8:fff6::21 16 bytes from 2001:4f8:fff6::21, icmp_seq=0 hlim=56 time=194.522 ms --- www.freebsd.org ping6 statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 194.522/194.522/194.522/0.000 ms
Now you have one FreeBSD computer with IPv6 connectivity. The next step is to enable it on the rest of the network. Add to your /etc/rc.conf:
As seen earlier, sk0 is the ethernet interface of my FreeBSD machine.ipv6_gateway_enable="YES" rtadvd_enable="YES" rtadvd_interfaces="sk0"
To enable IPv6 connectivity on the other computers....
and reboot. It now is properly configured too:ipv6_enable="YES" rtsol_interfaces="fxp0" ipv6_default_gateway="fxp0"
and[~] edwin@vaio>ifconfig fxp0 fxp0: flags=8843metric 0 mtu 1500 options=2009 ether 00:01:4a:83:a5:82 inet6 fe80::201:4aff:fe83:a582%fxp0 prefixlen 64 scopeid 0x3 inet 10.204.250.107 netmask 0xffffff00 broadcast 10.204.250.255 inet6 2001:44b8:7bf1:a51:201:4aff:fe83:a582 prefixlen 64 autoconf media: Ethernet autoselect (100baseTX ) status: active
[~] edwin@vaio>ping6 -c 1 www.freebsd.org PING6(56=40+8+8 bytes) 2001:44b8:7bf1:a51:201:4aff:fe83:a582 --> 2001:4f8:fff6::21 16 bytes from 2001:4f8:fff6::21, icmp_seq=0 hlim=55 time=193.748 ms --- www.freebsd.org ping6 statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 193.748/193.748/193.748/0.000 ms
From: | ipv6@oldach.net |
URL: | |
Posted on: | 2012-04-15 02:15:09 |
Comment | Did you notice that ppp ignores IPv6 privacy option?
tun0: flags=8051 metric 0 mtu 1492 inet6 fe80::20f:eaff:fe2c:d518%tun0 prefixlen 64 scopeid 0x4 inet 150.101.113.58 --> 150.101.197.23 netmask 0xffffff00 Opened by PID 35920 I think the MAC address of your Ethernet card is 00:0f:ea:2c:d5:18 :-) Note that # sysctl net.inet6.ip6.use_tempaddr=1 # sysctl net.inet6.ip6.prefer_tempaddr=1 does not help! |
Reply | - |