hi,
Quote:
My requirement is, the requests come from external network on port 21 should be redirected to port 10000.
|
a little bit unclear,
there are 2 redirection mode in iptables :
using DNAT (can be in POSTROUTING & PREROUTING NAT table)
and or REDIRECT (just in PREROUTING NAT table).
so, to which NIC (external or internal) your external_port_21 traffic should be redirect?
DNAT :
iptables -t nat -I POSTROUTING -i external_NIC -p tcp --dport 21 -j DNAT --to-destination internal_server
ort
REDIRECT :
iptables -t nat -I PREROUTING -i external_NIC -p tcp --dport 21 -j REDIRECT --to-port port
or $man iptables