| Summary: | Can't set interface arguments for dhcp configured interfaces | ||
|---|---|---|---|
| Product: | Base System | Reporter: | neil |
| Component: | conf | Assignee: | Doug Barton <dougb> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.3-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
neil
2001-09-08 23:10:00 UTC
Hey folks,
I just ran into this problem, and here's my proposed fix for it. Feel free to
incorporate it, or not. =)
Index: rc.network
===================================================================
RCS file: /home/ncvs/src/etc/rc.network,v
retrieving revision 1.134
diff -c -r1.134 rc.network
*** rc.network 2002/04/11 22:06:27 1.134
--- rc.network 2002/05/08 19:01:20
***************
*** 211,219 ****
case ${ifconfig_args} in
'')
;;
! [Dd][Hh][Cc][Pp])
# DHCP inits are done all in one go below
dhcp_interfaces="$dhcp_interfaces $ifn"
eval showstat_$ifn=1
;;
*)
--- 211,225 ----
case ${ifconfig_args} in
'')
;;
! [Dd][Hh][Cc][Pp])
# DHCP inits are done all in one go below
dhcp_interfaces="$dhcp_interfaces $ifn"
eval showstat_$ifn=1
;;
*)
--- 211,225 ----
case ${ifconfig_args} in
'')
;;
! *[Dd][Hh][Cc][Pp]*)
# DHCP inits are done all in one go below
dhcp_interfaces="$dhcp_interfaces $ifn"
+ # eat the DHCP token, and apply any other args.
+ ifconfig_args=`echo $ifconfig_args \
+ | sed s/[Dd][Hh][Cc][Pp]//`
+ if [ -n "${ifconfig_args}" ]; then
+ ifconfig ${ifn} ${ifconfig_args}
+ fi
eval showstat_$ifn=1
;;
*)
later,
Neil
--
Neil Bliss - Monta Vista Technical Support
Yow!-Zippy-says: I once decorated my apartment entirely in ten foot salad forks!!
In message <20020513091319.G7743@dhcp117.mvista.com>, Neil Bliss writes: >Actually, it's not anything to do with the dhcp client. What you're needing to >be able to do here is to be able to pass any additional ifconfig arguments that >the card will need to be able to be used. In my particular case, I'm using a >wireless ethernet card, and I need to give it the correct ssid for it to get >signal at ifconfig time. With the current setup, if I'd like this interface to >use dhcp, then that's the *only* thing you can tell rc.network about this card. dhclient.conf is actually a much more useful place to put such commands, because dhclient can automatically cycle through different combinations of ifconfig settings, picking the first one on which it successfully gets a lease (thanks to Kurt Lidl for pointing this out to me a while ago). For example, I use something like this: interface "wi0" { media "wepmode on wepkey 0x0000000000", "wepmode on wepkey 0x1111111111", "wepmode off"; } You can list the settings for any networks you use, and then plugging in the card just works where ever you are. Ian State Changed From-To: open->feedback I think Ian's example (which was added to the audit trail) more clearly illustrates the point I was trying to make. If you use DHCP to configure your interface, you should use DHCP to configure your interface. The right place for additional interface configuration is dhclient.conf(5) not rc.conf(5). Is there some interface configuration that you still cannot accomplish through dhclient.conf(5)? State Changed From-To: feedback->closed dhclient.conf is the proper place to handle this. Responsible Changed From-To: freebsd-bugs->dougb I closed this one. |