On Thu, 20 Sep 2001, Tarhon-Onu Victor wrote:

>       Din documentatii mai lipseste o chestie de genul:
> ip addre add 10.100.100.1/30 dev tunel
> ip link set dev tunel up
>       Ei in ip-cref nu pomenesc de setat ip pe interfetele tunel... ceea
> ce inseamna practic ca interfata tunel nu stie ce e aia proto ip.
> 

#!/bin/sh
# Name of the tunnel
#

tunnel="internal-bos"

# Address of the local system -- this is the address of one of your 
# local interfaces (or for a mobile host, the address that this system has
# when attached to the local network). 
#

myip="192.168.25.3"

# Address of the Remote system -- this is the address of one of the 
# remote system's local interfaces (or if the remote system is a mobile host, 
# the address that it uses when attached to the local network).

hisip="192.168.25.2"

# Internet address of the Remote system
#

gateway="192.168.5.2"

# Remote sub-network -- if the remote system is a gateway for a 
#                       private subnetwork that you wish to 
#                       access, enter it here. If the remote
#                       system is a stand-alone/mobile host, leave this
#                       empty

subnet="192.168.7.0/24"

PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin

case "$1" in
  start)

      #NOTE: Comment out the next two lines if you have built ipip into your kernel
      echo "Loading IP-ENCAP Module"
      modprobe ipip

      if [ -n "`ip link show $tunnel 2>/dev/null`" ]; then
          $0 stop
      fi

      echo "Adding $tunnel"

      ip tunnel add $tunnel mode ipip remote $gateway

      echo "Starting $tunnel" 

      ip addr add $myip peer $hisip dev $tunnel
      ip link set dev $tunnel up

      #
      # As with all interfaces, the 2.2 kernels will add the obvious host
      # route for this point-to-point interface
      #

      if [ -n "$subnet" ]; then
          echo "Adding Routes"
          ip route add $subnet via $gateway dev $tunnel onlink
      fi
    ;;
  stop)
      if [ -n "`ip link show $tunnel 2>/dev/null`" ]; then
          echo "Stopping $tunnel"
          ip link set dev $tunnel down
      fi

      if [ -n "`ip addr show $tunnel 2>/dev/null`" ]; then
          echo "Deleting $tunnel"
          ip tunnel del $tunnel
      fi
    ;;
  restart)
      $0 stop
      sleep 1
      $0 start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac
exit 0




---
Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to 
unsubscribe from this list.

Raspunde prin e-mail lui