Script to automatically set up IPv6 6to4-tunnel
- Roshan Revankar < rrevankar (at) yahoo (dot) com > blog
I had developed this script - 6to4tunnel-control
- to automatically set up and bring down the 6to4-tunnel when I connected
to the net using pppd. All the commands(including the comments accompanying
them) in the script for setting up the ipv6 tunnel are from Peter Bieringer's
excellent Linux IPv6
HOWTO at http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/
You need to have a Linux kernel with IPv6 support to use this script.
Disclaimer
Use this script at your own risk. I have had no problems with it so far,
but I have only tested it on my machine(Linux kernel v2.4.2) and I can't
say if it behaves similarly on other kernel versions. It may cause problems
with old kernels without IPv6 support. Read the Linux IPv6 HOWTO
for more details.
In any case, do let me know if you have problems with it.
Download
http://geocities.datacellar.net/rosh98/6to4tunnel-control
(This file is a .txt because geocities requires the file to have an extension
and .sh etc., is not permitted.)
Using the script from pppd
pppd uses the script /etc/ppp/ip-up when the PPP link goes ip and /etc/ppp/ip-down
when the link is no longer available. The following parameters are sent
to /etc/ppp/ip-up by pppd:
interface-name tty-device speed local-IP-address
remote-IP-address ipparam
We only need the 4th parameter - local-IP-address.
In /etc/ppp/ip-up, we give
6to4tunnel-control start $4
and in /etc/ppp/ip-down,
6to4tunnel-control stop