I spent a fair amount of time in the last couple of days trying to do some fairly advanced configuration of network interfaces on a couple of Ubuntu boxes today. Basically the Debian package ifup when run will run every script in /etc/network/if-up.d/ it set’s the environment variable IFACE for each script while doing this. This means if you want to run a script only when one interface comes up, (possibly for a firewall) you can use the line in your script
if [ "$IFACE" = "eth0" ]; then
As a side note, the reason I’m using Ubuntu for these machines is it’s reasonably fast development cycle and it’s Debian underpinnings. Packages like ifup are part of this, it works exceptionally well and is reasonably easy to use, the biggest problem however is it’s documentation. Nowhere in the man files or on a few searches of the net could I find this information.