summaryrefslogtreecommitdiff
path: root/net/hf6to4
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>2003-08-23 13:30:35 +0000
committerhubertf <hubertf@pkgsrc.org>2003-08-23 13:30:35 +0000
commit537498b15a27b3e34c830151a319d778584199cc (patch)
tree9ac78f4801c0978ad8c11f2f93d8e0cb3452fc2b /net/hf6to4
parent4c6e4da28c39f152b68ce69f4076b89d34d42470 (diff)
downloadpkgsrc-537498b15a27b3e34c830151a319d778584199cc.tar.gz
Add hf6to4 1.0.
The hf6to4 script can be used to setup IPv6 on your home machine and net- work 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 remote 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. XXX this is a rewrite of 6to4 in /bin/sh, no more perl required.
Diffstat (limited to 'net/hf6to4')
-rw-r--r--net/hf6to4/DESCR8
-rw-r--r--net/hf6to4/MESSAGE11
-rw-r--r--net/hf6to4/Makefile33
-rw-r--r--net/hf6to4/PLIST6
-rw-r--r--net/hf6to4/files/Makefile2
-rwxr-xr-xnet/hf6to4/files/hf6to4214
-rw-r--r--net/hf6to4/files/hf6to4.8208
-rw-r--r--net/hf6to4/files/hf6to4.conf35
-rw-r--r--net/hf6to4/files/hf6to4.html264
9 files changed, 781 insertions, 0 deletions
diff --git a/net/hf6to4/DESCR b/net/hf6to4/DESCR
new file mode 100644
index 00000000000..8fd0fdd07b8
--- /dev/null
+++ b/net/hf6to4/DESCR
@@ -0,0 +1,8 @@
+The hf6to4 script can be used to setup IPv6 on your home machine and net-
+work 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 remote 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.
diff --git a/net/hf6to4/MESSAGE b/net/hf6to4/MESSAGE
new file mode 100644
index 00000000000..5d9d52d6c1e
--- /dev/null
+++ b/net/hf6to4/MESSAGE
@@ -0,0 +1,11 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1.1.1 2003/08/23 13:30:35 hubertf Exp $
+
+To configure a 6to4 tunnel, modify the configuration file
+${PKG_SYSCONFDIR}/hf6to4.conf for your system, then run
+
+ ${RCD_SCRIPTS_DIR}/hf6to4 -v start
+
+You should then be able to ping6 www.kame.net.
+
+===========================================================================
diff --git a/net/hf6to4/Makefile b/net/hf6to4/Makefile
new file mode 100644
index 00000000000..44819f199f7
--- /dev/null
+++ b/net/hf6to4/Makefile
@@ -0,0 +1,33 @@
+# $NetBSD: Makefile,v 1.1.1.1 2003/08/23 13:30:35 hubertf Exp $
+#
+
+DISTNAME= hf6to4-1.0
+WRKSRC= ${WRKDIR}
+CATEGORIES= net
+MASTER_SITES= # empty
+DISTFILES= # empty
+
+MAINTAINER= hubertf@NetBSD.org
+HOMEPAGE= http://www.NetBSD.org/packages/net/hf6to4/files/hf6to4.html
+COMMENT= Enables 6to4 IPv6 automatic tunnels
+
+USE_PKGINSTALL= YES
+
+# This pkg doesn't regard USE_INET6 (leave this comment for README-IPv6.html!)
+EXTRACT_ONLY= # empty
+NO_CHECKSUM= yes
+NO_CONFIGURE= yes
+
+CONF_FILES+= ${PREFIX}/share/examples/hf6to4/hf6to4.conf ${PKG_SYSCONFDIR}/hf6to4.conf
+
+do-build:
+ @${SED} ${FILES_SUBST_SED} ${FILESDIR}/hf6to4 > ${WRKSRC}/hf6to4
+
+do-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/hf6to4
+ ${INSTALL_SCRIPT} ${WRKSRC}/hf6to4 ${PREFIX}/sbin/hf6to4
+ ${INSTALL_MAN} ${FILESDIR}/hf6to4.8 ${PREFIX}/man/man8
+ ${INSTALL_DATA} ${FILESDIR}/hf6to4.html ${PREFIX}/share/doc/hf6to4.html
+ ${INSTALL_DATA} ${FILESDIR}/hf6to4.conf ${PREFIX}/share/examples/hf6to4
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/hf6to4/PLIST b/net/hf6to4/PLIST
new file mode 100644
index 00000000000..531a6e52ba2
--- /dev/null
+++ b/net/hf6to4/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2003/08/23 13:30:35 hubertf Exp $
+sbin/hf6to4
+share/doc/hf6to4.html
+share/examples/hf6to4/hf6to4.conf
+man/man8/hf6to4.8
+@dirrm share/examples/hf6to4
diff --git a/net/hf6to4/files/Makefile b/net/hf6to4/files/Makefile
new file mode 100644
index 00000000000..9f4ae64c417
--- /dev/null
+++ b/net/hf6to4/files/Makefile
@@ -0,0 +1,2 @@
+hf6to4.html: hf6to4.8
+ nroff -mdoc2html hf6to4.8 > hf6to4.html
diff --git a/net/hf6to4/files/hf6to4 b/net/hf6to4/files/hf6to4
new file mode 100755
index 00000000000..de79d05f99f
--- /dev/null
+++ b/net/hf6to4/files/hf6to4
@@ -0,0 +1,214 @@
+#!/bin/sh
+#
+# hf6to4 - Setup 6to4 IPv6, for NetBSD (and maybe others)
+#
+# (c) Copyright 2000, 2003 Hubert Feyrer <hubert@feyrer.de>
+#
+
+etcdir="/usr/pkg/etc";
+
+not=false
+verbose=false
+
+f=$etcdir/hf6to4.conf
+if [ -f "$f" ]
+then
+ . $f
+else
+ echo "$0: config file $f missing."
+ exit 1
+fi
+
+###########################################################################
+run()
+{
+ if $not
+ then
+ echo "$@"
+ else
+ if $verbose
+ then
+ echo "$@"
+ fi
+ "$@"
+ fi
+}
+
+###########################################################################
+usage()
+{
+ echo "Usage: $0 [-n] [-v] {start | stop | rtadvd-start | rtadvd-stop}";
+}
+
+###########################################################################
+### M A I N
+###########################################################################
+#
+# Process options
+#
+args=`getopt nvh $*`
+if [ $? != 0 ]
+then
+ usage
+ exit 1
+fi
+
+set -- $args
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ -n)
+ not=true
+ ;;
+ -v)
+ verbose=true
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -h)
+ usage
+ exit 0
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+
+# maybe ifconfig stf0 create?
+
+
+#
+# Some sanity checks
+#
+if [ `ifconfig -a | grep fe80: | wc -l` -le 0 -o \
+ `ifconfig -a | grep stf | wc -l` -le 0 ]; then
+ echo "$0: It seems your kernel does not support IPv6 or 6to4 (stf)."
+ echo "Add 'options INET6' and 'pseudo-device stf 1' to your kernel and retry!";
+ exit 1
+fi
+
+
+#
+# Figure out IP#s etc.
+#
+localadr4=`ifconfig $out_if inet \
+ | grep inet \
+ | sed 's/^.*inet *//' \
+ | sed 's/ .*$//'`
+
+l4c=`echo $localadr4 | sed 's,\., ,g'`
+prefix=`printf "2002:%02x%02x:%02x%02x" $l4c`
+
+localadr6=`printf "$prefix:%04x" $v6_net`
+
+
+if [ "$peer" = "6to4-anycast" ]
+then
+ # magic values from rfc 3068
+ remoteadr4="192.88.99.1"
+ remoteadr6="2002:c058:6301::"
+else
+ if [ `expr "$remoteadr4" : "^[0-9.]*$"` -gt 0 ]
+ then
+ $verbose && \
+ echo "IPv4 address of peer given numerically, no resolving needed"
+ else
+ # Hostname, needs resolving
+
+ remoteadr4=`host $peer | sed 's/^.*address //'`
+
+ $verbose && \
+ echo "resolving IPv4 address of peer $peer as $remoteadr4"
+ fi
+
+ if [ `expr "$remoteadr6" : "^[0-9a-fA-Z:]*$"` -gt 0 ]
+ then
+ $verbose && \
+ echo "IPv6 address of peer given numerically, no resolving needed"
+ else
+ remoteadr6=`host -t AAAA $peer | sed 's/^.*address //'`
+
+ $verbose && \
+ echo "resolving IPv6 address of peer $peer as $remoteadr6"
+ fi
+fi
+
+
+if $verbose
+then
+ echo "remote v4 address: $remoteadr4"
+ echo "local v4 address: $localadr4"
+ echo "remote v6 address: $remoteadr6"
+ echo "local v6 address: $localadr6:$hostbits6"
+ echo ""
+fi
+
+
+#
+# Handle commands
+#
+
+# stop:
+if [ "$1" = "stop" ]
+then
+ run ifconfig stf0 down
+
+ # remove all v6 addresses from stf interface:
+ adrs=`ifconfig stf0 inet6 \
+ | grep inet6 \
+ | sed -e 's/inet6//' \
+ -e 's/prefix.*//g' \
+ -e 's/^[ ]*//' \
+ -e 's/[ ]*\$//'`
+ for adr in $adrs
+ do
+ run ifconfig stf0 inet6 -alias $adr
+ done
+
+ # remove default route:
+ run route delete -inet6 default
+fi
+
+
+# start:
+if [ "$1" = "start" ]
+then
+ run ifconfig stf0 inet6 $localadr6:$hostbits6 prefixlen $v6_prefixlen alias
+ run route add -inet6 default $remoteadr6
+ if [ "$in_if" != "" ]
+ then
+ run ifconfig $in_if inet6 $prefix:$v6_innernet:$hostbits6
+ fi
+fi
+
+# rtadvd-stop:
+if [ "$1" = "rtadvd-stop" -o "$1" = "stop-rtadvd" ]
+then
+ if [ -f "/var/run/rtadvd.pid" ]
+ then
+ pid=`cat /var/run/rtadvd.pid`
+ run kill -TERM $pid
+ run rm -f /var/run/rtadvd.pid
+ else
+ echo $0: no rtadvd running!
+ fi
+fi
+
+# rtadvd-start:
+if [ "$1" = "rtadvd-start" -o "$1" = "start-rtadvd" ]
+then
+ if [ -f "/var/run/rtadvd.pid" ]
+ then
+ echo $0: rtadvd already running!
+ else
+ run sysctl -w net.inet6.ip6.forwarding=1
+ run sysctl -w net.inet6.ip6.accept_rtadv=0
+ run rtadvd $in_if
+ fi
+fi
diff --git a/net/hf6to4/files/hf6to4.8 b/net/hf6to4/files/hf6to4.8
new file mode 100644
index 00000000000..2d1f02381e3
--- /dev/null
+++ b/net/hf6to4/files/hf6to4.8
@@ -0,0 +1,208 @@
+.\" $NetBSD: hf6to4.8,v 1.1.1.1 2003/08/23 13:30:35 hubertf Exp $
+.Dd August 23, 2003
+.Dt hf6to4 8
+.Os
+.Sh NAME
+.Nm hf6to4
+.Nd setup automatic 6to4 IPv6 tunnelling
+.Sh SYNOPSIS
+.Nm
+.Op Fl vn
+.Ar command
+.Sh DESCRIPTION
+The
+.Nm
+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 relay routers, which will then forward your v6 packets on the 6bone.
+Replies are routed back to you over IPv4 via (possibly) other
+6to4 relay routers. As such, IPv6-in-IPv4-encapsulated
+packets are accepted from all v4-hosts. See
+.Xr stf 4
+for security discussion.
+.Pp
+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.
+.Pp
+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.
+.Pp
+Possible options are:
+.Bl -tag -width xxx
+.It Fl n
+Do not. Only print the commands that would be run, but do not execute
+them.
+.It Fl v
+Verbose operation. Print the commands that are about to be run, before
+running them. Displays some additional information.
+.It Fl h
+Show usage.
+.El
+.Pp
+Possible commands are:
+.Bl -tag -width rtadvd-start
+.It Sy start
+Configure 6to4 IPv6. The
+.Xr 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.
+.It Sy stop
+Stops 6to4 IPv6. All addresses are removed from the
+.Xr stf 4
+device, and the default route is removed.
+.It Sy rtadvd-start
+Starts router advertizement and IPv6 packet forwarding,
+turning the machine into a IPv6 router.
+Clients just need to be told to accept router advertizements, i.e.
+the
+.Sq net.inet6.ip6.accept_rtadv
+sysctl needs to be set to
+.Sq 1 .
+On NetBSD, you can arrange that by setting
+.Dq ip6mode=autohost
+in
+.Pa /etc/rc.conf .
+.It Sy rtadvd-stop
+Stops router advertizement and IPv6 packet forwarding.
+.Xr rtadvd 8
+is stopped.
+.El
+.Sh REQUIREMENTS
+Besides IPv4 connectivity, you need support for IPv6 and the
+.Xr stf 4
+device in your kernel. While the GENERIC
+.Nx
+1.5 kernel does support IPv6, it does not contain support for the
+.Xr stf 4
+device.
+.Pp
+Make sure you have the following options in your kernel config file:
+.Bd -literal -offset
+options INET # IP + ICMP + TCP + UDP
+options INET6 # IPV6
+pseudo-device stf 1 # 6to4 IPv6 over IPv4 encapsulation
+.Ed
+.Pp
+In systems that run past-1.5,
+you will have to explicitly create an
+.Xr stf 4
+device after compiling it in the kernel. You do this by running
+the following command before calling the
+.Nm
+script:
+.Bd -literal -offset
+ifconfig stf0 create
+.Ed
+As an alternative, you can also put the following lines into
+.Pa /etc/rc.conf :
+.Bd -literal -offset
+net_interfaces="stf0"
+ifconfig_stf0="create"
+.Ed
+.Pp
+See also the comment on setting up IPv6-clients
+.Sq behind
+your 6to4 router for the
+.Sy rtadvd-start
+command!
+.Sh CONFIGURATION
+The
+.Nm
+script reads its configuration from a config file named
+.Pa hf6to4.conf .
+The
+.Pa hf6to4.conf
+file is in
+.Xr sh 1
+syntax, and contains several
+variables that can be tuned to adjust your setup. Default values
+should work for use on a modem/DSL dialup.
+.Bl -tag -width rtadvd-stop
+.It Sy out_if
+The outbound interface that has a valid IPv4 address
+assigned, that can be used to derive the IPv6
+addresses from. Usually
+.Dq 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.
+.It Sy 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.
+.It Sy v6_net
+The subnet address you want to use on the address of
+your outbound interface. Defaults to
+.Dq 1 .
+.It Sy v6_innernet
+The subnet address you want to use on the address of
+your inbound interface. Defaults to
+.Dq 2 .
+.It Sy hostbits6
+The lower 64 bits of both the inbound and outbound interface's
+addresses.
+.It Sy 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
+.Dq 6to4-anycast
+can be used for the anycast service defined in RFC 3068.
+Other possible values are given in the example config file.
+.It Sy remoteadr4, remoteadr6
+If the
+.Sy peer
+variable is set to the relay router's name, DNS lookups for A and AAAA
+records will be made to
+determine its IPv4 and IPv6 address. To avoid these lookups, the variables
+.Sy remoteadr4
+and
+.Sy remoteadr6
+can be set to strings containing the numerical IPv4 and IPv6 numbers
+directly.
+.El
+.Sh EXAMPLES
+The
+.Nm
+script can be run automatically by
+.Xr pppd 8
+when a connection is made. For this, put the following into
+.Pa /etc/ppp/ip-up :
+.Bd -literal -offset
+( /usr/pkg/sbin/hf6to4 stop
+ /usr/pkg/sbin/hf6to4 start ) &
+.Ed
+.Pp
+To shut down properly, put this into
+.Pa /etc/ppp/ip-down :
+.Bd -literal -offset
+/usr/pkg/sbin/hf6to4 stop
+.Ed
+.Sh SEE ALSO
+.Xr stf 4 ,
+.Dq 6to4 IPv6 Explained
+at
+.Pa http://www.feyrer.de/NetBSD/6to4.html ,
+.Nx
+IPv6 Documentation at
+.Pa http://www.netbsd.org/Documentation/network/ipv6/ ,
+RFC 3068.
+.Sh HISTORY
+The
+.Nm
+utility and manpage were written by
+Hubert Feyrer <hubert@feyrer.de>.
+.Sh BUGS
+On systems running past-1.5, the
+.Dq ifconfig stf0 create
+should be run automatically.
diff --git a/net/hf6to4/files/hf6to4.conf b/net/hf6to4/files/hf6to4.conf
new file mode 100644
index 00000000000..70cc7fbd1eb
--- /dev/null
+++ b/net/hf6to4/files/hf6to4.conf
@@ -0,0 +1,35 @@
+# hf6to4.conf
+#
+
+out_if="ppp0" # Our outgoing (uplink) interface
+in_if="rtk0" # Inside (ethernet) interface
+
+v6_net="1" # 2002:x:x:v6_net::
+v6_innernet="2" # 2002:x:x:v6_innernet::
+v6_prefixlen=16 # Change for more
+hostbits6=":1" # should be determined via MAC of $in_if
+
+###########################################################################
+#
+# Selection of 6to4 relay router. If "peer" is not set,
+# "remoteadr4" and "remoteadr6" must be set!
+#
+
+# Some possible remote 6to4 routers; DNS lookups will be used
+# to determine their IPv4 and IPv6 adresses (see below on how
+# to avoid these lookups):
+#peer="6to4.ipv6.fh-regensburg.de" # Germany, Europe
+#peer="6to4-anycast" # use RFC 3068 magic values
+#peer="asterix.ipv6.bt.com" # Great Britain, Europe
+#$peer="6to4.kfu.com" # USA, West coast
+#peer="6to4.ipv6.microsoft.com" # USA, West coast
+#peer="ipv6-router.cisco.com" # USA, West coast; register at http://www.cisco.com/ipv6/
+
+#
+# To prevent DNS lookups of peer, directly specify IPv4 and IPv6 address
+# of 6to4 relay router:
+#
+
+# 6to4.ipv6.fh-regensburg.de - Germany, Europe:
+remoteadr4="194.95.108.191"
+remoteadr6="2002:c25f:6cbf:1::1"
diff --git a/net/hf6to4/files/hf6to4.html b/net/hf6to4/files/hf6to4.html
new file mode 100644
index 00000000000..bfba491a6fa
--- /dev/null
+++ b/net/hf6to4/files/hf6to4.html
@@ -0,0 +1,264 @@
+<html>
+<head>
+ <title>
+ August 23, 2003 hf6to4 8
+
+ </title>
+ <style type="text/css">
+ <!--
+ body { margin-left:4%; }
+ H1, H2, H3, H4, H5 {
+ color: maroon; padding: 4pt; margin-left: -4%;
+ border: solid; border-width: thin; width: 100%;
+ background: rgb(204,204,255)
+ }
+ -->
+ </style>
+</head>
+<body bgcolor="#FFFFFF" text="#000000">
+ <h3>
+ NAME
+ </h3>
+<b>hf6to4</b>
+- setup automatic 6to4 IPv6 tunnelling
+ <h3>
+ SYNOPSIS
+ </h3>
+<b>hf6to4</b>
+[<b>-</b><b></b><b>vn</b>]
+<i></i><i>command</i>
+ <h3>
+ DESCRIPTION
+ </h3>
+The
+<b>hf6to4</b>
+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 relay routers, which will then forward your v6 packets on the 6bone.
+Replies are routed back to you over IPv4 via (possibly) other
+6to4 relay routers. As such, IPv6-in-IPv4-encapsulated
+packets are accepted from all v4-hosts. See
+<a href="../html4/stf.html">stf(4)</a>
+for security discussion.
+ <p>
+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.
+ <p>
+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.
+ <p>
+Possible options are:
+<dl compact>
+<p><dt><b>-</b><b></b><b>n</b><dd>
+Do not. Only print the commands that would be run, but do not execute
+them.
+<p><dt><b>-</b><b></b><b>v</b><dd>
+Verbose operation. Print the commands that are about to be run, before
+running them. Displays some additional information.
+<p><dt><b>-</b><b></b><b>h</b><dd>
+Show usage.
+</dl>
+ <p>
+Possible commands are:
+<dl compact>
+<p><dt><b></b><b>start</b><dd>
+Configure 6to4 IPv6. The
+<a href="../html4/stf.html">stf(4)</a>
+interface is configured, and a default route to a remote 6to4
+gateway is established. In addition, the internal
+network interface is assigned an address.
+<p><dt><b></b><b>stop</b><dd>
+Stops 6to4 IPv6. All addresses are removed from the
+<a href="../html4/stf.html">stf(4)</a>
+device, and the default route is removed.
+<p><dt><b></b><b>rtadvd-start</b><dd>
+Starts router advertizement and IPv6 packet forwarding,
+turning the machine into a IPv6 router.
+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'.
+On NetBSD, you can arrange that by setting
+``ip6mode=autohost''
+in
+<code></code><code>/etc/rc.conf</code>.
+<p><dt><b></b><b>rtadvd-stop</b><dd>
+Stops router advertizement and IPv6 packet forwarding.
+<a href="../html8/rtadvd.html">rtadvd(8)</a>
+is stopped.
+</dl>
+ <h3>
+ REQUIREMENTS
+ </h3>
+Besides IPv4 connectivity, you need support for IPv6 and the
+<a href="../html4/stf.html">stf(4)</a>
+device in your kernel. While the GENERIC
+NetBSD
+1.5 kernel does support IPv6, it does not contain support for the
+<a href="../html4/stf.html">stf(4)</a>
+device.
+ <p>
+Make sure you have the following options in your kernel config file:
+<dl compact><dt><dd>
+<code>
+<pre>
+options INET # IP + ICMP + TCP + UDP
+options INET6 # IPV6
+pseudo-device stf 1 # 6to4 IPv6 over IPv4 encapsulation
+</pre>
+</code>
+</dl>
+ <p>
+In systems that run past-1.5,
+you will have to explicitly create an
+<a href="../html4/stf.html">stf(4)</a>
+device after compiling it in the kernel. You do this by running
+the following command before calling the
+<b>hf6to4</b>
+script:
+<dl compact><dt><dd>
+<code>
+<pre>
+ifconfig stf0 create
+</pre>
+</code>
+</dl>
+As an alternative, you can also put the following lines into
+<code></code><code>/etc/rc.conf</code>:
+<dl compact><dt><dd>
+<code>
+<pre>
+net_interfaces="stf0"
+ifconfig_stf0="create"
+</pre>
+</code>
+</dl>
+ <p>
+See also the comment on setting up IPv6-clients
+`behind'
+your 6to4 router for the
+<b></b><b>rtadvd-start</b>
+command!
+ <h3>
+ CONFIGURATION
+ </h3>
+The
+<b>hf6to4</b>
+script reads its configuration from a config file named
+<code></code><code>hf6to4.conf</code>.
+The
+<code></code><code>hf6to4.conf</code>
+file is in
+<a href="../html1/sh.html">sh(1)</a>
+syntax, and contains several
+variables that can be tuned to adjust your setup. Default values
+should work for use on a modem/DSL dialup.
+<dl compact>
+<p><dt><b></b><b>out_if</b><dd>
+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.
+<p><dt><b></b><b>in_if</b><dd>
+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.
+<p><dt><b></b><b>v6_net</b><dd>
+The subnet address you want to use on the address of
+your outbound interface. Defaults to
+``1''.
+<p><dt><b></b><b>v6_innernet</b><dd>
+The subnet address you want to use on the address of
+your inbound interface. Defaults to
+``2''.
+<p><dt><b></b><b>hostbits6</b><dd>
+The lower 64 bits of both the inbound and outbound interface's
+addresses.
+<p><dt><b></b><b>peer</b><dd>
+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.
+<p><dt><b></b><b>remoteadr4,</b><b> remoteadr6</b><dd>
+If the
+<b></b><b>peer</b>
+variable is set to the relay router's name, DNS lookups for A and AAAA
+records will be made to
+determine its IPv4 and IPv6 address. To avoid these lookups, the variables
+<b></b><b>remoteadr4</b>
+and
+<b></b><b>remoteadr6</b>
+can be set to strings containing the numerical IPv4 and IPv6 numbers
+directly.
+</dl>
+ <h3>
+ EXAMPLES
+ </h3>
+The
+<b>hf6to4</b>
+script can be run automatically by
+<a href="../html8/pppd.html">pppd(8)</a>
+when a connection is made. For this, put the following into
+<code></code><code>/etc/ppp/ip-up</code>:
+<dl compact><dt><dd>
+<code>
+<pre>
+( /usr/pkg/sbin/hf6to4 stop
+ /usr/pkg/sbin/hf6to4 start ) &
+</pre>
+</code>
+</dl>
+ <p>
+To shut down properly, put this into
+<code></code><code>/etc/ppp/ip-down</code>:
+<dl compact><dt><dd>
+<code>
+<pre>
+/usr/pkg/sbin/hf6to4 stop
+</pre>
+</code>
+</dl>
+ <h3>
+ SEE ALSO
+ </h3>
+<a href="../html4/stf.html">stf(4)</a>,
+``6to4 IPv6 Explained''
+at
+<code></code><code>http://www.feyrer.de/NetBSD/6to4.html</code>,
+NetBSD
+IPv6 Documentation at
+<code></code><code>http://www.netbsd.org/Documentation/network/ipv6/</code>,
+RFC 3068.
+ <h3>
+ HISTORY
+ </h3>
+The
+<b>hf6to4</b>
+utility and manpage were written by
+Hubert Feyrer <hubert@feyrer.de>.
+ <h3>
+ BUGS
+ </h3>
+On systems running past-1.5, the
+``ifconfig stf0 create''
+should be run automatically.
+</font></body>
+</html>
+
+