* how to get the entry of NAT table?
@ 2004-03-19 3:17 linqo
2004-03-19 3:27 ` forum
0 siblings, 1 reply; 3+ messages in thread
From: linqo @ 2004-03-19 3:17 UTC (permalink / raw)
To: netfilter
[-- Attachment #1: Type: text/plain, Size: 235 bytes --]
Hi all,
I have a project and I have to get the entries of the NAT table,but I do not know whether the NAT table is maintained dynamicly in the memory and how to get the entries( modifying the IP stacks ? )
Thanks,
--Zhang Dong
[-- Attachment #2: Type: text/html, Size: 662 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how to get the entry of NAT table?
2004-03-19 3:17 how to get the entry of NAT table? linqo
@ 2004-03-19 3:27 ` forum
2004-03-19 7:10 ` Cedric Blancher
0 siblings, 1 reply; 3+ messages in thread
From: forum @ 2004-03-19 3:27 UTC (permalink / raw)
To: netfilter
Try:
iptables -t nat -L
This should print the current nat table entries.
--
forum@users.pc9.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how to get the entry of NAT table?
2004-03-19 3:27 ` forum
@ 2004-03-19 7:10 ` Cedric Blancher
0 siblings, 0 replies; 3+ messages in thread
From: Cedric Blancher @ 2004-03-19 7:10 UTC (permalink / raw)
To: forum; +Cc: netfilter
Le ven 19/03/2004 à 04:27, forum@users.pc9.org a écrit :
> Try:
> iptables -t nat -L
> This should print the current nat table entries.
This should print nat table _rules_...
NAT entries are stored within conntrack table that is accessible through
/proc/net/ip_conntrack. So, you have to parse the file to extract all
entries that have a NAT tuple, i.e. a tuple for which :
orig.src <> return.dst and/or orig.dst <> return.src
Such as this one :
tcp 6 431997 ESTABLISHED src=192.168.1.1 dst=172.16.1.7 sport=33057
dport=80 src=127.0.0.1 dst=127.0.0.1 sport=1080 dport=33057 [ASSURED]
use=1 mark=0
Which is a connection through REDIRECT target. Or this one :
tcp 6 431885 ESTABLISHED src=192.168.1.1 dst=219.24.23.10
sport=32839 dport=993 src=219.24.23.10 dst=215.34.54.67 sport=993
dport=32839 [ASSURED] use=1 mark=0
Which is an IMAPS connection from LAN to external server SNATed by
firewall.
--
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
>> Hi! I'm your friendly neighbourhood signature virus.
>> Copy me to your signature file and help me spread!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-03-19 7:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-19 3:17 how to get the entry of NAT table? linqo
2004-03-19 3:27 ` forum
2004-03-19 7:10 ` Cedric Blancher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.