Log in

Bekijk de volledige versie : post-firewall script is not being executed



Fama
06-08-2005, 23:36
After I had overcome all troubles with setting up the post-firewall script (to get the thttpd Server running) I realized that the script is not being called after reconnecting to ISP and rebooting the router.
post-boot and post firewall are in the same folder and post-boot is being executed.
As soon as I call:


iptables -I INPUT 2 -p tcp --dport 80 -j ACCEPT
iptables -I INPUT 2 -p tcp --dport 81 -j ACCEPT

both ports are reported as open and the webserver is working.

Is it correct, that /usr/local is linked to /tmp/local ?


[admin@(none) /usr]$ ls -F
X11R6/ codepages/ lib/ sbin/
bin/ etc/ local@ tmp@
[admin@(none) /usr]$

Oleg
07-08-2005, 08:16
Do you've #!/bin/sh as the first line?
Yes, the links are correct.

Fama
07-08-2005, 09:37
Do you've #!/bin/sh as the first line?
Yes, the links are correct.

this is my post-firewall:


[admin@(none) root]$ cat /tmp/local/sbin/post-firewall
#!/bin/sh
iptables -I INPUT 2 -p tcp --dport 80 -j ACCEPT
iptables -I INPUT 2 -p tcp --dport 81 -j ACCEPT
iptables -t nat -A PREROUTING -i $1 -p tcp --dport 80 -j DNAT --to-destination $4:81
[admin@(none) root]$

Oleg
07-08-2005, 09:59
Which connection type do you have?

Fama
07-08-2005, 18:48
Which connection type do you have?
PPPoE

I have PPPoE Relay disabled, could this be the problem?

sup
09-08-2005, 02:14
can you run the script manually? (ergo
/tmp/local/sbin/post-firewall )
(it would give back some error messages since variables such as $1 would not be recognized)

Fama
09-08-2005, 09:14
I think, I got it working now, I lost all my settings after changing something in the webinterface and restarting the router.
After setting up post-boot and post-firewall from scratch, the ports are finally open without me having to open them manually.
I'll wait until tonight (the next reconnect to the isp) in order to see if it really is working now. If not, I'll try to run the script as stated below.

can you run the script manually? (ergo
/tmp/local/sbin/post-firewall )
(it would give back some error messages since variables such as $1 would not be recognized)