The network startup scripts net.eth0 and its clones lack some kind of miscellaneous setup option. For example there could be some variables in /etc/conf.d/net where one can do sth like iface_eth0_pre_up="/sbin/ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX" or iface_eth0_post_up="/sbin/route add net_to_default_gateway" or even iface_eth0_post_up="/sbin/brctl addif br0 eth0" instead of hard coding it to the scripts. Having this options would be nice because all network configuration options except for ppp should stay in /etc/conf.d/net. Thanks and bye Frank Benkstein.
Obviously new baselayout 1.8.11 adds {pre,post}{up,down} functions to net.eth0 which is I think the best way to do it. Thank you. It lacks documentation so I'm putting the solution to one of my problems here. In /etc/conf.d/net: <code> # this function is executed for every network interface before bringing it up function preup () { case "$1" in eth1) # this is not automatically created, is it? [ ! -d ${svcdir}/options/net.$1 ] && mkdir -p \ ${svcdir}/options/net.$1 # saving real hw address /sbin/ifconfig $1 | awk '/^'$1'/ {print $5}' > \ ${svcdir}/options/net.$1/real-hw # setting new, fake hw address /sbin/ifconfig $1 hw ether XX:XX:XX:XX:XX:XX ;; esac } # this function is executed for every network interface after bringing it down function postdown() { case "$1" in eth1) /sbin/ifconfig $1 hw ether \ `cat ${svcdir}/options/net.eth1/real-hw` ;; esac } </code> Should I work out the bridging example, too? Btw.: I'm behind a firewall I don't have access to which restricts internet access by mac address checking. I still have the network card whose mac address is registered with the firewall but I'm both too lazy to find it and to tell the admin the new mac ;-). PS: I think this bug can be marked as fixed.
Ok, full documentation for preup/predown/postup/postdown is now in /etc/conf.d/net as of baselayout-1.10