User Tools

Site Tools


freebsd:tunnels

This is an old revision of the document!


GRE and GIF Tunnels

Diagram

Tunnel Script

gre.sh
#!/bin/sh
 
TUNNEL_IF="gre0"
MYSELF_EXT="192.168.117.1"
MYSELF_TUNNEL="192.168.220.1"
 
OTHER_EXT="192.168.117.2"
OTHER_TUNNEL="192.168.220.2"
OTHER_NET=""
 
 
if [ "`ifconfig ${TUNNEL_IF} 2>&1 | grep flags`" != "" ]
then
        ifconfig ${TUNNEL_IF} destroy
fi
 
ifconfig ${TUNNEL_IF} create
ifconfig ${TUNNEL_IF} ${MYSELF_TUNNEL} ${OTHER_TUNNEL} netmask 255.255.255.252
ifconfig ${TUNNEL_IF} tunnel ${MYSELF_EXT} ${OTHER_EXT}
route add ${OTHER_NET} ${OTHER_TUNNEL}
freebsd/tunnels.1423771268.txt.gz · Last modified: 2015/02/12 14:01 by tschulz