ip6config.8   [plain text]


.\"     $NetBSD: 6to4.8,v 1.5 2001/12/03 19:03:21 wiz Exp $
.Dd May 21, 2002
.Dt ip6config 8
.Os
.Sh NAME
.Nm ip6config
.Nd Configure IPv6 and 6to4 IPv6 tunnelling
.Sh SYNOPSIS
.Nm
.Op Fl h
.Ar command interface
.Sh DESCRIPTION
The
.Nm
script can be used to start up or shut down IPv6 on active interfaces. It
can also be used to configure a 6to4 tunnel and start or stop router
advertisement.
.Pp
When IPv6 is enabled on an interface the protocol is attached to the
interface, at which point the default settings in the kernel allow it 
to acquire a link-local address and listen for router advertisements.
.Pp
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.
.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.
.Pp
Finally, router advertisement for an internal network can be started 
and stopped. This uses sysctl to set net.inet6.ip6.forwarding and 
net.inet6.ip6.accept_rtadv to the proper values for routing.
.Pp
Possible options are:
.Bl -tag -width xxx
.It Fl h
Show usage.
.El
.Pp
Possible commands are:
.Bl -tag -width start-rtadvd
.It Sy start-v6
Start IPv6 on given interface using default kernel settings. Attaches
protocol to the interface. If interface is "all", all valid interfaces
will be configured.
.It Sy stop-v6
Stop IPv6 on given interface. Detaches protocol from the interface. If 
interface is "all", all valid interfaces will be configured.
.It Sy start-stf
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-stf
Stops 6to4 IPv6. All addresses are removed from the
.Xr stf 4
device, and the default route is removed.
.It Sy start-rtadvd
Starts router advertizement and IPv6 packet forwarding,
turning the machine into a IPv6 router.
.Xr rtadvd 8
is invoked with a custom config file created under
.Pa /var/run .
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 .
You can arrange that by setting
.Dq ip6mode=autohost
in
.Pa /etc/rc.conf .
.It Sy stop-rtadvd
Stops router advertizement and IPv6 packet forwarding.
.Xr rtadvd 8
is stopped, and the
.Xr rtadvd.conf 5
config file is removed from
.Pa /var/run .
.El
.Sh REQUIREMENTS
Besides IPv4 connectivity, you need support for IPv6 and the
.Xr stf 4
device in your kernel. This is provided beginning with Darwin 
Kernel Version 6.0.
.Pp
No special values are needed in
.Pa /etc/rc.conf
to run this script, but see comment on setting up IPv6-clients
.Sq behind
your 6to4 router for the
.Sy rtadvd-start
command!
.Sh CONFIGURATION
The default IPv6 configuration for an interface assigns a link-local 
address to it and sets the interface to receive router advertisements. 
No further configuration is necessary for basic functionality. 
However, various settings can be modified by using sysctl.
.Pp
The
.Nm
script reads its 6to4 configuration from a config file named
.Pa 6to4.conf .
The
.Pa 6to4.conf
file is in
.Xr perl 1
syntax, and contains several
variables that can be tuned to adjust your setup.
.Bl -tag -width start-rtadvd
.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 interface, 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.
.El
.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
6to4 utility and manpage portions were written by
Hubert Feyrer <hubert@feyrer.de> for NetBSD.