[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Finding the current network devices
Obviously "ifconfig -l" gets the info but I was wondering if I could
depend on the order that is returned.
Here's my problem and my proposed solution. I have a bunch of servers
all running NetBSD running various services. While I tend to run
Proliant servers for everything, there is more than one generation in
the mix. Sometimes the cards are wm and sometimes bge for
example. If I need to move a service over to the spare I make sure
that all the files, including rc.conf, etc. are mirrored using rsync
and then reboot. If I forget to adjust the network cards I am locked
out until I go to the server room. My solution is to add this to the
top of rc.conf:
read eth0 eth1 _ <<< `ifconfig -l`
And then use $eth0 and $eth1 in the ifconfig lines and elsewhere. My
question is whether the ifconfig command is guaranteed to always return
the ethernet cards first, e.g. "wm0 wm1 lo0 pflog0" or "bge0 bge1 lo0
pflog0" as the case may be. If I add the -b option would that be safer?
I also have to figure out how to deal with hard drive differences in
fstab but I don't have a clue how to proceed with that problem.
D'Arcy J.M. Cain <darcy%NetBSD.org@localhost>
Main Index |
Thread Index |