Table of Contents
Since version 2.0 of Bering-uClibc IPv6 is an officially supported
feature. In previous versions of Bering-uClibc and in "plain" Bering
very limited IPv6 functionality was available using the
ipv6.o
kernel module and the
ip
command, but no IPv6 applications were
provided.
The IPv6 support of Bering-uClibc consists of
a modules package with all necessary IPv6 kernel modules
applications compiled with IPv6 enabled (if applicable)
6wall, an IPv6 firewall based on Shorewall
These instructions are for those who want to use their Bering-uClibc system not only as an IPv4 router/firewall but also as an IPv6 router/firewall. This document assumes that you already have a some knowledge about Bering-uClibc.
A good start for more information on IPv6 is the Linux IPv6 HOWTO and Peter Bieringer's IPv6 & Linux - HowTo.
Depending on the other packages and modules that you have installed on your system, one floppy may offer you enough disk space to put it all together. Check the Bering user's guide section about "Booting Bering from different boot-media" for tips on e.g. a two-floppy setup or other solutions.
You can use your Bering-uClibc IPv6 router for stand-alone networks without additional requirements. However, if you want to connect to the Internet using IPv6 you need an IPv6 link to the Internet. Most of us currently don't have a native IPv6 connection to the Internet, but you can get access via an IPv6 tunnelbroker. In that case you establish an IPv4 tunnel with the tunnelbroker. The IPv6 traffic is sent through this tunnel from your network to the tunnelbroker and vice-versa. To setup this tunnel most tunnelbrokers require that you have a static IPv4 address assigned to you by your ISP.
Examples of tunnelbrokers are Freenet6, XS26, SixXS and Hurricane Electric.
Freenet6 uses the Tunnel Setup Protocol (TSP) to establish a tunnel between your IPv6 tunnel endpoint and their endpoint. A Bering-uClibc package with the TSP client is available. For more information check the chapter on freenet6.lrp.
In order to have IPv6 working, you need to have IPv6 support
enabled through the appropriate kernel module:
kernel/net/ipv6/ipv6.o
. There are two ways to do
this:
Use the modules_ipv6.lrp
package
Manually add the module to your existing
modules.lrp
package
if you are starting with fresh installation of Bering-uClibc or
if you haven't heavily modified the modules package of you're system,
this is probably the easiest approach. Rename this package to
modules.lrp
and replace the original package with
this one. if you need more information on how to add/replace modules
on your system, check the Bering-uClibc
Installation Guide.
Now reboot your system.
The kernel module for IPv6 can be found in the kernel module tarball. This tarball can be downloaded from the Sourceforge FRS. Information on how to add a kernel module to your system can be found in the Bering-uClibc Installation Guide.
The size of this module is about 90Kb after compression in
the package. Make sure that you have that much free space on the
disk with the modules.lrp
package.
To configure your module, go to the LEAF Packages configuration
menu and choose modules. Enter 1) to edit the
/etc/modules
file and enter the following
information:
(...) # IPv6 support ipv6 (...)
Backup the modules.lrp
package and
reboot your system.
After installing modules_ipv6.lrp
or
manually adding ipv6.o
you can check if the
module works by giving the following command:
Bering-uClibc -root- # ip addr 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 brd 127.255.255.255 scope host lo inet6 ::1/128 scope host 2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff 3: eth0: <BROADCAST,MULTICAST,UP>> mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:40:95:1a:14:f4 brd ff:ff:ff:ff:ff:ff inet 10.0.0.120/24 brd 10.0.0.255 scope global eth0 inet6 fe80::240:95ff:fe1a:14f4/10 scope link 4: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:40:95:1a:14:70 brd ff:ff:ff:ff:ff:ff inet 192.168.1.254/24 brd 192.168.1.255 scope global eth1 inet6 fe80::240:95ff:fe1a:1470/10 scope link 5: sit0@NONE: <NOARP> mtu 1480 qdisc noop link/sit 0.0.0.0 brd 0.0.0.0
Copy the the following packages to one of your floppies:
radvd.lrp
ip6table.lrp
6wall.lrp
These packages are provided in the IPv6 drop-in tarball which can be downloaded from the Sourceforge FRS.
Detailed information on how to add packages to your system can be found in the Bering-uClibc Installation Guide.
Modify the lrpkg.cfg
file to load the new
packages.
root,etc,local,modules,ppp,dnscache,weblet,iptables,shorwall,radvd,ip6table,6wall
If all worked well, you should have seen some IPv6 addresses (inet6) appear on your interfaces in previous step. All these addresses have scope "local", this means that these are link-local addresses and can only be used on the network segment to which the interface is connected. But since you're working with a Bering-uClibc router it's highly unlikely that your network consists only of one segment, but rather of two or more.
If you want hosts on different segments to communicate with each other using IPv6, you need to assign these hosts either site-local or global addresses. global addresses need to be assigned to you by an ISP and site-local addresses are your to use freely within your own network (like the RFC1918 addresses for IPv4). Therefore, we'll start using site-local addresses first. If you have global addresses and don't want to use site-local addresses, you can skip this section and go directly to Step 6: Configure a 6to4 tunnel.
The prefixes used in this example are:
eth0 - fec0:1::/64
eth1 - fec0:2::/64
Invoke lrcfg and choose 1) Network configuration and then 1) Network Interfaces. In the interface file add an IPv6 address for your each of your interfaces that corresponds with the prefix for the interface.
(...) iface eth0 inet6 static address fec0:1::1 masklen 64 iface eth1 inet6 static address fec0:2::1 masklen 64 (...)
Next, within lrcfg choose 2) Network options
file. In this config file IPv6 forwarding can be enabled, which is nice
for a router ;-)
.
(...) ipv6_forward=yes (...)
The effect of this configuration item is that on start-up the command echo 1 > /proc/sys/net/ipv6/conf/all/forwarding is given.
Backup the etc.lrp
package.
One of the features of IPv6 is the router advertisement mechanism. When a router advertises the network prefix to be used on a network segment, hosts on that segment can use the advertised prefix to automagically configure an IPv6 address. The router advertisement messages are also used by the hosts to configure the gateway address.
The radvd.lrp
package contains a router
advertisement daemon for Bering-uClibc. The configuration of the daemon
is very straight forward. If in our example we want to use router
advertisement on eth1, edit the /etc/radvd.conf
file as follows:
interface eth1 { AdvSendAdvert on; prefix fec0:2::/64 { AdvOnLink on; AdvAutonomous on; }; };
Backup the radvd.lrp
package and reboot
the system.
Check the ip addresses and the routing table with the following commands:
Bering-uClibc -root- # ip -6 addr 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue inet6 ::1/128 scope host 3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 inet6 fec0:1::1/64 scope site inet6 fe80::240:95ff:fe1a:14f4/10 scope link 4: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 inet6 fec0:2::1/64 scope site inet6 fe80::240:95ff:fe1a:1470/10 scope link Bering-uClibc -root- # ip -6 route fe80::/10 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 fe80::/10 dev eth1 proto kernel metric 256 mtu 1500 advmss 1440 fec0:1::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 fec0:2::/64 dev eth1 proto kernel metric 256 mtu 1500 advmss 1440 ff00::/8 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 ff00::/8 dev eth1 proto kernel metric 256 mtu 1500 advmss 1440 unreachable default dev lo metric -1 error -101 Bering-uClibc -root- # cat /proc/sys/net/ipv6/conf/all/forwarding 1
Now an IPv6 capable system (how to configure IPv6 on Win XP) in one segment of your network should now be able to ping6 another IPv6 system in another segment connected to the router. Both should also be able to ping6 the router.
Ping6 is the IPv6 equivalent of ping and is provided by the
initrd.lrp
package.
In the most luxurious case you have a native IPv6 connection to the internet. In that case you can follow Step 4 and 5 and substitute the site-local addresses used with your global addresses. if you're not that lucky, IPv6 access to the Internet can be achieved via a tunnelbroker (see Section - Prerequisites). You will get the necessary global addresses and prefix(es) from the tunnelbroker. This is what will be described below.
When connecting via a tunnelbroker, an IPv6-to-IPv4 (6to4) tunnel is established between your gateway and the tunnelbroker. To setup this tunnel you need the following information (imaginary information is given for the example):
IPv4 address for the tunnel end-point of the tunnelbroker -
202.143.23.6
IPv6 address of the tunnelbroker -
3ffe:8280:0:2001::1
IPv6 address assigned to you -
3ffe:8280:0:2001::2
IPv6 prefix assigned to you (for use on your network) -
3ffe:8280:10:8560::/60
Edit /etc/network/interfaces
as
follows:
(...) # # Definition of the Ipv6-to-IPv4 tunnel interface # #auto tun6to4 iface tun6to4 inet6 v4tunnel address 3ffe:8280:0:2001::2 netmask 64 gateway 3ffe:8280:0:2001::1 endpoint 202.143.23.6 ttl 254 (...)
Backup the etc.lrp
package.
At this stage the auto tun6to4
statement
is commented-out. This is because no IPv6 firewall is active yet, so
the tunnel is best brought up only when necessary and as soon as
possible be brought down again. This can be done with the commands
ifup tun6to4 and ifdown
tun6to4
The gateway statement in the tunnel definition causes a default route to be created. However, it turns out that this is not working (maybe a bug in Linux IPv6 support). To solve this problem a route to the global address space (2000::/3) is added explicitly.
You need to allow the 6to4 tunnel traffic from the Bering-uClibc Firewall to the tunnelbroker. This traffic uses IP protocol 41.
With Shorewall 1.4.3 and later you can add a 6to4 tunnel
definition in the /etc/shorewall/tunnels
file. In
the examples below it is assumed that your firewall zone is called
"fw
" and the Internet zone
"net
".
#TYPE ZONE GATEWAY GATEWAY ZONE (...) 6to4 net 202.143.23.6 (...)
More information on Shorewall and 6to4 tunnels can be found in the Shorewall documentation.
For versions older than 1.4.3 you can add some rules in the
/etc/shorewall/rules
file.
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL # PORT PORT(S) DEST (...) # # Accept 6to4 tunnel traffic from the firewall to tunnelbroker # ACCEPT fw net:202.143.23.6 41 ACCEPT net:202.143.23.6 fw 41 (...)
Backup the shorwall.lrp
package.
After restarting Shorewall, you should be able to ping6 or traceroute6 to IPv6 accessible hosts on the Internet. Some hosts that you could try are:
www.ipv6.surfnet.nl
www.linux-ipv6.org
www.kame.net
In the following it is assumed that your local network is connected to eth1 and that the connection to the internet (over which the 6to4 tunnel will be established) goes via eth0.
Based on the information from your tunnelbroker, select the prefix
of /64 to be used on the network segment connected to eth1. Then edit
/etc/network/interfaces
as follows:
(...) iface eth1 inet6 static address fec0:2::1 masklen 64 up ip addr add 3ffe:8280:10:8560::1/64 dev eth1 (...)
To define a second IPv6 address on an interface, don't use a second "iface" statement. This is not supported by ifupdown, use the "up" statement within the existing iface statement instead.
To advertise the selected global prefix as well as the site-local
prefix from Step 4, edit the /etc/radvd.conf
file
as follows:
interface eth1 { AdvSendAdvert on; prefix fec0:2::/64 { AdvOnLink on; AdvAutonomous on; }; prefix 3ffe:8280:10:8560::/64 { AdvOnLink on; AdvAutonomous on; }; };
Backup the etc.lrp
and the
radvd.lrp
packages.
After restarting the Router Advertisement daemon, any systems running on your local network that support autconfiguration for IPv6, they should be getting a global IPv6 address. If not, maybe the system needs to be rebooted first.
When a system on the local network has configured a global IPv6 address, it should now also be able to ping6 and traceroute6 to the hosts mentioned in Step 7.
Keep in mind that at this moment there is still no IPv6 firewall active. This will be done in the next step. Everybody has free access to all your systems with global addresses on the local network. So, only have the 6to4 tunnel up when you are doing some tests. After testing, bring down the tunnel as soon as possible.
6wall is for IPv6 what Shorewall is for IPv4.
6wall is an IPv6 firewall which is derived from Shorewall version 1.4. So if you're familiar with Shorewall you should have no problem configuring 6wall. The best way to start is to read-up on Tom Eastep's excellent Shorewall documentation. After that, check the 6wall documentation where specific issues for 6wall are described.
When you're done reading, you can configure 6wall. Go to the packages menu and select 6wall. The following menu will appear:
6wall configuration files 1) Zones Partition the network into Zones 2) Ifaces 6wall Networking Interfaces 3) Hosts Define specific zones 4) Policy Firewall high-level policy 5) Rules Exceptions to policy 6) Maclist MAC verification 7) Config 6wall Global Parameters 8) Blacklist Blacklisted hosts 9) SiteLocal Defines 'nositelocal' interface option 10) Common Common rules 11) Init Commands executed before [re]start 12) Start Commands executed after [re]start 13) Stop Commands executed before stop 14) Stopped Commands executed after stop q) quit ---------------------------------------------------------------------------- Selection:
The configuration files that can be edited via the menu above are
located in the /etc/6wall/
directory. Below is the
default configuration of some of these files.
The zones for IPv6 are described in
zones6
:
#ZONE DISPLAY COMMENTS net Net Internet loc Local Local networks
The interfaces for IPv6 are described in
interfaces6
:
#ZONE INTERFACE OPTIONS net tun6to4 nositelocal loc eth1
The policies for IPv6 are described in
policy6
:
#SOURCE DEST POLICY LOG LEVEL loc net ACCEPT net all DROP info all all DROP info
The rules for IPv6 are described in
rules6
:
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL # PORT PORT(S) DEST # # Allow ping6 from the firewall # ACCEPT fw all icmpv6 echo-request # # # Allow ping6 from the local network to the firewall # ACCEPT loc fw icmpv6 echo-request
This configuration should get you started and you can modify these or other configuration files to suit your needs.
Backup the modules.lrp
,
6wall.lrp
and etc.lrp
packages.
Now reboot your system and enjoy safe surfing on the IPv6 Internet !!
A number of applications are IPv6 specific while others are generic but with IPv6 support enabled. below an overview of the IPv6 (enabled) applications in Bering-uClibc is given. The following sections will go into the IPv6 specifics of these applications.
Description | ping6 and netstat from BusyBox |
Source | www.busybox.net |
Version | 1.0 |
Package | initrd.lrp |
Description | Router advertisement daemon |
Source | v6web.litech.org/radvd |
Version | 0.7.2 |
Package | radvd.lrp |
Check the section on IPv6 configuration for more info on how to configure the routing advertisement daemon.
Description | Netfilter application for IPv6 |
Source | www.netfilter.org |
Version | 1.2.8 |
Package | ip6table.lrp |
No explicit configuration is needed for ip6tables within Bering-uClibc since the complete netfilter configuration is done by 6wall.
Description | IPv6 firewall scripts for ip6tables |
Source | LEAF CVS |
Version | 1.0.2 |
Package | 6wall.lrp |
Check the section on IPv6 configuration for more info on how to configure the routing advertisement daemon.
The known limitations and problems with this application are listed below. If you happen to have a solution for these issues, please let us know.
See section "Limitations" in the 6wall documentation.
Description | Dns cache and dns server applications from Tinydns |
Source | tinydns.org and the IPv6 patch from www.fefe.de/dns/ |
Version | 1.0.5 |
Package | dnscache.lrp and
tinydns.lrp |
The current version of the IPv6 patch adds support for AAAA records (those are the DNS records that store IPv6 numbers) and IPv6 addresses in PTR records. It also supports automatic internal lookup of some reserved IPv6 addresses (like "::1").
IPv6 related configuration is only applicable for
tinydns. The AAAA records are configured in the
private DNS server data file
(/etc/tinydns-private/root/data
) and/or the
public DNS server data file
(/etc/tinydns-public/root/data
). See below for a
sample configuration of the private DNS server data file with IPv6
addresses. The keyword "6" is used to define the
IPv6 AAAA and PTR records. If you don't want the PTR record but only
the AAAA record, use the keyword "3"
instead.
.local.net::ns.local.net .1.168.192.in-addr.arpa::ns.local.net +ns.local.net:127.0.0.1 =hosta.local.net:192.168.1.1 =hostb.local.net:192.168.1.2 =firewall.local.net:192.168.1.254 6hosta.local.net:20010888180f157f0000000000000001 6hostb.local.net:20010888180f157f0000000000000002 6firewall.local.net:20010888180f157f0000000000000254 6hostasitelocal.local.net:fec0000000000000020024fffec06936 6hostbsitelocal.local.net:fec00000000000000250bffffe124c5b 6firewallsitelocal.local.net:fec0000000000000024095fffe161d42
Notice that the IPv6 address needs to be fully specified, no abbreviation with colons ("::") is allowed.
The known limitations and problems with these applications are listed below. If you happen to have a solution for these issues, please let us know.
IPv6 transport support is experimental. The
dnscache and tinydns daemons
are bound to IPv4-mapped IPv6 addresses, e.g.
::ffff:192.168.1.254
Description | USAGI inetd daemon |
Source | Prepatched source tarball by the USAGI project |
Version | 0.17 + USAGI IPv6 patches |
Package | root.lrp |
Use the keywords tcp6 and
udp6 in /etc/inetd.conf
to let
inetd listen on IPv6 sockets. For example, if you want to weblet to be
accessible via IPv6 you should configure
/etc/inetd.conf
as follows:
(...) www stream tcp6 nowait sh-httpd /usr/sbin/tcpd /usr/sbin/sh-httpd (...)
The known limitations and problems with this application are listed below. If you happen to have a solution for these issues, please let us know.
It is not possible to let inetd listen to the same
portnumber for IPv4 and IPv6 sockets. Tests with the
tcp46 keyword have failed. Also putting two
configuration lines in /etc/inetd.conf
, one
with the tcp(4) and one with the
tcp6 keyword, has not given the desired
result.
Description | PPP daemon |
Source | www.samba.org/ppp/ |
Version | 2.4.1 |
Package | ppp.lrp |
Description | SNMP daemon from Net-SNMP |
Source | www.net-snmp.org |
Version | 5.0.8 |
Package | netsnmpd.lrp |
This section only describes how to use the IPv6 features of netsnmpd. For general configuration issues refer to the documentation on the net-snmp site.
Default snmpd listens only to IPv4 sockets. Extra parameters can
be used on startup of the daemon to make it listen to both IPv4 and
IPv6 sockets. One of the current shortcommings is that the IPv4 and
IPv6 port numbers on which the daemon listens may not be the same. For
example to let snmpd listen on port 161 for IPv4 and on port 6161 for
IPv6 edit /etc/init.d/snmpd
as follows.
(...) # Set cli options here OPTIONS="udp:161,udp6:6161" OPTIONS=${OPTIONS:+-- $OPTIONS} (...)
Restart the daemon with the command /etc/init.d/snmpd restart. You can check if the snmpd daemon is really listening to both sockets with the following command:
# netstat -na Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State (...) udp 0 0 0.0.0.0:161 0.0.0.0:* udp 0 0 :::6161 :::* (...)
The known limitations and problems with this application are listed below. If you happen to have a solution for these issues, please let us know.
You can get the daemon to listen to IPv4 sockets as well as IPv6 sockets, but not on the same UDP ports.
Not the full IPv6 MIB can be retrieved via commands like snmpwalk, only the following object instances are returned:
.iso.3.6.1.2.1.55.1.1.0 = 1 .iso.3.6.1.2.1.55.1.2.0 = 64 .iso.3.6.1.2.1.55.1.3.0 = Gauge32: 3 .iso.3.6.1.2.1.55.1.5.1.2.1 = "lo" .iso.3.6.1.2.1.55.1.5.1.2.3 = "eth0" .iso.3.6.1.2.1.55.1.5.1.2.4 = "eth1" .iso.3.6.1.2.1.55.1.5.1.3.1 = OID: .ccitt.0 .iso.3.6.1.2.1.55.1.5.1.3.3 = OID: .ccitt.0 .iso.3.6.1.2.1.55.1.5.1.3.4 = OID: .ccitt.0 .iso.3.6.1.2.1.55.1.5.1.4.1 = Gauge32: 16436 .iso.3.6.1.2.1.55.1.5.1.4.3 = Gauge32: 1500 .iso.3.6.1.2.1.55.1.5.1.4.4 = Gauge32: 1500 .iso.3.6.1.2.1.55.1.5.1.8.1 = "" .iso.3.6.1.2.1.55.1.5.1.8.3 = Hex: 00 40 95 1A 14 F4 .iso.3.6.1.2.1.55.1.5.1.8.4 = Hex: 00 40 95 1A 14 70 .iso.3.6.1.2.1.55.1.5.1.9.1 = 1 .iso.3.6.1.2.1.55.1.5.1.9.3 = 1 .iso.3.6.1.2.1.55.1.5.1.9.4 = 1 .iso.3.6.1.2.1.55.1.5.1.10.1 = 1 .iso.3.6.1.2.1.55.1.5.1.10.3 = 1 .iso.3.6.1.2.1.55.1.5.1.10.4 = 1
Description | Secure shell daemon |
Source | www.openssh.org |
Version | 3.7.1p1 |
Packages | sshd.lrp ,
libm.lrp ,
libcrpto.lrp |
This section only describes how to use the IPv6 features of sshd. For general configuration issues refer to the documentation on the OpenSSH site.
Sshd is compiled with TCP-wrappers support. Thus means that the
hosts.allow
and hosts.deny
files are used for acces control purposes. If you want to access the
ssh daemon with an IPv6 enabled client such as PuTTY, then you need to
specifiy the IPv6 address for the single client or the prefix for more
clients in the same subnet.
The following is an example how to modify
/etc/hosts.allow
to allow all clients with a
site-local address:
(...) ALL: [fec0::/64] (...)