ip-up.d

Path: /etc/ppp/ip-up.d/
Name: Script.sh [make it executable]

#!/bin/sh # This script is called with the following arguments: # Arg Name Example # $1 Interface name ppp0 # $2 The tty ttyS1 # $3 The link speed 38400 # $4 Local IP number 12.34.56.78 # $5 Peer IP number 12.34.56.99 # $6 Optional ``ipparam'' value foo # These variables are for the use of the scripts run by run-partsPATH=/sbin:/bin:/usr/sbin:/usr/bin PPP_IFACE="$1" PPP_TTY="$2" PPP_SPEED="$3" PPP_LOCAL="$4" PPP_REMOTE="$5" PPP_IPPARAM="$6" if [ $PPP_IFACE = 'ppp0' ]; then /sbin/ip route add default dev $PPP_IFACE table main /sbin/ip route add 192.168.1.0/24 dev eth0 table main /sbin/ip rule add from 192.168.1.0/24 table main elif [ $PPP_IFACE = 'ppp1' ]; then /sbin/ip route add default dev $PPP_IFACE table local /sbin/ip route add 192.168.2.0/24 dev wlan0 table local /sbin/ip rule add from 192.168.2.0/24 table local fi

Search Results