#!/bin/sh LOCALNET=192.168.0.0/24 DEVICE="ppp0" IPTABLES=/usr/sbin/iptables DoSettings() { echo $1 > /proc/sys/net/ipv4/ip_forward $IPTABLES $2 POSTROUTING -t nat -o $DEVICE -s $LOCALNET -j MASQUERADE $IPTABLES $2 FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu } case $1 in start) DoSettings "1" -A ;; stop) DoSettings "0" -D ;; *) echo " $0 {start|stop}" exit 1 esac