Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 38210

Summary: net.eth?: Add hook to run script before ifconfig (for wireless, etc.)
Product: Gentoo Linux Reporter: Luke Maurer (Jyrinx) <Luke.Maurer>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: enhancement CC: joerg
Priority: High Keywords: Inclusion
Version: 1.4_rc4   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Modified net.eth0 to run script before ifconfig step
New /etc/conf.d/net with comments on new preifup option
ifupdown proof of concept

Description Luke Maurer (Jyrinx) 2004-01-14 13:33:06 UTC
I believe this would be a good, simple solution for the old where-to-configure-my-wireless-card-before-ifconfigging question. The patch simply adds a "preifup_$IFACE" option to /etc/conf.d/net, specifying an executable to be run immediately before any ifconfig calls. In my personal use case (a common one, I expect, judging by forum traffic concerning wireless), I just need to run a quick iwconfig script before dhcpcd is called for the wireless interface.

(Another nice thing is that this offers an obvious, simple way for people to add more complicated scripts that, for instance, configure differently for different ESSIDs, etc.)

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Luke Maurer (Jyrinx) 2004-01-14 13:34:37 UTC
Created attachment 23817 [details, diff]
Modified net.eth0 to run script before ifconfig step
Comment 2 Luke Maurer (Jyrinx) 2004-01-14 13:35:52 UTC
Created attachment 23818 [details, diff]
New /etc/conf.d/net with comments on new preifup option
Comment 3 Seemant Kulleen (RETIRED) gentoo-dev 2004-01-14 15:31:02 UTC
speaking of which, jay :P
Comment 4 Roy Marples (RETIRED) gentoo-dev 2004-04-30 04:02:04 UTC
Someone close this bug as net.eth0 in baselayout >= 1.8.8 has this functionality by allowing custom preup() and predown() functions
Comment 5 Aron Griffis (RETIRED) gentoo-dev 2004-04-30 09:01:08 UTC
Yep
Comment 6 SpanKY gentoo-dev 2004-06-02 11:23:03 UTC
*** Bug 52763 has been marked as a duplicate of this bug. ***
Comment 7 Jörg Hoh 2004-07-23 02:02:23 UTC
Created attachment 35994 [details]
ifupdown proof of concept

I've created a small python script, which imitates the debian ifup/ifdown
mechanism and is more flexible than the current shellscript. 

This script is more a proof of concept than a ready-to-ship tool. At the moment
it lacks a proper error handling, pre-up and post-down scripting mechanisms and
a proper handling of other kind of devices (pppoe, plip, ...). It relies
heavily on /sbin/ip, which does the real work (setting addresses, routes,
bringing devices up and down).

The tgz includes a small example of the configuration file, which illustrates
the possibilites of ifup/ifdown. Note: make ifdown a link to ifup