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=""
MYSELF_TUNNEL=""
 
OTHER_EXT=""
OTHER_TUNNEL=""
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.svg.odg

freebsd/tunnels.1423771342.txt.gz · Last modified: 2015/02/12 14:02 by tschulz