Hi, not sure whether this was posted already. I had problems sharing a dial-up (Modem) PPP connection. I want to use NAT for security reasons and found that only the first connection after reboot worked. Subsequent connects would fail due to NATD not rebinding the new PPP bindings. Restarting NATD fixed the problem. Luckily PPPD fires off some scripts in /etc/ppp depending on connection status. The following script restarts NATD after every successfull connect if you save it as /etc/ppp/ip-up (don't forget to make it executable):
#!/bin/sh -In that script you can, of course, kick off other useful stuff you only want to happen if the link comes up (e.g. sending spooled mail).
N_P=`ps -uxc -U root | grep ' natd$' | awk '{ print $2 }'`
if [ "$N_P" != "" ]; then
logger -i -t $0 "Sending SIGHUP to natd (PID $N_P)"
kill -HUP $N_P
fi
•
[4,893 views]

