Thread: Iptables & NAT
hey.
trying configure server iptables nat (with overload, nat multiple local adresses 1 public address port numbers) local network(192.168.0.0) wan(83.151.x.x) network.
, been looking @ few guides, sytnax accomplish (to me) complex , easy misunderstand.
i'am here advice.
have found
enable ipv4 package forwarding.code:echo 1 > /proc/sys/net/ipv4/ip_forward
flush existing rules in chains.code:iptables -f
read default nat chain (that dosent show iptables --list), called nat. correct or have misunderstood something?
, iptables -f flush chain or u need execute
by itself.code:iptables -t nat -f
found following 2 lines configuring nat -> http://pastebin.com/fenbvczx
can tell mecode:# nat iptables -t nat -a postrouting -o eth0 -j masquerade iptables -a forward -i eth0 -o eth1 -m state --state related,established -j accept
- whats postrouting does(cant find in iptables man or manual it). chain or option??
- whats masquerade? i've tried find on google does, dont clear answer.
- the above nat local wan can tell, saying in second line append forward chain -i (the inside local interface) ethx -o (the outside global interface) ethxx -m (unsure state after -m does) state --state state1,state2 -j accept, correct understood?
hope can me cast light on topic.
on advance.
kind regards.
yes, need flush nat table independent of others.
myself, prefer use snat instead of masquerade. preform function of nat (network address translation) packets somewhere in 192.168.0.0 network seem have come 83.151.x.x.
state matching module accepting packets part of existing connection. typically, allows reply packets sent out , way seperate packets want others.
postrouting (and prerouting) chain, sort of, not same sense others. typically, consulted "new" connections pathways established subsquent packet flow through iptables , connection tracking table. (my description little inaccurate, simplified).
reference: http://bodhizazen.net/tutorials/iptables/
other references:
http://tldp.org/howto/ip-masquerade-howto/index.html
http://www.frozentux.net/iptables-tu...-tutorial.html
careful, there great many obsolete "iptables how to"s out there.
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Iptables & NAT
Ubuntu
Comments
Post a Comment