IPv6 & Linux - HowTo - Script Files (3.19) - 20010731 and later
Version: 3.20a from 2001-08-30
(P) & (C) 2001 by Peter Bieringer <pb@bieringer.de>,
see copyright notice
for more details
Original site of publishing: http://www.bieringer.de/linux/IPv6/;
suggestions, comments and improvements are welcome!
If you found errors, bugs or problems, please
contact the author - thank you!
Contents
Version information
-
3.19/20010522b: Official publishing: new features are
-
Add new switches to control autoconfiguration per device
-
Take care about different meaning of the forwarding switch
-
Global IPv6 initscript (called from hooks in /etc/rc.d/init./network) to
bring up global settings and shutdown IPv6 globally at least
-
Remove redundant information on page
-
3.19/20010731:
-
sit-interfaces: new optional option IPV6TUNNELIPV4LOCAL
-
interfaces: new optional option IPV6_MTU
-
IPV6TO4_RELAY can now contain a 6to4 address
-
Some reviews and minor enhancements, see readme-changes-ipv6.txt
included in the taball for details
-
3.20/20010828a:
-
Add support for easy default route setup (currently using 2000::/3
because ::/0 is still not working)
-
Enable ifup|down-isdn (taken from RHL beta Roswell, also working
on RHL 6.2) for IPv6, now you can run IPv6 over HDLC/IP
Additional information
-
A (mostly not current) release of my set of script files is already included
in RedHat's current rawhide section and newest beta versions, they are
included the initscript package
-
ftp://ftp.redhat.com/rawhide/,
look for initscript-*.src.rpm
-
You can use e.g. this RPM, and perhaps take newer files from here and overwrite
outdated ones.
Credits to
-
Pekka Savola for his hard work helping
on Red Hat Linux integration and testing
How to get
Because of the amount of files and dependencies, the current scripts are
no longer separately available via HTTP, they are now distributed in a
tarball via FTP and for Red Hat Linux also as SRPMS
Stable set
Testing
Script files (index), version: 20010828a
My IPv6 setup is based on a RedHat 6.2, 7.1 and Rowell beta system,
but should be easy to install on all SystemV compatible Linux distributions
(except S.u.S.E. and Debian...).
Common (distribution version independed)
-
Information files and tools:
-
Description of current used switch and their meaning
-
ChangeLog
-
Shell script which strips away all unimportant information (e.g. debugging,
additional information)
-
striptool4ipv6scripts
-
RH7 packagers can use this like: sh striptool4ipv6scripts network-functions-ipv6
rh7 info debug, and if I leave no bugs, the stripped script should
work afterwards, too...
-
Script files
-
Central IPv6 function libary, used by several scripts for initializing
IPv6 on interfaces
-
/etc/sysconfig/network-scripts/network-functions-ipv6
-
Global IPv6 initscript (called from hooks in /etc/rc.d/init./network) to
bring up global settings and shutdown IPv6 globally at least
-
/etc/sysconfig/network-scripts/init.ipv6-global
-
IPv6 related interface initialisation scripts for normal interfaces
-
/etc/sysconfig/network-scripts/ifup-ipv6
-
/etc/sysconfig/network-scripts/ifdown-ipv6
-
IPv6 related interface initialisation scripts for tunnel interfaces
-
/etc/sysconfig/network-scripts/ifup-sit
-
/etc/sysconfig/network-scripts/ifdown-sit
-
IPv6 related interface initialisation scripts for ISDN interfaces
-
/etc/sysconfig/network-scripts/ifup-isdn
-
/etc/sysconfig/network-scripts/ifdown-isdn
-
Scripts for dynamic 6to4 tunneling called from the related PPP scripts
-
/etc/ppp/ip-up.ipv6to4
-
/etc/ppp/ip-down.ipv6to4
-
Test script, to test your IPv6 function libary for full working with your
IPv6 kernel
-
/usr/sbin/test_ipv6_installation
-
Configuration files: (examples)
-
Global IPv6 switches
-
/etc/sysconfig/network.diff
-
Static IPv6 routes
-
/etc/sysconfig/static-routes-ipv6
-
Files containing network specific data per interface
-
Example for an Ethernet interface
-
/etc/sysconfig/network-scripts/ifcfg-eth0
-
Example for an ISDN link using HDLC/IP
-
/etc/sysconfig/network-scripts/ifcfg-isdn0
-
Example for static tunnel interfaces (unnumbered tunnel)
-
/etc/sysconfig/network-scripts/ifcfg-sit1
-
Example for static tunnel interfaces (numbered tunnel - Freenet6)
-
/etc/sysconfig/network-scripts/ifcfg-sit2
-
Example for static tunnel interfaces (numbered tunnel - Hurricane Electric)
-
/etc/sysconfig/network-scripts/ifcfg-sit3
-
Example for static tunnel interfaces (numbered tunnel, local IPv4 is specified)
-
/etc/sysconfig/network-scripts/ifcfg-sit4
-
Example for 6to4-tunnel PPP interface
-
/etc/sysconfig/network-scripts/ifcfg-ppp0
-
Sample configuration file for radvd and 6to4
Red Hat Linux 6.2
This version has no IPv6 support, so it must be implemented
-
Scripts: (diffs)
-
Main network initialization scripts, add hook for IPv6
-
/etc/rc.d/init.d/network.diff
-
Main interface initialization scripts, add hook for IPv6
-
/etc/sysconfig/network-scripts/ifup.diff
-
/etc/sysconfig/network-scripts/ifdown.diff
Red Hat Linux 7.1
This version has already IPv6 support, but based on an older version of
my scripts
-
Scripts: (diffs)
-
Main network initialization scripts, add hook for IPv6 (new feature)
-
/etc/rc.d/init.d/network.diff
-
Main interface initialization scripts, move hook for IPv6 (bugfix)
-
/etc/sysconfig/network-scripts/ifup.diff
Red Hat Linux Roswell beta
This version has already IPv6 support, but based on an (but not much) older
version of my scripts
-
Scripts: (diffs)
-
IPv6 enabling of existing ISDN setup scripts
-
/etc/sysconfig/network-scripts/ifup-ippp.diff
-
/etc/sysconfig/network-scripts/ifdown-ippp.diff
Installation, configuration and testing
Network configuration on Linux is splitted in several steps:
-
Configuration of the built-in interfaces
-
Global network configuration
-
Starting of the daemons using the network
For IPv6 you have to implement in this steps the IPv6 configuration in
the right way. Therefore I have written several configuration and script
files, which do this work.
Please, DO NOT USE following shown addresses
in your case without checking!
Pre-install:
IPv4 interface configuration should be done by the distribution and is
working (not a must for an IPv6 only box)
Installation:
-
Fetch tarball
-
Extract tarball
-
Copy script files to relating directories (perhaps outdated ones will be
overwrited)
-
Apply patches to existing files using given diff files
-
Look into the configuration files and copy related items to yours Please,
check example data and change it before starting!
Configuration:
Basics: if a variable is shown twice (and one of the line is starting with
"#") then the possible values are shown. To change the value you can comment
out the uncommented (add a leading "#" at the beginning of the line) and
delete the other "#" or delete one line and change the value regarding
to that what you want.
See also sysconfig-ipv6.txt (included in the tar-ball) for
more description and examples.
/etc/sysconfig/network
Controls global IPv6 configuration
-
Control global IPv6 configuration
NETWORKING_IPV6=yes # Enable global IPv6 initialization
#NETWORKING_IPV6=no # Disable global IPv6 initialization [default]
-
Select tunnel setup mode
#IPV6_TUNNELMODE="IP" # separate tunnel device
mode [default]
#IPV6_TUNNELMODE="NBMA" # NBMA-styled tunnel mode
-
Control IPv6 forwarding (box acting as router)
IPV6FORWARDING=yes # Enable global IPv6 forwarding
#IPV6FORWARDING=no # Disable global IPv6 forwarding [default]
-
Control IPv6 autoconfiguration globally (e.g. accecpt router advertisements)
#IPV6_AUTOCONF=yes # Enable global IPv6 autoconfiguration (only,
if global forwarding is disabled) [default]
IPV6_AUTOCONF=no # Disable global IPv6 autoconfiguration (only,
if global forwarding is disabled)
-
Control IPv6 automatic tunneling (device sit0)
#IPV6_AUTOTUNNEL=yes # Enable automatic IPv6 tunneling
IPV6_AUTOTUNNEL=no # Disable automatic IPv6 tunneling [default]
-
Control default route setup (NEW, please test)
-
Specifying gateway address
IPV6_DEFAULTGW=<ipv6address[%interface]> # [optional]
-
Specifying gateway device only
IPV6_DEFAULTDEV=<interface> # [optional]
/etc/sysconfig/network-scripts/ifcfg-device
Example to controls a LAN or PPP device specific
IPv6 configuration
-
Control IPv6 configuration for this interface
IPV6INIT="yes" # Enable IPv6 initialization
of this interface
# IPV6INIT="no" # Disable IPv6 initialization
of this interface [default]
-
Specify the basic (not link local) IPv6 address and
prefix for this interface:
IPV6ADDR="3ffe:ffff:0000:f101::1/64"
# Basic static IPv6 address of this interface [optional for hosts, mostly
required for routers]
-
Specify optional additional IPv6 addresses and their
prefix length for this interface:
IPV6ADDR_SECONDARIES="fec0:0:0:1::1/64 3ffe:ffff:0000:f101::2/64"
# List of secondary addresses here [optional]
-
Specify the MTU of a link
-
IPV6_MTU="1280" # set IPv6 MTU for this
link [optional]
6to4 related part (optional)
-
Control 6to4 tunneling through this interface (must
be external one):
#IPV6TO4INIT="yes" # Enable 6to4 initialization
of this interface
IPV6TO4INIT="no" # Disable 6to4 initialization
of this interface [default]
-
Specifiy 6to4 relay
IPV6TO4_RELAY="194.95.108.191" [required,
if 6to4 is enabled]
-
Specify 6to4 local address overwrite (optional, in
case of NAT or other special scenarios)
IPV6TO4_IPV4ADDR="1.2.3.4" [optional, for
e.g. NAT issues]
-
Information for setup local subnetting (sorry for strange format...)
-
IPV6TO4_ROUTING="eth0-:f101::0/64 eth1-:f102::0/64"
-
Enable radvd triggering
-
IPV6TO4_CONTROL_RADVD=yes
-
PID file of radvd for sending signals
-
IPV6TO4_RADVD_PIDFILE=file
Special controls (optional)
-
Control accepting of RAs and redirects on this interface
(overwrite global setting)
IPV6_AUTOCONF=yes # Accept RAs and redirects
[default, if forwarding is off]
IPV6_AUTOCONF=no # Accept RAs and redirects
[default, if forwarding is on]
-
Control sending of router advertisements and isRouter
on neigbor advertisements
IPV6_ROUTER=yes # Send RAs and set isRouter
on NAs [default, if forwarding is on]
IPV6_ROUTER=no # Do not send RAs and unset
isRouter on NAs [default, if forwarding is off]
/etc/sysconfig/network-scripts/ifcfg-sit0
Example to controls basic IPv6-in-IPv4 tunnel interface,
obsolete in script sets >20010522d now, use switch IPV6_AUTOTUNNEL
at /etc/sysconfig/network now.
/etc/sysconfig/network-scripts/ifcfg-tunnel
Example to control a dedicated IPv6-in-IPv4 tunnel
interface
-
Specify interface name (must be the same as the appendix
from the filename) and other compatible values:
DEVICE="sit1"
BOOTPROTO="none"
ONBOOT="yes"
-
Control IPv6 configuration for this interface
IPV6INIT="yes" # Enable IPv6 initialization
of this interface
#IPV6INIT="no" # Disable IPv6 initialization
of this interface [default]
-
Specify the IPv4 address of the foreign tunnel endpoint:
IPV6TUNNELIPV4="1.2.3.4" # IPv4 address of
the remote tunnel endpoint [required]
-
Specify the IPv4 address of the local tunnel endpoint
(for nodes with more than one IPv4 address on an interface):
-
IPV6TUNNELIPV4LOCAL="2.3.4.5" # IPv4 address
of the local tunnel endpoint [optional]
-
Specify the local IPv6 address of a numbered IPv6-in-IPv4
tunnel
IPV6ADDR="3ffe:b00:c18:1fff:0:0:0:a1f/0"
# Local address of a numbered tunnel [optional]
-
Specify the MTU of a tunnel link
IPV6_MTU="1280" # set IPv6 MTU for
this link [optional]
/etc/sysconfig/static-routes-ipv6
Example for IPv6 static routes:
-
Here you can specify additional IPv6 routes per interface
#Device IPv6 network to route
IPv6 gateway address
#eth0 fec0:0:0:2::/64
fec0:0:0:1:0:0:0:20
#eth0 3ffe::/16
3ffe:ffff:0000:f102:0:0:0:1
#eth0 2000::/3
3ffe:ffff:0000:f102:0:0:0:1
-
And also the routes for tunnels (hint:
please try new feature DEFAULTGW/DEFAULTDEV instead of this)
## Virtual tunnel interface
IPv6 network to route through
# IPv6 Testing Address Allocation (6bone
testbed)
sit1
3ffe::/16
# IPv6 official addresses
sit1
2000::/3
Testing:
-
You can restart the whole network configuration by executing
-
/etc/rc.d/init.d/network restart
-
Normally, you're not able to see what's really happened, because the output
is written to syslog (RedHat: facility: local7, file:
/var/log/boot.log).
Therefore it's always a good idea to look at the output on another virtual
console with
-
tail -f /var/log/boot.log
-
See also example section
Migration
From 3.15-3.16 to 3.19+
Following changes should be done for migration:
| File |
Description |
3.15-3.16 |
3.19+ |
| ifcfg-ethX |
IPv6 address must include prefix length now |
IPV6ADDR |
IPV6ADDR (prefix length included) |
| ifcfg-ethX |
Extra variable for prefix length is now obsolete |
IPV6PREFIXLENGTH |
Prefix length now included in IPV6ADDR |
| ifcfg-ethX |
Support for more than only 2 secondary IPv6 addresses per interface |
IPV6ADDR_1
IPV6ADDR_2 |
IPV6ADDR_SECONDARIES (prefix
length included) contains a list with additional IPv6 addresses |
ifcfg-sitX
(X > 0) |
Tunnel route no longer specified here |
IPV6TUNNELROUTE |
Specified now in static-routes-ipv6 |
ifcfg-sitX
(X > 0) |
Numbered tunnel now supported |
not supported |
IPV6ADDR (prefix length included) |
| ifcfg-sit0 |
Automatic tunneling now supported |
not supported (in early releases) |
Use switch IPV6_AUTOTUNNEL
at /etc/sysconfig/network now |
From 3.17 to 3.19+
Following changes should be done for migration:
| File |
Description |
3.17 |
3.19+ |
| ifcfg-sitX (X > 0) |
Numbered tunnel now better supported |
Prefix length was set to 0 because of NBMA-styled setup |
prefix length for p-t-p tunnels in non NBMA-styled mode can be set
now to 127 |
rom 3.18 to 3.19+
Following changes should be done for migration:
| File |
Description |
3.18 |
3.19+ |
| ifcfg-sit0 |
Automatic tunneling |
ifcfg-sit0 was used for that |
Use switch IPV6_AUTOTUNNEL
at /etc/sysconfig/network now instead |
| ifcfg-sitX (X > 0) |
Numbered tunnel now better supported |
Prefix length was set to 0 because of NBMA-styled setup |
prefix length for p-t-p tunnels in non NBMA-styled mode can be set
now to 127 |
Examples for static tunnel setup
This section contains examples about a setup of static tunnels to different
tunnel providers.
Note: static tunnels should be configured on device names sitX
with (X>0). Do not use sit0, because it is a reserved
device and shouldn't be used for such cases.
Static tunnel with a routable segment
Example based on test at 2001-03-13.
Data you got from a static tunnel server administrator (here is an example
shown):
IPv6 remote static tunnel IPv4 address (server side): 1.2.3.4
To local routed IPv6 address space: 3ffe:ffff:0000:f100::/56
Common known data:
Global routable IPv6 address space: 3ffe::/16, 2000::/3
What does this data mean and where to put the values in the configuration
files:
| Name |
Value(s) |
Explanation |
Which file is related |
Where to put this value |
| IPv6 remote static tunnel IPv4 address (server side) |
1.2.3.4 |
The IPv4 address of a remote tunnel server |
e.g.
ifcfg-sit1 |
IPV6TUNNELIPV4="1.2.34" |
| To local routed IPv6 segment |
3ffe:ffff:0000:f100::/56 |
An IPv6 address space which will be routed to you |
e.g. local interface, RAdvD, routing configuration |
e.g. /etc/radvd.conf, segmented per device, other local hosts |
| Global routable IPv6 address space |
3ffe::/16
2000::/3 |
IPv6 address space, which should be routed through this tunnel |
static-routes-ipv6 |
See example, one IPv6 address space per line |
Configuration files result in:
-
/etc/sysconfig/network-scripts/ifcfg-sit1
DEVICE="sit1"
BOOTPROTO="none"
ONBOOT="yes"
IPV6INIT="yes"
IPV6TUNNELIPV4="1.2.3.4"
-
/etc/sysconfig/static-routes-ipv6 (hint:
please try new feature DEFAULTGW/DEFAULTDEV instead of this)
sit1 3ffe::/16
sit1 2000::/3
Check:
-
Tunnel setup
# ip tunnel
sit0: ipv6/ip remote any local any
ttl 64 nopmtudisc
sit1: ipv6/ip
remote 1.2.3.4 local any ttl 64
-
Interface
# ifconfig sit1
sit1
Link encap:IPv6-in-IPv4
inet6 addr: fe80::something/10 Scope:Link
inet6 addr: fe80::something/10 Scope:Link
UP POINTOPOINT RUNNING NOARP MTU:1472 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
-
Routing
# route -A inet6 |grep sit1
3ffe::/16
::
U 1 0
0 sit1
2000::/3
::
U 1 0
0 sit1
fe80::/10
::
UA 256 0
0 sit1
ff00::/8
::
UA 256 0
0 sit1
Freenet6
point-to-point-tunnel
Example based on test at 2001-03-13.
See here for more
information about what Freenet6 provides you.
Data you got from Freenet6: (here
is an example
shown):
This perl script is setup with exacts values :
Your IPv6 address : 3ffe:b00:c18:1fff:0:0:0:a1f
Freenet6 IPv6 address (server side) : 3ffe:b00:c18:1fff:0:0:0:a1e
Freenet6 IPv4 address (server side) : 206.123.31.102
Your IPv4 address : 62.155.142.69
Common known data:
Global routable IPv6 address space: 3ffe::/16, 2000::/3
What does this data mean and where to put the values in the configuration
files:
| Name |
Value(s) |
Explanation |
Which file is related |
Where to put this value |
| Your IPv6 address |
3ffe:b00:c18:1fff:0:0:0:a1f |
Freenet6 assign only one
IPv6 address to you, not more! |
e.g.
ifcfg-sit2 |
IPV6ADDR="3ffe:b00:c18:1fff:0:0:0:a1f/127" |
| Freenet6 IPv6 address (server side) |
3ffe:b00:c18:1fff:0:0:0:a1e |
They also assigned a relating IPv6 address on their tunnel server (it's
now a point-to-point IPv6 link) |
|
Value is locally not needed (but for easier ping6 tests you
can put it in /etc/hosts) |
| Freenet6 IPv4 address (server side) |
206.123.31.102 |
The IPv4 address of their tunnel server |
e.g.
ifcfg-sit2 |
IPV6TUNNELIPV4="206.123.31.102" |
| Your IPv4 address |
62.155.142.69 |
Your global IPv4 address, static or dynamically assigned |
interface or
ial-up configuration |
Value must be already assigned static or dynamically, otherwise no
Internet connection is possible |
| Global routable IPv6 address space |
3ffe::/16
2000::/3 |
IPv6 address space, which should be routed through this tunnel |
static-routes-ipv6 |
See example, one IPv6 address space per line |
Configuration files result in:
-
/etc/sysconfig/network-scripts/ifcfg-sit2
DEVICE="sit2"
BOOTPROTO="none"
ONBOOT="yes"
IPV6INIT="yes"
IPV6TUNNELIPV4="206.123.31.102"
IPV6ADDR="3ffe:b00:c18:1fff:0:0:0:a1f/127"
-
/etc/sysconfig/static-routes-ipv6 (hint:
please try new feature DEFAULTGW/DEFAULTDEV instead of this)
sit2 3ffe::/16
sit2 2000::/3
Check:
-
Tunnel setup
# ip tunnel
sit0: ipv6/ip remote any local any
ttl 64 nopmtudisc
sit2: ipv6/ip
remote 206.123.31.102 local any
ttl 64
-
Interface
# ifconfig sit2
sit2
Link encap:IPv6-in-IPv4
inet6 addr: fe80::3e9b:8e45/10 Scope:Link
inet6 addr: fe80::c0a8:101/10 Scope:Link
inet6 addr: 3ffe:b00:c18:1fff::a1f/127 Scope:Global
UP POINTOPOINT RUNNING NOARP MTU:1472 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0[root@gate network-scripts]# ifconfig sit1
-
Routing
# route -A inet6 |grep sit2
3ffe:b00:c18:1fff::a1e/127
::
UA 256 4
0 sit2
3ffe::/16
::
U 1 0
0 sit2
2000::/3
::
U 1 0
0 sit2
fe80::/10
::
UA 256 0
0 sit2
ff00::/8
::
UA 256 0
0 sit2
Example based on test at 2001-03-13.
Data you got from Hurricane Electric:
(here is an example
shown):
Account: *****
Last Active: Never (tested via ipv6 ping every half hour)
Full name: *****
Company: *****
E-mail address: *****
Broker IPv4 tunnel address: 64.71.128.26
Broker IPv6 link address: 3FFE:1200:3028:FF01::2e6/127
Your IPv4 tunnel address: 62.155.142.69
Your IPv6 link address: 3FFE:1200:3028:FF01::2e7/127
If you also require an IPv6 network:
Your IPv6 network prefix: 3FFE:1200:3028:8173::/64
Common known data:
Global routable IPv6 address space: 3ffe::/16, 2000::/3
What does this data mean and where to put the values in the configuration
files:
| Name |
Value(s) |
Explanation |
Which file is related |
Where to put this value |
| Your IPv4 tunnel address |
3FFE:1200:3028:FF01::2e7/127 |
In this mode, only one IPv6 address is provided to you. |
e.g.
ifcfg-sit3 |
IPV6ADDR="3FFE:1200:3028:FF01::2e7/127" |
| Broker IPv6 link address |
3FFE:1200:3028:FF01::2e6/127 |
They also assigned a relating IPv6 address on their tunnel server (it's
now a point-to-point IPv6 link) |
|
Value is locally not needed (but for easier ping6 tests you
can put it [without prefix length] in /etc/hosts) |
| Broker IPv4 tunnel address |
64.71.128.26 |
The IPv4 address of their tunnel server |
e.g.
ifcfg-sit3 |
IPV6TUNNELIPV4="64.71.128.26" |
| Your IPv4 tunnel address |
62.155.142.69 |
Your global IPv4 address, static or dynamically assigned |
interface or
ial-up configuration |
Value must be already assigned static or dynamically, otherwise no
Internet connection is possible |
| Your IPv6 network prefix |
3FFE:1200:3028:8173::/64 |
An IPv6 address space which will be routed to you |
e.g. local interface, RAdvD, routing configuration |
e.g. /etc/radvd.conf, segmented per device, other local hosts |
| Global routable IPv6 address space |
3ffe::/16
2000::/3 |
IPv6 address space, which should be routed through this tunnel |
static-routes-ipv6 |
See example, one IPv6 address space per line |
Configuration files result in:
-
/etc/sysconfig/network-scripts/ifcfg-sit3
DEVICE="sit3"
BOOTPROTO="none"
ONBOOT="yes"
IPV6INIT="yes"
IPV6TUNNELIPV4="64.71.128.26"
IPV6ADDR="3FFE:1200:3028:FF01::2e7/127"
-
/etc/sysconfig/static-routes-ipv6 (hint:
please try new feature DEFAULTGW/DEFAULTDEV instead of this)
sit3 3ffe::/16
sit3 2000::/3
Check:
-
Tunnel setup
# ip tunnel
sit0: ipv6/ip remote any local any
ttl 64 nopmtudisc
sit3: ipv6/ip
remote 64.71.128.26 local any
ttl 64
-
Interface
# ifconfig sit3
sit3
Link encap:IPv6-in-IPv4
inet6 addr: 3ffe:1200:3028:ff01::2e7/127 Scope:Global
inet6 addr: fe80::3e9b:8e45/10 Scope:Link
inet6 addr: fe80::c0a8:101/10 Scope:Link
UP POINTOPOINT RUNNING NOARP MTU:1472 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
-
Routing
# route -A inet6 | grep sit3
3ffe:1200:3028:ff01::2e6/127
::
UA 256 3
0 sit3
3ffe::/16
::
U 1 0
0 sit3
2000::/3
::
U 1 0
0 sit3
fe80::/10
::
UA 256 0
0 sit3
ff00::/8
::
UA 256 0
0 sit3
6to4 relay tunnel router
Example based on test at 2001-03-13.
Information about 6to4 relay tunnel routers are given here: http://www.kfu.com/~nsayer/6to4/
Data you got from: (here is an example
shown):
IPv4 address of remote 6to4 relay router: 194.95.108.191
Common known data:
Global routable IPv6 address space: 3ffe::/16, 2000::/3
Your global accessable IPv4 address: 62.155.142.69
What does this data mean and where to put the values in the configuration
files:
| Name |
Value(s) |
Explanation |
Which file is related |
Where to put this value |
| IPv4 address of remote 6to4 relay router |
194.95.108.191 |
The IPv4 address of a 6to4 relay tunnel router |
e.g.
ifcfg-eth0 |
IPV6TO4_RELAY="194.95.108.191" |
| Your global accessable IPv4 address |
62.155.142.69 |
Global accessable IPv4 address of your host |
e.g.
ifcfg-eth0 |
IPV6TO4_IPV4ADDR="62.155.142.69"
Only needed, if NAT, PPP or other scenarios do not let extract a global
IPv4 address automatically from the interface configuration |
| Global routable IPv6 address space |
3ffe::/16
2000::/3 |
IPv6 address space, which should be routed through this tunnel |
static-routes-ipv6 |
See example, one IPv6 address space per line |
The IPv6to4 address in shown example 2002:3e9b:8e45::1/48
will
be build automatically by the script.
Configuration files result in:
-
/etc/sysconfig/network-scripts/more ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="none"
IPADDR="192.168.1.1"
NETMASK="255.255.255.0"
ONBOOT="yes"
IPV6INIT="yes"
IPV6FORWARDING="yes"
IPV6TO4INIT="yes"
IPV6TO4_RELAY="194.95.108.191"
IPV6TO4_IPV4ADDR="62.155.142.69"
-
/etc/sysconfig/static-routes-ipv6 (hint:
please try new feature DEFAULTGW/DEFAULTDEV instead of this)
sit0 3ffe::/16
sit0 2000::/3
Check:
-
Tunnel setup
# ip tunnel
sit0: ipv6/ip remote any local any
ttl 64 nopmtudisc
-
Interface
# ifconfig sit0
sit0
Link encap:IPv6-in-IPv4
inet6 addr: ::62.155.142.69/96 Scope:Compat
inet6 addr: ::127.0.0.1/96 Scope:Unknown
inet6 addr: 2002:3e9b:8e45::1/48 Scope:Global
inet6 addr: ::192.168.1.1/96 Scope:Compat
UP RUNNING NOARP MTU:1480 Metric:1
RX packets:28 errors:0 dropped:0 overruns:0 frame:0
TX packets:75 errors:3 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
-
Routing
# route -A inet6 | grep sit0
::/96
::
U 256 2
0 sit0
2002:3e9b:8e45::/48
::
UA 256 0
0 sit0
3ffe::/16
::194.95.108.191
UG 1 40
0 sit0
2000::/3
::194.95.108.191
UG 1 0
0 sit0
fe80::/10
::
UA 256 0
0 sit0
ff00::/8
::
UA 256 0
0 sit0
6to4 relay tunnel router connecting
one or more subnets to the IPv6 backbone
If you are enable to connect your tunnel server via 6to4 to the IPv6 backbone
like described earlier on this page, it's because of
the assigned /48 prefix also possible, to route one or more local connected
subnets, too.
Once you have decided which site prefixes you want to use, you can enstablish
local routes of this prefixes through dedicated interfaces.
E.g. with a choosen site prefix 0:0:0:f101::0/64 on eth0
run route -A inet6 add 2002:d950:2485:f101::0/64 dev eth0. To
distribute the prefix, use e.g. radvd.
Now clients on this link should also be able to connect to the IPv6 backbone.
In dial-up scenarios with dynamic local IPv4 address assignment, the
described command must be executed every time and also the tunnel must
be reconfigured. Therefore I create some scripts which do the job automatically.
Also, with a new release of radvd (currently available at http://v6web.litech.org/radvd/),
which support automatic recalculation of 6to4 prefixes, you can distribute
the new prefix to local LANs.
-
Scripts:
-
Scripts for calling from the related PPP scripts
-
/etc/ppp/ip-up.ipv6to4
-
/etc/ppp/ip-down.ipv6to4
-
Sample interface configuration file for ppp0
-
/etc/sysconfig/network-scripts/ifcfg-ppp0
-
Sample configuration file for radvd
Configuration:
-
/etc/sysconfig/network-scripts/ifcfg-ppp0
-
Enable 6to4 initialization:
-
Specify special local IPv4 address (only needed behind a NAT gateway)
-
IPV6TO4_IPV4ADDR=IPv4addr
-
Remote IPv6to4 relay address
-
Information for setup local subnetting (sorry for strange format...)
-
IPV6TO4_ROUTING="eth0-:f101::0/64 eth1-:f102::0/64"
-
Enable radvd triggering
-
IPV6TO4_CONTROL_RADVD=yes
-
PID file of radvd for sending signals
-
IPV6TO4_RADVD_PIDFILE=file
-
/etc/radvd.conf
-
In a prefix section, add a line like
-
/etc/ppp/ip-up.local
-
Add a calling line like
-
/etc/ppp/ip-up.ipv6to4 $1 >>/var/log/ppp-ipv6to4.log 2>&1
-
/etc/ppp/ip-down.local
-
Add a calling line like
-
/etc/ppp/ip-down.ipv6to4 $1 >>/var/log/ppp-ipv6to4.log 2>&1
Testing:
Trigger a dial and take a look into the new created logfile /var/log/ppp-ipv6to4.log
More information coming next...