oinophlux
2005-10-15 20:53:19 UTC
Greetings All,
I have a dialup debian box that serves as a gateway for my home LAN.
I have a firewall/ipmasq script (from the iptables HOWTO) that runs fine
after the ppp0 interface comes up. I'd like to have it work
automagically everytime I establish the connection, and therefore I have
the script in /etc/ppp/ip-up.d (I am getting sick of executing
/etc/ppp/ip-up.d/firewall.sh by hand everytime I dial up).
Only it does not work in that fashion. Following is the first section
of the script (minus the iptables ruleset).
#!/bin/sh
echo -e "\n\nSETTING UP IPTABLES FIREWALL..."
INTIF="eth0"
# Enter the NETWORK address the Internal Interface is on
INTNET="192.168.0.0/24"
# Enter the IP address of the Internal Interface
INTIP="192.168.0.1/24"
EXTIF="ppp0"
EXTIP="`/sbin/ifconfig ppp0 | grep 'inet addr' | awk '{print $2}' | sed
-e 's/.*://'`"
.......
I suspect the script is bombing because it seeks ppp0 before the
interface is actually registered?
I've tried adding a "sleep 30" line at the start.
Is there any way I can debug this to see why it is failing?
Thanks for any tips,
Georg Simmel
I have a dialup debian box that serves as a gateway for my home LAN.
I have a firewall/ipmasq script (from the iptables HOWTO) that runs fine
after the ppp0 interface comes up. I'd like to have it work
automagically everytime I establish the connection, and therefore I have
the script in /etc/ppp/ip-up.d (I am getting sick of executing
/etc/ppp/ip-up.d/firewall.sh by hand everytime I dial up).
Only it does not work in that fashion. Following is the first section
of the script (minus the iptables ruleset).
#!/bin/sh
echo -e "\n\nSETTING UP IPTABLES FIREWALL..."
INTIF="eth0"
# Enter the NETWORK address the Internal Interface is on
INTNET="192.168.0.0/24"
# Enter the IP address of the Internal Interface
INTIP="192.168.0.1/24"
EXTIF="ppp0"
EXTIP="`/sbin/ifconfig ppp0 | grep 'inet addr' | awk '{print $2}' | sed
-e 's/.*://'`"
.......
I suspect the script is bombing because it seeks ppp0 before the
interface is actually registered?
I've tried adding a "sleep 30" line at the start.
Is there any way I can debug this to see why it is failing?
Thanks for any tips,
Georg Simmel