Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have read that there are many types of NATs available like symmetric NAT, full-cone NAT, etc. If I am behind a NAT, is there any way to find out the type of NAT behind which I am currently working on?

I setup my own Ubuntu desktop as a NAT machine using the basic iptables rules and by adding one more NIC card. I used the following rules:

$ iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
$ iptables -t filter -A FORWARD --in-interface eth1 -j ACCEPT

Is there any way I can see my NAT table?

share|improve this question
add comment

2 Answers

You will need to run a client that connects to a server (that is not behind a NAT) based on STUN that will analyze your packets and return information. Additionally, TURN is a bit newer and also returns information to help identify the NAT type.

Here are some clients, stacks, software packages that may work. You will have to compile and find a server to connect to, or run your own server.

share|improve this answer
add comment

You can run iptables -S to dump a list of all the rules currently loaded into the filter tables in the kernel. You can optionally add a -t argument to specify a specific table to dump.

From man iptables:

   -S, --list-rules [chain]
          Print all rules in the selected chain.  If no chain is selected,  
          all chains  are  printed  like  iptables-save.Like every other  
          iptables command, it applies to the specified table (filter is  
          the default).

As for knowing what kind of NAT you are behind as a client, it's not readily available information. At most you can deduce how it is probably setup from looking at what it does to your traffic.

share|improve this answer
    
Can you please give me some idea how i can check that how my source ip address is modified in the path between me and destination host..is there any algorithm for this..which protocol can be used for this...can we do it using ICMP protocol? –  pradeepchhetri Nov 21 '11 at 4:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.