We help IT Professionals succeed at work.

View current nat connections

Kocil
Kocil asked
on
5,321 Views
Last Modified: 2012-08-14
Dear experts.

This is on a Linux firewall, with iptables masquerading.
What is the command to view all active NAT connections ?

Thanks.

Comment
Watch Question


Using "netstat -a"  you can view active connections (not especially NAT).
But it may help.
Regards

Author

Commented:
I tried that
-----------------
root@firewall:~# netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:swat                  *:*                     LISTEN      
tcp        0      0 *:time                  *:*                     LISTEN      
tcp        0      0 *:finger                *:*                     LISTEN      
tcp        0      0 *:auth                  *:*                     LISTEN      
tcp        0      0 *:ftp                   *:*                     LISTEN      
tcp        0      0 *:ssh                   *:*                     LISTEN      
udp        0      0 *:biff                  *:*                                
udp        0      0 *:ntalk                 *:*                                
udp        0      0 *:time                  *:*                                
raw        0      0 *:tcp                   *:*                     7          
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  3      [ ]         DGRAM                    152    /dev/log
unix  2      [ ]         DGRAM                    234    

-----------------

But I think that is not what I want.
I want to see NAT connections that are going THROUGH this firewall.

[clients (intranet)]-------------->[firewall (NAT)]--------------->[servers(intranet)]

So I know which client is connected to which server.

Thanks.


Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
depends how you define "connection"
most reliable/complete would be brabard's suggestion
/proc/net/ip_conntrack just gives "established" connections, probably not enough for you ..

Author

Commented:
Ok.
Answer from brabard and khkremercomplement each other.
I need both of them.

Thanks all.
use iptstate
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.