Skip to main content

Posts

Showing posts from November, 2010

IPIP tunnel creator via bash

1: #!/bin/bash 2: # 3: # Tunnel ipip Automation 4: # Creator: Shiran Guez 5: # 6: TUN_ETH="eth0" 7: IP_DEST_EXT="" 8: TUNNEL_IP_SRC="" 9: TUNNEL_IP_DST="" 10: _CREATE_ () { 11: echo "Please enter the name of your local interface [eth0 is default]: " 12: echo "[ To Skip enter >>>skip<<< ]" 13: while :; 14: do 15: read COMM_ETH 16: if [ "$COMM_ETH" == "skip" ] ;then 17: break 18: elif [ "$COMM_ETH" == "eth0" ] ;then 19: break 20: else 21: ifconfig "$COMM_ETH" >/dev/null 22: if [ $? -eq 0 ] ;then 23: TUN_ETH="$COMM_ETH" 24: break 25: else 26: echo "You have entered a wrong ethernet interface" 27: echo "Please try again: " 28: fi 29: fi 30: 31: done 32: localip=$(ifconfig $TUN_ETH | grep Bcast…