Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am setting up a router based on a linux kernel. As expected, ipv4 packets received on the interface used by default route are sent back to the same interface in case no other route is found.

Is there a way to prevent ipv4 packets received on the default route interface to be sent back to the same interface? I want the packets to be dropped instead of being sent back.

I have been looking in /proc/sys/net/ipv4/conf but didn't find anything. My hope is to find a simple setting somewhere instead of using ip tables.

share|improve this question

migrated from stackoverflow.com May 28 '13 at 1:05

This question came from our site for professional and enthusiast programmers.

1 Answer 1

I have not found any simple setting. However, it is quite easy to solve the problem using iptables:

iptables -I FORWARD -i eth2 -o eth2 -j DROP

where eth2 is the interface used by the default route.

share|improve this answer

Your Answer

 
discard

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