diff options
Diffstat (limited to 'sysconfig/network-scripts/ifup-ippp')
-rwxr-xr-x | sysconfig/network-scripts/ifup-ippp | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/sysconfig/network-scripts/ifup-ippp b/sysconfig/network-scripts/ifup-ippp index 5b15f303..3fc9477b 100755 --- a/sysconfig/network-scripts/ifup-ippp +++ b/sysconfig/network-scripts/ifup-ippp @@ -10,7 +10,11 @@ cd /etc/sysconfig/network-scripts . network-functions . /etc/rc.d/init.d/functions +# Get global network configuration +[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network + DEBUG="no" +GATEWAY="" # set device CONFIG=$1 @@ -82,9 +86,6 @@ function start_ibod() function addprovider() { options= - if [ -z "$MSN" ]; then - log_echo "Error: $1: MSN not set" - fi if [ -z "$PHONE_OUT" ]; then log_echo "Error: $1: no outgoing phone number set" return 1 @@ -171,7 +172,7 @@ function addprovider() [ -n "$DIALMAX" ] && log_isdnctrl dialmax $DEVICE $DIALMAX # set callback - if [ "$CALLBACK" = "out" ]; then + if [ "$CALLBACK" = "out" -o "$CALLBACK" = "in" ] ; then log_isdnctrl callback $DEVICE $CALLBACK else log_isdnctrl callback $DEVICE off @@ -192,6 +193,10 @@ function addprovider() # set channel bundling if [ "$BUNDLING" = "yes" -o "$BUNDLING" = "on" ] && [ -n "$SLAVE_DEVICE" ]; then [ -z "$SLAVE_MSN" ] && SLAVE_MSN="$MSN" + if [ -z "$SLAVE_MSN" ]; then + log_echo "Error: $1: SLAVE_MSN not set" + exit 1 + fi [ -z "$SLAVE_PHONE_OUT" ] && SLAVE_PHONE_OUT="$PHONE_OUT" [ -z "$SLAVE_PHONE_IN" ] && SLAVE_PHONE_IN="$PHONE_IN" [ -z "$SLAVE_HUPTIMEOUT" ] && SLAVE_HUPTIMEOUT="$HUPTIMEOUT" @@ -257,17 +262,29 @@ function addprovider() # Add default route while connection options="$options defaultroute" - # configure Van Jacobson style TCP/IP header compression and + # Van Jacobson style TCP/IP header compression and # VJ connection-ID compression [ "$VJ" = "off" ] && options="$options -vj" [ "$VJCCOMP" = "off" ] && options="$options -vjccomp" - - # configure Address/Control compression, protocol field compression and - # BSD-Compression scheme + + # Address/Control compression, protocol field compression, [ "$AC" = "off" ] && options="$options -ac" [ "$PC" = "off" ] && options="$options -pc" - [ "$BSDCOMP" = "off" ] && options="$options -bsdcomp" - + + # BSD-Compression scheme + if [ "$BSDCOMP" = "on" ] ; then + options="$options bsdcomp 9,9" + else + options="$options -bsdcomp" + fi + # Stac compression + if [ "$LZS" = "on" ] ; then + # supports LZS check mode 3 and 4 + [ -n "$LZS_MODE" ] || LZS_MODE="4" + [ "$LZS_MODE" = "3" ] && options="$options lzs 1" + [ "$LZS_MODE" = "4" ] && options="$options lzs 1:4" + fi + # Set max receive and max transmit units [ -n "$MRU" ] && options="$options mru $MRU" [ -n "$MTU" ] && options="$options mtu $MTU" @@ -279,7 +296,7 @@ function addprovider() [ "$CCP" = "off" ] && options="$options noccp" # set host name - [ -n "$ISDN_HOSTNAME" ] && options="$options hostname $ISDN_HOSTNAME" + [ -n "$ISDN_HOSTNAME" ] && options="$options remotename $ISDN_HOSTNAME" # Set authentication for i in $AUTH ; do @@ -301,27 +318,39 @@ function addprovider() # set debug [ "$DEBUG" = "yes" ] && options="-d $options" + # set netmask, if available + [ -n "$NETMASK" ] && netmask="netmask $NETMASK" + # activate ISDN device - ifconfig $DEVICE $IPADDR pointopoint $GATEWAY up >/dev/null 2>&1 + logger -p daemon.info -t ifup-ippp "ifconfig $DEVICE $IPADDR pointopoint $GATEWAY $netmask up" + ifconfig $DEVICE $IPADDR pointopoint $GATEWAY $netmask up >/dev/null 2>&1 if [ "$ENCAP" = "syncppp" ]; then # start ipppd daemon - ipppd $options + logger -p daemon.info -t ifup-ippp "ipppd $options" + ipppd $options >/dev/null 2>&1 # start ibod daemon [ "$BUNDLING" = "yes" -o "$BUNDLING" = "on" ] && [ -n "$SLAVE_DEVICE" ] && start_ibod $DEVICE fi # set default gateway for dial on demand - if [ "$DIALMODE" = "auto" ]; then + if [ "$DIALMODE" = "auto" ] ; then echo 1 > /proc/sys/net/ipv4/ip_dynaddr - route del default >/dev/null 2>&1 - if [ "$GATEWAY" = "10.112.112.113" ]; then - route add default $DEVICE >/dev/null 2>&1 - else - route add default gw $GATEWAY >/dev/null 2>&1 + if [ "$DEFROUTE" = "yes" ] ; then + route del default >/dev/null 2>&1 + if [ "$GATEWAY" = "10.112.112.113" ]; then + route add default $DEVICE >/dev/null 2>&1 + else + route add default gw $GATEWAY >/dev/null 2>&1 + fi fi fi + + ## Setup IPv6 + #if [ "${NETWORKING_IPV6}" = "yes" ]; then + # /etc/sysconfig/network-scripts/ifup-ipv6 $DEVICE + #fi } addprovider || exit 1 |