Skip to contentSkip to conversation

Iptables problem

DISCUSSION De Jager Laubscher 2 participants 2 messages Mar 13, 2003

lore
Share & tools
lore
#0 lore raw

Can anyonne please tell me how to open port 1500 to 1511 on my NAT box using iptable on slackeware ??

please help very urgent !

#1 lore raw
Quoted 2 lines

Can anyonne please tell me how to open port 1500 to 1511 on my NAT box using iptable on slackeware ??

You have not written what do you want precisely, so i will give a few examples. But PLEASE READ THE HOWTO, it is very informative. It is vital to know how it all works.
I will assume TCP.
If you want to open these ports _to_ the NAT box use:

# iptables -A INPUT -p tcp --dport 1500:1511 -j ACCEPT

If you want to NAT these ports do:

# iptables -t nat -A PREROUTING -i $EXT -p tcp --dport 1500 -j DNAT \
	--to x.y.z.a

Remember that if doing 1:1 NAT requiers a similar rule for SNAT on POSTROUTING.

If you want to NAT and change the ports do:

# iptables -t nat -A PREROUTING -i $EXT -p tcp --dport 1500 -j DNAT \
	--to x.y.z.a:other_port

of course read also:

# iptables -j DNAT --help
# iptables -j SNAT --help
# iptables -p tcp --help

Regards,
Maciej Soltysiak