Re: renaming name of interfaces

2013-06-05 Thread Henning Brauer
* Jiri B ji...@devio.us [2013-03-14 16:32]:
 Situation: onboard network card is broken and was used in OS.
 You just plug additional network card, and disable the old
 one via `config' (is this right?). The policy in your
 setup is the order of network cards make some logic:
 * 1st backup/installation
 * 2nd service
 * 3rd admin access
 Now you don't use old broken card but you can't make new
 one being first for example. I don't say this is good
 design but I saw it used a lot in my previous job.
 Renaming new card to old one is impossible.

if you had used a one-member interface group to refer to that
interface in the first place you'd only had to deal with the
hostname.if file, at least in many scenarios.

-- 
Henning Brauer, h...@bsws.de, henn...@openbsd.org
BS Web Services, http://bsws.de, Full-Service ISP
Secure Hosting, Mail and DNS Services. Dedicated Servers, Root to Fully Managed
Henning Brauer Consulting, http://henningbrauer.com/



Re: renaming name of interfaces

2013-03-15 Thread Stuart Henderson
On 2013-03-15, Lars Hansson romaby...@gmail.com wrote:
 On Thu, Mar 14, 2013 at 10:22 PM, Jiri B ji...@devio.us wrote:

 I'm aware of both. So what is this renaming of ifaces good
 for?


 On Windows it has it's advantages because by default you get stupid and
 unhelpful names like Local Area Connection X.
 It's pretty nice to be able to rename it to something useful like Internal
 NIC.

This is more like setting 'descr', the difference is that Windows
usually hides the real name it uses for the interface.



Re: renaming name of interfaces

2013-03-14 Thread Peter N. M. Hansteen
On Thu, Mar 14, 2013 at 07:12:08AM -0400, Jiri B wrote:
 
 just for curiosity, is it planned for future?
 
 I can't just now think about real usability...

Me neither. For most use cases I can think of, interface groups (a feature we 
do have, see ifconfig(8) and possibly other references elsewhere) will give 
you what others have implemented interface renaming for.

- Peter (whose current pet hate is Solaris11's 'vanity names' for interfaces)

-- 
Peter N. M. Hansteen, member of the first RFC 1149 implementation team
http://bsdly.blogspot.com/ http://www.bsdly.net/ http://www.nuug.no/
Remember to set the evil bit on all malicious network traffic
delilah spamd[29949]: 85.152.224.147: disconnected after 42673 seconds.



Re: renaming name of interfaces

2013-03-14 Thread Christian Weisgerber
Peter N. M. Hansteen pe...@bsdly.net wrote:

 Me neither. For most use cases I can think of, interface groups (a feature we 
 do have, see ifconfig(8) and possibly other references elsewhere) will give 
 you what others have implemented interface renaming for.

There are also interface descriptions.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: renaming name of interfaces

2013-03-14 Thread Jiri B
On Thu, Mar 14, 2013 at 02:10:40PM +, Christian Weisgerber wrote:
 Peter N. M. Hansteen pe...@bsdly.net wrote:
 
  Me neither. For most use cases I can think of, interface groups (a feature 
  we 
  do have, see ifconfig(8) and possibly other references elsewhere) will give 
  you what others have implemented interface renaming for.
 
 There are also interface descriptions.

I'm aware of both. So what is this renaming of ifaces good
for? Like /etc/mactab in Linux... I've thought I have usage
for this but then I discovered I did bad testing and reorder
of nics was my issue in RHEVM/kvm world.

So what is this good for in other OS?

jirib



Re: renaming name of interfaces

2013-03-14 Thread Jiri B
On Thu, Mar 14, 2013 at 12:17:50PM +0100, Peter N. M. Hansteen wrote:
 On Thu, Mar 14, 2013 at 07:12:08AM -0400, Jiri B wrote:
  
  just for curiosity, is it planned for future?
  
  I can't just now think about real usability...
 
 Me neither. For most use cases I can think of, interface groups (a feature we 
 do have, see ifconfig(8) and possibly other references elsewhere) will give 
 you what others have implemented interface renaming for.

Situation: onboard network card is broken and was used in OS.
You just plug additional network card, and disable the old
one via `config' (is this right?). The policy in your
setup is the order of network cards make some logic:
* 1st backup/installation
* 2nd service
* 3rd admin access
Now you don't use old broken card but you can't make new
one being first for example. I don't say this is good
design but I saw it used a lot in my previous job.
Renaming new card to old one is impossible.

