0

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.

1 Answer 1

0

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.

You must log in to answer this question.