Mira, hay varias tablas por defecto en iptables. Son
filter,
nat y
mangle. Yo uso siempre filter y nat.
Basicamente lo uso asi (con el ejemplo del puerto 80):
No pongo nat ni mangle porque por lo que entiendo tu servidor no hace las funciones de router.
Código:
# Generated by iptables-save v1.3.3 on Tue Oct 31 18:04:57 2006
*filter
:INPUT DROP [129191:12753224]
:FORWARD ACCEPT [28027766:15889704567]
:OUTPUT ACCEPT [7032973:4794159089]
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags ACK ACK -j ACCEPT
-A INPUT -m state --state ESTABLISHED -j ACCEPT
-A INPUT -m state --state RELATED -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
COMMIT
# Completed on Tue Oct 31 18:04:57 2006
# Generated by iptables-save v1.3.3 on Tue Oct 31 18:04:57 2006
*nat
:PREROUTING ACCEPT [754756:56531439]
:POSTROUTING ACCEPT [135995:8705258]
:OUTPUT ACCEPT [468150:31118371]
COMMIT
# Completed on Tue Oct 31 18:04:57 2006
# Generated by iptables-save v1.3.3 on Tue Oct 31 18:04:57 2006
*mangle
:PREROUTING ACCEPT [35955455:20422553355]
:INPUT ACCEPT [7512777:4315365247]
:FORWARD ACCEPT [28441716:16107008080]
:OUTPUT ACCEPT [7178731:4856829829]
:POSTROUTING ACCEPT [35625924:20965166642]
COMMIT