Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Here are some rules that I append to filter table, and I list the added output related to each one:

  1. $iptables -A INPUT -i eth0 -j ACCEPT

and the output is:


target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0      

The second command:

  1. $iptables -A INPUT -i eth1 -j ACCEPT

And the appended rule to INPUT chain is the same as the first one:


target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0      

As you see, I changed the source of packets from eth0 to eth1, but I don't see it reflected in the appended rule. Can anybody explain me where is the difference made or how the iptables knows that first rule is related to eth0 and second rule is related to eth1?

Thanks!

share|improve this question
3  
When you list the tables, try adding a -v –  Jon Lin Jan 17 '12 at 7:30
    
@JonLin Thanks! I see the Output very well. You can post your comment as answer I think. Thanks! –  artaxerxe Jan 17 '12 at 7:32

1 Answer 1

up vote 3 down vote accepted

When you list the tables, try adding a -v, which will give you columns for the number of packets/bytes as well as the input and output interfaces.

share|improve this answer

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.