head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.54 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.52 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.50 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.48 pkgsrc-2011Q2-base:1.5 pkgsrc-2009Q4:1.5.0.46 pkgsrc-2009Q4-base:1.5 pkgsrc-2008Q4:1.5.0.44 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.42 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.40 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.38 pkgsrc-2008Q2-base:1.5 pkgsrc-2008Q1:1.5.0.36 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.34 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.32 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.30 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.28 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.5.0.26 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.24 pkgsrc-2006Q3-base:1.5 pkgsrc-2006Q2:1.5.0.22 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.5.0.20 pkgsrc-2006Q1-base:1.5 pkgsrc-2005Q4:1.5.0.18 pkgsrc-2005Q4-base:1.5 pkgsrc-2005Q3:1.5.0.16 pkgsrc-2005Q3-base:1.5 pkgsrc-2005Q2:1.5.0.14 pkgsrc-2005Q2-base:1.5 pkgsrc-2005Q1:1.5.0.12 pkgsrc-2005Q1-base:1.5 pkgsrc-2004Q4:1.5.0.10 pkgsrc-2004Q4-base:1.5 pkgsrc-2004Q3:1.5.0.8 pkgsrc-2004Q3-base:1.5 pkgsrc-2004Q2:1.5.0.6 pkgsrc-2004Q2-base:1.5 pkgsrc-2004Q1:1.5.0.4 pkgsrc-2004Q1-base:1.5 pkgsrc-2003Q4:1.5.0.2 pkgsrc-2003Q4-base:1.5 netbsd-1-6-1:1.4.0.2 netbsd-1-6-1-base:1.4 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.3 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.5 date 2003.08.23.13.32.28; author hubertf; state dead; branches; next 1.4; 1.4 date 2002.09.19.22.15.26; author hubertf; state Exp; branches; next 1.3; 1.3 date 2001.02.19.02.23.48; author hubertf; state Exp; branches; next 1.2; 1.2 date 2001.02.18.15.32.18; author hubertf; state Exp; branches; next 1.1; 1.1 date 2001.02.11.05.24.29; author hubertf; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.02.11.05.24.29; author hubertf; state Exp; branches; next ; desc @@ 1.5 log @Replaced by hf6to4, written in /bin/sh ---------------------------------------------------------- @ text @ July 3, 2002 6TO4 8

NAME

6to4 - setup automatic 6to4 IPv6 tunnelling

SYNOPSIS

6to4 [-vn] command

DESCRIPTION

The 6to4 script can be used to setup IPv6 on your home machine and network for exploring IPv6 without any registrations. 6to4 is a mechanism by which your IPv6 address(es) are derived from an assigned IPv4 address, and which involves automatic tunnelling to one or more remove 6to4 hubs, which will then forward your v6 packets on the 6bone etc. Replies are routed back to you over IPv4 via (possibly) other 6to4 capable remote gateways. As such, IPv6-in-IPv4-encapsulated packets are accepted from all v4-hosts.

From your (single) IPv4 address, you get a whole IPv6 /48 network, which allows you to split your network in 2^16 subnets, with 2^64 hosts each. You need to setup routing for your internal network properly, help is provided for setting up the border router here.

This script takes the burden to calculate your IPv6 address from existing IPv4 address and runs the commands to setup (and tear down) automatic 6to4 IPv6 tunnelling. In a seperate step, router advertisement for the inside network can be started and stopped.

Possible options are:

-n
Do not. Only print the commands that would be run, but do not execute them.

-v
Verbose operation. Print the commands that are about to be run, before running them. Displays some additional information.

-h
Show usage.

Possible commands are:

start
Configure 6to4 IPv6. The stf(4) interface is configured, and a default route to a remote 6to4 gateway is established. In addition, the internal network interface is assigned an address.

stop
Stops 6to4 IPv6. All addresses are removed from the stf(4) device, and the default route is removed.

rtadvd-start
Starts router advertizement and IPv6 packet forwarding, turning the machine into a IPv6 router. rtadvd(8) is invoked with a custom config file created under /var/run. Clients just need to be told to accept router advertizements, i.e. the `net.inet6.ip6.accept_rtadv' sysctl needs to be set to `1'. You can arrange that by setting ``ip6mode=autohost'' in /etc/rc.conf.

rtadvd-stop
Stops router advertizement and IPv6 packet forwarding. rtadvd(8) is stopped, and the rtadvd.conf(5) config file is removed from /var/run.

REQUIREMENTS

Besides IPv4 connectivity, you need support for IPv6 and the stf(4) device in your kernel. While the GENERIC NetBSD 1.5 kernel does support IPv6, it does not contain support for the stf(4) device.

Make sure you have the following options in your kernel config file:

options         INET          # IP + ICMP + TCP + UDP
options         INET6           # IPV6
pseudo-device  stf  1    # 6to4 IPv6 over IPv4 encapsulation

In systems that run past-1.5 NetBSD-current, you will have to explicitly create an stf(4) device after compiling it in the kernel. You do this by running the following command before calling the 6to4 script:

ifconfig stf0 create

