Switching between networks that use dhcp and ones which require static ip configuration is a pain with the existing net.eth scripts. This was actually one of the really few things Windows XP has done very well--it allows an alternate (fixed) ip configuration to be specified in the event that dhcp fails. I have modified the net.eth0 script from baselayout v. 1.8.11 to include the ability to specify an alternate configuration in /etc/conf.d/net and have it applied to the eth device if dhcp fails. The patch is attached. Reproducible: Always Steps to Reproduce: 1.Switch between dhcp-capable and dhcpless networks 2./etc/init.d/net configuration will work for one or the other, but not both Actual Results: Works for either dhcp network or fixed network, but not both. Expected Results: After apply the attached patch, it will work nicely in either network.
Created attachment 29601 [details, diff] net.eth0 patch file Adding the patch, posted in Documentation Tips & Tricks forum: http://forums.gentoo.org/viewtopic.php?t=163212
*** This bug has been marked as a duplicate of 50179 ***
*** Bug 50179 has been marked as a duplicate of this bug. ***
Reverse duplicates and re-open this bug
Thanks for the idea and patch. I modified the patch some, but the basic idea is still the same. I changed the variable from ifconfig_alt_ethX to ifconfig_fallback_ethX to disambiguate this from any other use of the word "alt" or "alternate" I will attach my patch for your review and put this in rc-scripts cvs. It will appear in the next version of baselayout
Created attachment 30890 [details, diff] actual patch applied to rc-scripts cvs
i'm not sure if this is related, but since the new baselayout is out, i no longer can use dhcp. it always uses ifconfig_fallback_eth0
Cool - just one additional wish: Could you add some comments (perhaps with example) into the /etc/conf.d/net file? It would have spared me a lot of time because I would have known this feature existed. I have found it while studying the /etc/init.d/net.eth0 script ...
1.11.x supports ifconfig_fallback_ so that if dhcp fails, it'll use that