Skip to main content

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
code:
echo 1 > /proc/sys/net/ipv4/ip_forward
enable ipv4 package forwarding.

code:
iptables -f
flush existing rules in chains.

read default nat chain (that dosent show iptables --list), called nat. correct or have misunderstood something?
, iptables -f flush chain or u need execute
code:
iptables -t nat -f
by itself.

found following 2 lines configuring nat -> http://pastebin.com/fenbvczx
code:
# nat iptables -t nat -a postrouting -o eth0 -j masquerade iptables -a forward -i eth0 -o eth1 -m state --state related,established -j accept
can tell me
  1. whats postrouting does(cant find in iptables man or manual it). chain or option??
  2. whats masquerade? i've tried find on google does, dont clear answer.
  3. 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

Popular posts from this blog

NIK SELECTIVE TOOL INTERMITTANT FAILURE.

Thread: Raspberry pi wont get past the login menu!!!