2003-08-23 15:30:35 +02:00
|
|
|
<html>
|
|
|
|
<head>
|
2005-05-31 00:49:42 +02:00
|
|
|
<title>
|
|
|
|
May 31, 2005 hf6to4 8
|
2003-08-23 15:30:35 +02:00
|
|
|
|
2005-05-31 00:49:42 +02:00
|
|
|
</title>
|
2003-08-23 15:30:35 +02:00
|
|
|
<style type="text/css">
|
|
|
|
<!--
|
2005-05-31 00:49:42 +02:00
|
|
|
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)
|
|
|
|
}
|
2003-08-23 15:30:35 +02:00
|
|
|
-->
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body bgcolor="#FFFFFF" text="#000000">
|
2005-05-31 00:49:42 +02:00
|
|
|
<h3>
|
|
|
|
NAME
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
<b>hf6to4</b>
|
|
|
|
- setup automatic 6to4 IPv6 tunnelling
|
2005-05-31 00:49:42 +02:00
|
|
|
<h3>
|
|
|
|
SYNOPSIS
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
<b>hf6to4</b>
|
|
|
|
[<b>-</b><b></b><b>vn</b>]
|
|
|
|
<i></i><i>command</i>
|
2005-05-31 00:49:42 +02:00
|
|
|
<h3>
|
|
|
|
DESCRIPTION
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
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.
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
2003-08-23 15:30:35 +02:00
|
|
|
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.
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
2003-08-23 15:30:35 +02:00
|
|
|
This script takes the burden to calculate your IPv6 address from
|
|
|
|
existing IPv4 address and runs the commands to setup (and tear down)
|
2004-02-01 00:56:47 +01:00
|
|
|
automatic 6to4 IPv6 tunnelling. In a separate step, router
|
2003-08-23 15:30:35 +02:00
|
|
|
advertisement for the inside network can be started and stopped.
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
2003-08-23 15:30:35 +02:00
|
|
|
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>
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
2003-08-23 15:30:35 +02:00
|
|
|
Possible commands are:
|
|
|
|
<dl compact>
|
|
|
|
<p><dt><b></b><b>start</b><dd>
|
2005-05-31 00:49:42 +02:00
|
|
|
Same as
|
|
|
|
<b></b><b>stf-start</b>.
|
|
|
|
<p><dt><b></b><b>stop</b><dd>
|
|
|
|
Same as
|
|
|
|
<b></b><b>stf-stop</b>.
|
|
|
|
<p><dt><b></b><b>stf-start</b><dd>
|
2003-08-23 15:30:35 +02:00
|
|
|
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.
|
2005-05-31 00:49:42 +02:00
|
|
|
<p><dt><b></b><b>stf-stop</b><dd>
|
2003-08-23 15:30:35 +02:00
|
|
|
Stops 6to4 IPv6. All addresses are removed from the
|
|
|
|
<a href="../html4/stf.html">stf(4)</a>
|
2005-05-31 00:49:42 +02:00
|
|
|
device, and the default route is removed. If
|
|
|
|
<b></b><b>in_if</b>
|
|
|
|
is set, the 6to4 addresses are removed from that interface too.
|
2003-08-23 15:30:35 +02:00
|
|
|
<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>
|
2005-05-31 00:49:42 +02:00
|
|
|
<h3>
|
|
|
|
REQUIREMENTS
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
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.
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
2003-08-23 15:30:35 +02:00
|
|
|
Make sure you have the following options in your kernel config file:
|
|
|
|
<dl compact><dt><dd>
|
|
|
|
<code>
|
|
|
|
<pre>
|
2005-05-31 00:49:42 +02:00
|
|
|
options INET # IP + ICMP + TCP + UDP
|
2003-08-23 15:30:35 +02:00
|
|
|
options INET6 # IPV6
|
2005-05-31 00:49:42 +02:00
|
|
|
pseudo-device stf 1 # 6to4 IPv6 over IPv4 encapsulation
|
2003-08-23 15:30:35 +02:00
|
|
|
</pre>
|
|
|
|
</code>
|
|
|
|
</dl>
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
2003-08-23 15:30:35 +02:00
|
|
|
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>
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
2003-08-23 15:30:35 +02:00
|
|
|
See also the comment on setting up IPv6-clients
|
|
|
|
`behind'
|
|
|
|
your 6to4 router for the
|
|
|
|
<b></b><b>rtadvd-start</b>
|
|
|
|
command!
|
2005-05-31 00:49:42 +02:00
|
|
|
<h3>
|
|
|
|
CONFIGURATION
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
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>
|
2005-05-31 00:49:42 +02:00
|
|
|
<h3>
|
|
|
|
EXAMPLES
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
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>
|
2005-05-31 00:49:42 +02:00
|
|
|
( /usr/pkg/sbin/hf6to4 stf-stop
|
|
|
|
/usr/pkg/sbin/hf6to4 stf-start
|
|
|
|
/usr/pkg/sbin/hf6to4 rtadvd-stop
|
|
|
|
/usr/pkg/sbin/hf6to4 rtadvd-start ) &
|
2003-08-23 15:30:35 +02:00
|
|
|
</pre>
|
|
|
|
</code>
|
|
|
|
</dl>
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
2003-08-23 15:30:35 +02:00
|
|
|
To shut down properly, put this into
|
|
|
|
<code></code><code>/etc/ppp/ip-down</code>:
|
|
|
|
<dl compact><dt><dd>
|
|
|
|
<code>
|
|
|
|
<pre>
|
2005-05-31 00:49:42 +02:00
|
|
|
/usr/pkg/sbin/hf6to4 stf-stop
|
|
|
|
/usr/pkg/sbin/hf6to4 rtadvd-stop
|
2003-08-23 15:30:35 +02:00
|
|
|
</pre>
|
|
|
|
</code>
|
|
|
|
</dl>
|
2005-05-31 00:49:42 +02:00
|
|
|
<h3>
|
|
|
|
SEE ALSO
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
<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
|
2007-10-07 14:59:11 +02:00
|
|
|
<code></code><code>http://www.netbsd.org/docs/network/ipv6/</code>,
|
2003-08-23 15:30:35 +02:00
|
|
|
RFC 3068.
|
2005-05-31 00:49:42 +02:00
|
|
|
<h3>
|
|
|
|
HISTORY
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
The
|
|
|
|
<b>hf6to4</b>
|
|
|
|
utility and manpage were written by
|
|
|
|
Hubert Feyrer <hubert@feyrer.de>.
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
|
|
|
The utility was initially written in perl and called
|
|
|
|
``6to4''
|
|
|
|
but later rewritten as shell script and renamed to a name different
|
|
|
|
than the protocol it configures to emphasize the difference
|
|
|
|
between the protocol (6to4) and the implementation (hf6to4).
|
|
|
|
<p>
|
|
|
|
The older (perl) version is also shipped by Apple with versions
|
|
|
|
10.3 and 10.4 (and probably newer) of their MacOS X operating system.
|
|
|
|
<h3>
|
|
|
|
BUGS
|
|
|
|
</h3>
|
2003-08-23 15:30:35 +02:00
|
|
|
On systems running past-1.5, the
|
|
|
|
``ifconfig stf0 create''
|
|
|
|
should be run automatically.
|
2005-05-31 00:49:42 +02:00
|
|
|
<p>
|
|
|
|
Might be good to use /etc/rc.d/rtadvd for rtadvd handling.
|
2003-08-23 15:30:35 +02:00
|
|
|
</font></body>
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
2005-05-31 00:49:42 +02:00
|
|
|
|
|
|
|
|