Linux - Kernel network parameters
Welcome to the tutorial guide. The guide will provide a user with guidance and instructions on Kernel network parameters. Please note that the kernel has lots of parameters which can be tuned for different circumstances.
By default, routers can route everything including packets which do not belong on the users network. For example, a common example is private IP space escaping onto the Internet. If a user has an interface with a route of 195.96.96.0/24 to it, a user will not expect packets from 212.64.94.1 to arrive there.
Lots of people would like to turn this feature off, so the kernel hackers have made it easy. There are files in /proc where a user can tell the kernel to do this for a user. The method is called “Reverse Path Filtering”. Basically, if the reply to a packet wouldn’t go out the interface this packet came in, then this is a bogus packet and should be ignored.
The following fragment will turn this on for all current and future interfaces.
# for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do
> echo 2 > $i
> done
By putting this example into practice, if a packet arrived on the Linux router on eth1 claiming to come from the Office+ISP subnet, it would be dropped. Similarly, if a packet came from the Office subnet, claiming to be from somewhere outside a users firewall, it would be dropped also.
The above is full reverse path filtering. The default is to only filter based on IPs that are on directly connected networks. This is because the full filtering breaks in the case of asymmetric routing (where packets come in one way and go out another, like satellite traffic, or if a user has dynamic routes in the his/her network. The data comes down through the satellite dish and replies go back through normal land-lines).
If this exception applies to the user then the user can simply turn off the rp_filter on the interface where the satellite data comes in. If a user wants to see if any packets are being dropped, the log_martians file in the same directory will tell the kernel to log them to his/her syslog.
# echo 1 >/proc/sys/net/ipv4/conf//log_martians
If you followed this tutorial guide, then you would have learnt about kernel network parameters