jirib



Re: renaming name of interfaces

2013-03-14 Thread Nick Holland

On 03/14/2013 11:31 AM, Jiri B wrote:

On Thu, Mar 14, 2013 at 12:17:50PM +0100, Peter N. M. Hansteen wrote:

On Thu, Mar 14, 2013 at 07:12:08AM -0400, Jiri B wrote:


just for curiosity, is it planned for future?

I can't just now think about real usability...


Me neither. For most use cases I can think of, interface groups (a feature we
do have, see ifconfig(8) and possibly other references elsewhere) will give
you what others have implemented interface renaming for.


Situation: onboard network card is broken and was used in OS.
You just plug additional network card, and disable the old
one via `config' (is this right?). The policy in your
setup is the order of network cards make some logic:
* 1st backup/installation
* 2nd service
* 3rd admin access
Now you don't use old broken card but you can't make new
one being first for example. I don't say this is good
design but I saw it used a lot in my previous job.
Renaming new card to old one is impossible.


disable the on-board card in BIOS, or since you obviously aren't 
repairing the board, pry the chip off the mobo (yes, I've done 
this...friend of mine gave me some re-badged Sokris 4501 machines with 
bad NICs -- I popped off dead chip (it was the one getting too hot), and 
suddenly my remaining ones became sis0 and sis1 (and the heat generation 
dropped a lot).  A little hot glue in the deactivated port, and I now 
have a perfectly good 2 port Soekris.


But really...if you are living with dead on-board hardware, you need to 
have the ability to make exceptions to policies like that...and in all 
cases, some kind of labeling should be done.



[elsewhere in thread]
 So what is this good for in other OS?
...
other OSs have really stupid naming conventions.
They make up for the problems with their naming conventions by adding 
features.  Those features create new problems, which are solved by 
adding other features.  Those features create new problems, so that 
creates opportunity to make MORE features.


And everyone knows, the more features you have, the better it is, 
right?  The OS with the most features wins!


OpenBSD is for losers who actually have to get work done, not just 
fiddle with time-saving features all day.


(yes, the default naming convention of OpenBSD causes some problems, but 
they are easy to understand and easy to deal with.  Certainly easier 
than the fixes that try to eliminate dealing with the simple problems 
by creating massive problems)



Me?  If I have two identical machines with RAID 1 disks, and I have one 
configured Just Like I Want It, I think I should be able to pull one 
drive from the configured machine, pop both drives out of the second 
machine, stick the removed disk from the configured machine in the 
secondary, change the IP address and machine name, maybe remove the host 
SSH keys, and be up and running.  I should then be able to insert the 
two free drives into the open slots and have the mirrors rebuild.


OR, if a machine fails and I have an identical machine, I should be able 
to remove the disks, put them in the spare machine, plug the wires in 
the same place in the spare machine, power on and be back in operation 
with ZERO reconfiguration.  This is something I should be able to walk a 
non-technical person through over the phone (i.e., secretary, janitor. 
Not managers, I have given up walking them through things).


This Just Works on OpenBSD.  It doesn't work easily in most other OSs.

Nick.



Re: renaming name of interfaces

2013-03-14 Thread Peter N. M. Hansteen
On Thu, Mar 14, 2013 at 11:31:29AM -0400, Jiri B wrote:
 Situation: onboard network card is broken and was used in OS.
 You just plug additional network card, and disable the old
 one via `config' (is this right?). The policy in your
 setup is the order of network cards make some logic:
 * 1st backup/installation
 * 2nd service
 * 3rd admin access
 Now you don't use old broken card but you can't make new
 one being first for example. I don't say this is good
 design but I saw it used a lot in my previous job.
 Renaming new card to old one is impossible.

