PDA

Bekijk de volledige versie : Please help, got problem with post-firewall



freakazoid
31-10-2007, 09:11
Hello,

i've been trying to configure my WL-500gP box (with 1.9.2.7-7g oleg firmware) to create a thhtpd server on it and i can't seem to connect to it other way than to tipe in the port (81) next to ip.I think i've got a problem with post-firewall booting. I used this how-to for the server:

http://www.macsat.com/macsat/content/view/23/29/

my post-firewall is like this:

#!/bin/sh
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 81 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i $1 -p tcp --dport 80 -j DNAT --to-destination $4:81

iptables -A INPUT -j DROP


when i try to start ./post-firewall i get this:

Warning: wierd character in interface `-p' (No aliases, :, ! or *).
Bad argument `tcp'
Try `iptables -h' or 'iptables --help' for more information.
#

Can anybody help me?

thE_29
31-10-2007, 09:56
You have $1 and $4 parameter in your file!

This is for the first argument und the 4th. But the post-firewall aint have any arguments..
You have to change this to sth fixtext!

freakazoid
31-10-2007, 10:04
Im a little of a n00b, so coul'd you gimme a little more detail?

al37919
31-10-2007, 10:28
when i try to start ./post-firewall i get this:
post-firewall is not intended to be started manually without parameters.
However, you still can do that if when starting you supply required parameters.
To see which parameters are supplied to post-firewall automatically during boot-up add to it:
echo "$0 $1 $2 $3 $4 $5 $6" > /tmp/post-firewall.log
After that have a look in /tmp/post-firewall.log