gre tunnel bash function

#!/bin/bash

/sbin/modprobe gre

function tun2-up {
    NAME=$1
    REMOTE=$2
    IP=$3
    PPTP=$4

    #ip link set ${NAME} down
    #ip tunnel del ${NAME}

    ip tunnel add ${NAME} mode gre remote ${REMOTE} local MY_EXTERNAL_IP
    ifconfig ${NAME} inet ${IP} pointopoint ${PPTP}

    ip link set ${NAME} up
}

tun2-up tunnelname REMOTE_IP 10.77.253.222/30 10.77.253.221

Немає коментарів: