LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables doesn't know what -dport 80 is... ? (https://www.linuxquestions.org/questions/linux-networking-3/iptables-doesnt-know-what-dport-80-is-51791/)

d33pdream 03-26-2003 12:33 AM

iptables doesn't know what -dport 80 is... ?
 
[root@amazon oneiric]# /sbin/iptables -A INPUT -i eth0 -p tcp -dport 80 -j ACCEPT
Bad argument `80'


Why is it giving me an error? This is what otehr threads and netfilter documentation says to type..


I use Redhat 8.0 if that makes any difference.

hereiam 03-26-2003 04:30 AM

Did you try only below command?

iptables -A INPUT -i eth0 -p tcp -dport 80 -j ACCEPT

Hangdog42 03-26-2003 07:22 AM

You might want to post your entire firewall script. It could be something like you never set up the INPUT table.

m0rl0ck 03-26-2003 08:23 AM

try --dport instead of -dport

Pcghost 03-26-2003 12:16 PM

Or stop using lazy shortcuts ( I do it too) and use
--destination-port 80

Darkl0rd 03-26-2003 01:55 PM

you have to specify --dport (two dashes) which is pretty clearly stated in the documentation, the short help and about all the help you can find on the internet.
also you ALWAYS have to specify a protocol to be able to specify a sport / dport (in your case you did -p tcp/udp)

cheers,

Nils

bkeating 04-04-2003 06:22 PM

replaced -dport with --dport and that worked. Thank you :)


All times are GMT -5. The time now is 06:58 AM.