IPv6 & Linux - HowTo - Script Files (3.18+) - current ones

Version: 3.18e from 2001-04-07


(P) & (C) 1997-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

Additional information


Script files (index)

Information: my setup is based on a RedHat 6.2 or 7.0 system, but should be easy to install on all SystemV compatible Linux distributions.

Explanation of configuration and script files

Network configuration under Linux is splitted in several steps:
  1. Configuration of the built-in interfaces
  2. Global network configuration
  3. 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)
  • Install:

    New file Description Copy into directory
     network-functions-ipv6 IPv6 Function libary file /etc/sysconfig/network-scripts/
     ifup-ipv6 IPv6 related function to bring up IPv6 /etc/sysconfig/network-scripts/
     ifdown-ipv6 IPv6 related function to bring down IPv6 /etc/sysconfig/network-scripts/
     ifup-sit IPv6 related function to bring up IPv6 tunnel /etc/sysconfig/network-scripts/
     ifdown-sit IPv6 related function to bring down IPv6 tunnel /etc/sysconfig/network-scripts/
    Diff file Description Patch for file
     network.diff Interface independed network configuration /etc/sysconfig/network
     ifup.diff Script to bring network on interface up /etc/sysconfig/network-scripts/ifup
     ifdown.diff Script to bring network on interface down /etc/sysconfig/network-scripts/ifdown
    Diff file Description Patch for file
     ifcfg-eth0.diff Configuration for interface eth0 /etc/sysconfig/network-scripts/ifcfg-eth0

     
    New file Description Copy into directory
     ifcfg-sit0 Configuration (only enabling needed) for an automatic tunnel
    nterface the use of IPv4 compatible IPv6 addresses
    (Note: such tunnel is always enabled, if a static tunnel is configured - only for clients without any other static tunnel needed)
    /etc/sysconfig/network-scripts/
     ifcfg-sit1 Example for static tunnel interface /etc/sysconfig/network-scripts/
     ifcfg-sit2 Example for static tunnel provided by Freenet6 /etc/sysconfig/network-scripts/
     ifcfg-sit3 Example for static tunnel provided by Hurricane Electric /etc/sysconfig/network-scripts/
     static-routes-ipv6 Static IPv6 routes (including an interface token) /etc/sysconfig/

    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.

    Testing:


    Migration

    From 3.15-3.16 to 3.18+

    Following changes should be done for migration:
     
    File Description 3.15-3.16 3.18+
    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) Only enable interface (no specific data is required)

    From 3.17 to 3.18+

    Following changes should be done for migration:
     
    File Description 3.17 3.18+
    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


    RedHat's rawhide information

    In addition, this set should be able for easy implementation in the initscript-RPM. I'll support this with 3 files to make life easier for me maintain the set:

    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:400:100: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:400:100: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:

    Check:


    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:

    Check:


    Hurricane Electric tunnel broker

    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:

    Check:


    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:

    Check:


    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 wrote 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.

    Configuration:

    Testing:

    Trigger a dial and take a look into the new created logfile /var/log/ppp-ipv6to4.log

    More information coming next...