Another newbie question

Florin Andrei florin at andrei.myip.org
Mon Jan 2 03:12:25 UTC 2006


On Sun, 2006-01-01 at 19:51 -0700, Craig Cameron wrote:

> The problem this time is the document I'm using advises to put the
> following code in the startup script for the interfaces.It's supposed
> to be for spoofed packekts:
> 
> For x in lo eth0 eth1 
> Do  
> Echo 1 > /proc/sys/net/ipv4/${x}/rp_filter 
> Done
> 
> The only startup script I can find that brings up the interfaces is: 
> /etc/rc.d/rc3.d/S10network
> 
> Is it safe to add the above code to this file, or is there another
> script I should be modifiying.

# tail -n 5 /etc/sysconfig/network-scripts/ifup-post
if [ -x /sbin/ifup-local ]; then
    /sbin/ifup-local ${DEVICE}
fi

exit 0

So in theory if you create /sbin/ifup-local and make it executable
(chmod +x /sbin/ifup-post), it should be executed every time an
interface goes up, after the interface is up and running; the name of
the interface is passed as a parameter.

In your case, the content of /sbin/ifup-post would be:

#!/bin/sh
echo 1 > /proc/sys/net/ipv4/${1}/rp_filter

I cannot guarantee that it works, but give it a shot.

If it works, then you can consider it the "official" way to execute
something after an interface has been brought up.

-- 
Florin Andrei

http://florin.myip.org/




More information about the fedora-list mailing list