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

Will this rules make kernel to see the same packet at least twice?

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE                                                                   
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE                                                                    

Found the stuff in a forgotten config file. A remark about option "-d 0/0" was also there, did this option makes sense when certain log targets are used in iptables - to avoid incorrect traffic calculation?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

No, packets will not be seen twice. Only one of those two iptables rules will ever match a given packet, since a packet cannot exit the system by two different network interfaces at the same time. The routing algorithm always selects (at most) one output interface.

share|improve this answer

-o specifies that a particular packet is to be tested for its interface, it does not specify that a packet is to leave by that interface. (The latter would be routing and is controlled by ip route.)

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.