No special values are needed in /etc/rc.conf to run this script, but see comment on setting up IPv6-clients `behind' your 6to4 router for the rtadvd-start command!

CONFIGURATION

The 6to4 script reads its configuration from a config file named 6to4.conf. The 6to4.conf file is in perl(1) syntax, and contains several variables that can be tuned to adjust your setup. Default values should work for use on a modem dialup.

out_if
The outbound interface that has a valid IPv4 address assigned, that can be used to derive the IPv6 addresses from. Usually ``ppp0'' for a modem setup, or your ethernet interface if you have IPv4 connectivity via LAN. This can't be empty, and is assigned the IPv6 address 2002:x:x:v6_net:hostbits6, see below.

in_if
The inside interface. If non-empty, this interface is assigned the IPv6 address 2002:x:x:v6_innernet:hostbits6, see below. This is only useful on machines that have more than one network interfaces, e.g. with a modem and a local ethernet.

v6_net
The subnet address you want to use on the address of your outbound interface. Defaults to ``1''.

v6_innernet
The subnet address you want to use on the address of your inbound interface. Defaults to ``2''.

hostbits6
The lower 64 bits of both the inbound and outbound interface's addresses.

peer
Name of the remote 6to4 server that'll take our IPv6-in-IPv4 encapsulated packets and route them on via IPv6. A special value of ``6to4-anycast'' can be used for the anycast service defined in RFC 3068. Other possible values are given in the example config file.

remoteadr4, remoteadr6
If the peer variable is set to the relay router's name, DNS lookups for A and AAAA records will be made to determine it's IPv4 and IPv6 address. To avoid these lookups, the variables remoteadr4 and remoteadr6 can be set to strings containing the numerical IPv4 and IPv6 numbers directly.

EXAMPLES

The 6to4 script can be run automatically by pppd(8) when a connection is made. For this, put the following into /etc/ppp/ip-up:
( /usr/pkg/sbin/6to4 stop
  /usr/pkg/sbin/6to4 start ) &

To shut down properly, put this into /etc/ppp/ip-down:

/usr/pkg/sbin/6to4 stop

SEE ALSO

stf(4), ``6to4 IPv6 Explained'' at http://www.feyrer.de/NetBSD/6to4.html, NetBSD IPv6 Documentation at http://www.netbsd.org/Documentation/network/ipv6/, RFC 3068.

HISTORY

The 6to4 utility and manpage were written by Hubert Feyrer .

BUGS

On systems running past-1.5 NetBSD-current, the ``ifconfig stf0 create'' should be run automatically. @ 1.4 log @Update 6to4 to 1.3. Change: - adapt for NetBSD 1.6 and later which needs an "ifconfig stf0 create" (also needed on FreeBSD). Patch contributed by Kimura Fuyuki in private mail. @ text @@ 1.3 log @Fix typo, reported by Tomasz Luchowski in private mail. @ text @d4 1 a4 1 February 18, 2001 6to4 8 d10 5 a14 5 H1 { color: maroon; padding: 4pt; margin-left: -4% } H2 { color: maroon; padding: 4pt; margin-left: -4% } H3 { color: maroon; padding: 4pt; margin-left: -4% } H4 { color: maroon; padding: 4pt; margin-left: -4% } H5 { color: maroon; padding: 4pt; margin-left: -4% } d28 1 a28 1 [-vn] d56 1 a56 1

-n
d59 1 a59 1

-v
d62 1 a62 1

-h
d70 1 a70 1 stf(4) d76 1 a76 1 stf(4) d81 1 a81 1 rtadvd(8) d95 1 a95 1 rtadvd(8) d97 1 a97 1 rtadvd.conf(5) d105 5 a109 4 stf(4) device in your kernel. While the GENERIC NetBSD 1.5 kernel does support IPv6, it does not contain support for the stf(4) d123 4 a126 3 In systems that run past-1.5 NetBSD-current, you will have to explicitly create an stf(4) d151 2 a152 2 script reads it's configuration from a config file named 6to4.conf. d156 1 a156 1 perl(1) d191 15 a205 2 via IPv6. Several possible values are given in the example config file. d208 1 a208 1 EXAMPLE USAGE d213 1 a213 1 pppd(8) d237 1 a237 1 stf(4), d241 4 a244 2 NetBSD IPv6 Documentation at http://www.netbsd.org/Documentation/network/ipv6/. d255 3 a257 1 On systems running past-1.5 NetBSD-current, the d260 5 @ 1.2 log @Update to 6to4-1.1: * Don't create extra (tmp) rtadvd.conf, assume /etc/rtadvd.conf has no interface specs, and just that. * Don't suggest clients set an explicit (static) default route. This will happen automatically. * Update manpage and html page Thanks to Itojun and some others for their inputs! @ text @d233 1 a233 1 utility and manpage were writte by @ 1.1 log @Initial revision @ text @d4 1 a4 1 February 11, 2001 6to4 8 d84 9 a92 3 Clients need to be told to use the router as default (IPv6) router, e.g. by adding a static route. Follow the on-screen instructions to do so. d122 15 d138 6 a143 1 /etc/rc.conf. d235 6 a240 2 @ 1.1.1.1 log @Add 6to4-1.0, a script to setup automatic 6to4 IPv6 tunneling. For easy IPv6 connectivity, do: * make install * cd /usr/pkg/etc * cp 6to4.conf-example 6to4.conf * in 6to4.conf, change "out_if" to match your outgoing interface: ppp0 if you're on a modem, else your ethernet card's interface. * 6to4 -v start * ping6 www.kame.net @ text @@