Linux with sit0 and several tunnels?

Artur Frysiak wiget@t17.ds.pwr.wroc.pl
Thu, 23 Sep 1999 21:45:16 +0200


On Thu, 23 Sep 1999, Stig Venaas wrote:

> On Thu, Sep 23, 1999 at 01:46:15PM +0200, Tomas Lund wrote:
> > 
> > Is anyone out there using linux 2.2/glibc 2.1 to set up multiple tunnels
> > using numbered tunnel interfaces? My setup today looks like this:
> > 
> > ifconfig sit0 inet6 add 3ffe:200:1:1c::2
> > route -A inet6 add 3ffe::0/16 gw ::193.10.66.219 dev sit0
> > route -A inet6 add 3ffe:240:2::/48 gw ::139.58.254.40 dev sit0
> > 
> > The first route is the one to my upstream pTLA (SICS) and the other is a
> > tunnel to another linuxbox (unnumbered tunnel endpoints), but now i need
> > to set up another tunnel to a solarisbox that wants IPv6-addresses for the
> > tunnel endpoints, does anyone know how to do this, I'd hate to spend
> > severaly days experimenting if this information is available somewhere :) 
> 
> You can do
> 
> ifconfig sit0 tunnel ::$IP4END
> ifconfig sit1 up
> ifconfig sit1 add $IP6END/64
> 
> where IP4END and IP6END are the remote IPv4 and IPv6 addresses. You
> can add more tunnels by repeating the first line, you will get sit2,
> sit3 and so on. To use the tunnels you add routes to sit1, sit2..

If you have net-tools >= 1.52 you may do:
$ iptunnel add $TUNNELNAME mode sit remote $IPV4END ttl 64
$ route add fe80::$IPV4END dev $TUNNELNAME
$ route add $IPV6NETWORK gw fe80::$IPV4END dev $TUNNELNAME

or (with iproute2)
$ ip tun add $TUNNELNAME mode sit remote $IPV4END ttl 64
$ ip link set up dev $TUNNELNAME
$ ip addr add $IPV6BONE_I/126 dev $TUNNELNAME
$ ip rou add $IPV6NETWORK via $IPV6BONE_YOU dev $TUNNELNAME

Wiget
-- 
  __    __ _            _
 / / /\ \ (_) __ _  ___| |_  @__mail:  Artur Frysiak
 \ \/  \/ / |/ _` |/ _ \ __|            Rudlice 10
  \  /\  /| | (_| |  __/ |_           98-311 Ostrowek
   \/  \/ |_|\__, |\___|\__|
             |___/           email:   Wiget@t17.ds.pwr.wroc.pl
PGP key: http://www.t17.ds.pwr.wroc.pl/~wiget/pgp.key
Fingerprint16 = 70 DB E0 2D 12 AB C7 31  B6 58 B5 61 B3 98 B6 E6