If all those interfaces are of the same kind (using the same driver),
you may face a renumbering situation, true. 

But there are several factors that would make the pain a lot smaller with
OpenBSD than a few other contenders in the general case.  For one thing 
your network interfaces are named driverN (xl0, nfe0 and so on), in 
contrast to Linux' ethN where renumbering does happen and is a common cause
of major confusion (or at least did back when I had a few moderately complex
Linux boxes). If you can swap out the card with another one of the same type
(probably not an option if it's an onboard version) in the same slot you 
probably
will be OK, and if your new card is a different make, all you need to do is some
minor editing of config files and maybe a mv or two of hostname.* files.

- P
-- 
Peter N. M. Hansteen, member of the first RFC 1149 implementation team
http://bsdly.blogspot.com/ http://www.bsdly.net/ http://www.nuug.no/
Remember to set the evil bit on all malicious network traffic
delilah spamd[29949]: 85.152.224.147: disconnected after 42673 seconds.



Re: renaming name of interfaces

2013-03-14 Thread Alexey E. Suslikov
Jiri B jirib at devio.us writes:

 I'm aware of both. So what is this renaming of ifaces good
 for? Like /etc/mactab in Linux... I've thought I have usage
 for this but then I discovered I did bad testing and reorder
 of nics was my issue in RHEVM/kvm world.

hey, this is OpenBSD, which is neither forcing you,
nor restricting to use your brain :)

/etc/netstart brings all networks related stuff up.

if your virtualization environment changes an order
but preserves MAC addresses (which most hypervisors
do by generating MACs at virtual machine creation,
interface addition, etc), you can write a little
shim on top of /etc/netstart which will assign
unique group to interface with a given MAC address.

after that and all /etc/netstart juggling, pf may
filter on groups instead of interface names.

with decent shell programming skills, writing such
a shim should take less than hour including testing.



Re: renaming name of interfaces

2013-03-14 Thread Alexander Hall
On 03/14/13 20:15, Alexey E. Suslikov wrote:
 Jiri B jirib at devio.us writes:
 
 I'm aware of both. So what is this renaming of ifaces good
 for? Like /etc/mactab in Linux... I've thought I have usage
 for this but then I discovered I did bad testing and reorder
 of nics was my issue in RHEVM/kvm world.
 
 hey, this is OpenBSD, which is neither forcing you,
 nor restricting to use your brain :)
 
 /etc/netstart brings all networks related stuff up.
 
 if your virtualization environment changes an order
 but preserves MAC addresses (which most hypervisors
 do by generating MACs at virtual machine creation,
 interface addition, etc), you can write a little
 shim on top of /etc/netstart which will assign
 unique group to interface with a given MAC address.
 
 after that and all /etc/netstart juggling, pf may
 filter on groups instead of interface names.
 
 with decent shell programming skills, writing such
 a shim should take less than hour including testing.

Challenge accepted;

# ifconfig | awk 
'/^[a-z]/{i=$1;sub(/:/,,i)}/^\tlladdr/{gsub(/:/,,$2);system(ifconfig i 
group _$2_)}'

ksh, sed and other variants will likely be more complex.

/Alexander



Re: renaming name of interfaces

2013-03-14 Thread Lars Hansson
On Thu, Mar 14, 2013 at 10:22 PM, Jiri B ji...@devio.us wrote:

 I'm aware of both. So what is this renaming of ifaces good
 for?


On Windows it has it's advantages because by default you get stupid and
unhelpful names like Local Area Connection X.
It's pretty nice to be able to rename it to something useful like Internal
NIC.


Lars