Subject: Re: pf (Package Filter pflkm) without IPV6
To: None <netbsd-users@NetBSD.org>
From: Matthias Scheler <tron@zhadum.de>
List: netbsd-users
Date: 06/28/2005 15:12:57
On Tue, Jun 28, 2005 at 02:35:44PM +0200, Geert Hendrickx wrote:
> > So if anybody has question about configuring IPv6 on NetBSD I'm more than
> > happy to answer them.
> 
> Could you point us to a HOWTO for managing an IPv6 network with a router
> connected to an IPv4 ISP?  I'm interested but I don't know where to start.  

The basic documentation is on the NetBSD web site:

	http://www.uk.netbsd.org/Documentation/network/ipv6/

Here's a bit of code for "/etc/ppp/ip-up" which you can use to automatically
create a 6to4 tunnel over a PPP or PPPoE connection:

	IPV6_ADDR=`echo $4 | awk -F. '{printf("2002:%02x%02x:%02x%02x::1\n",$1,$2,$3,$4)}'`
	ifconfig stf0 create inet6 ${IPV6_ADDR} prefixlen 16 up
	route add -inet6 default 2002:c058:6301::

[You can try this out manually by replacing $4 with your *public*
 IPv4 address.]

And here is the cleanup part for "/etc/ppp/ip-up":

	route delete -inet6 default 2002:c058:6301::
	ifconfig stf0 destroy

Attention:
NetBSD older and including 2.0.2 has a kernel bug which cause a panic if you
use "ifconfig ... destroy" like in the above example. The bug is fixed in the
NetBSD 2.0.2_STABLE/2.0_STABLE and newer.

The above example should already be good enough to reach e.g.
"ftp.netbsd.org" via IPv6. You can e.g. try "traceroute6 ftp.netbsd.org".
If you want to make that setup permanet you should also create a
"ipf6.conf" on your firewall protecting the "stf0" interface. Documentation
on how to provide IPv6 to the system on your LAN can be found under the
above URL.

	Kind regards

-- 
Matthias Scheler                                  http://scheler.de/~matthias/