#! /bin/sh . /usr/local/etc/PPP-private # this file contains private info, in the following format: #export PHONE=5551234 #export USER=spade #export PASSWORD=CoolPWD #export OUR_IP_ADDR=128.0.0.200 #export THEIR_IP_ADDR=128.0.0.1 export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin/usr/sbin:/bin:/sbin" /usr/sbin/diald /dev/cua3 -m ppp local $OUR_IP_ADDR \ remote $THEIR_IP_ADDR defaultroute modem crtscts \ ip-up ppp-up \ ip-down ppp-down \ fifo /var/adm/diald.ctl \ impulse 600,300 \ connect-timeout 120 \ redial-timeout 5 \ connect '/usr/sbin/chat -v \ ABORT "NO CARRIER" ABORT BUSY \ "" ATZ OK ATS7=50M0L2V1\&C1E1Q0DT$PHONE CONNECT "" \ ogin: $USER ssword: \\q$PASSWORD'
This program or script is executed with the same real and effective user-ID as pppd, that is, at least the effective user-ID and possibly the real user-ID will be root. This is so that it can be used to manipulate routes, run privileged daemons (e.g. sendmail), etc. Be careful that the contents of the /etc/ppp/ip-up and /etc/ppp/ip-down scripts do not compromise your system's security.
Note that this script has the same function of /etc/ppp/ip-up used with 'raw' PPP.
#! /bin/sh echo ppp up `date` > /dev/console # This might be a good place to invoke fetchmail to retreive # mail from the ISP. # This is also a good place to fix up routes.
Note that this script has the same function of /etc/ppp/ip-up used with 'raw' PPP.
#! /bin/sh echo ppp going down `date` > /dev/console # We restart the DNS server, so that the next request for # an off-site lookup will bring up the link. /usr/sbin/named.restart
There is one more important piece of magic. Since I am running a forwarding DNS server, I need to bring up the link when my DNS server attempts to talk to the forwaders. As it comes out of the sources, the standard.filter rules ignore such communication attemts, I comment out this rule.
draco:/usr/local/sbin# cd /usr/local/src/diald-0.16/config draco:/usr/local/src/diald-0.16/config# diff standard.filter /usr/lib/diald 116c116 < ignore udp udp.dest=udp.domain,udp.source=udp.domain --- > ### ignore udp udp.dest=udp.domain,udp.source=udp.domain
Index,
Back
On to IP Masquerade