Re: Feature request: hostname.default

2014-11-12 Thread Stefan Sperling
On Wed, Nov 12, 2014 at 10:11:23AM +0200, Lars Engblom wrote:
 Please consider to add support for a hostname.default. If no hostname.X is
 matching the interface, this file would be used as last resource before
 giving up configuring the interface.

Before configuring _which_ interface?



Re: Feature request: hostname.default

2014-11-12 Thread rjc
On Wed, Nov 12, 2014 at 09:13:37AM EST, Stefan Sperling wrote:

 On Wed, Nov 12, 2014 at 03:26:02PM +0200, Lars Engblom wrote:

  I guess you mean the case of having several network interfaces. Let
  all of the unconfigured interfaces get the IP settings from
  hostname.default and write this in the documentation. It is easier
  to plug in just one cable than having to guess all the names of the
  interfaces (em0, bge0, re0, rl0 etc).

 One problem with this idea is that you can't have the same IP on
 multiple interfaces and expect things to work.

 A recent discussed on misc@ made this quite clear:
 http://marc.info/?l=openbsd-miscm=141564884907430w=2

The scope there was even broader:

PH That is not supported.  You MUST NOT have IPs in the same range on
PH different interfaces.

I think I know what the OP has in mind - having a default IP address
configuration which gets assigned to an interface where media is
present.

The only way I see this working is with only a single Ethernet adaptor
has the cable plugged in - otherwise it gets messy.

One way or another, this shouldn't be too difficult to script and run
from /etc/rc.firsttime.

rjc



Re: Feature request: hostname.default

2014-11-12 Thread Stuart Henderson
On 2014/11/12 09:49, rjc wrote:
 On Wed, Nov 12, 2014 at 09:13:37AM EST, Stefan Sperling wrote:
 
  On Wed, Nov 12, 2014 at 03:26:02PM +0200, Lars Engblom wrote:
 
   I guess you mean the case of having several network interfaces. Let
   all of the unconfigured interfaces get the IP settings from
   hostname.default and write this in the documentation. It is easier
   to plug in just one cable than having to guess all the names of the
   interfaces (em0, bge0, re0, rl0 etc).
 
  One problem with this idea is that you can't have the same IP on
  multiple interfaces and expect things to work.
 
  A recent discussed on misc@ made this quite clear:
  http://marc.info/?l=openbsd-miscm=141564884907430w=2
 
 The scope there was even broader:
 
 PH That is not supported.  You MUST NOT have IPs in the same range on
 PH different interfaces.
 
 I think I know what the OP has in mind - having a default IP address
 configuration which gets assigned to an interface where media is
 present.
 
 The only way I see this working is with only a single Ethernet adaptor
 has the cable plugged in - otherwise it gets messy.

It's messy anyway. You have to know which are normal network adapters
and which are not - some obvious examples are enc0, pflog0, lo0

 One way or another, this shouldn't be too difficult to script and run
 from /etc/rc.firsttime.

Yep. Much better idea.



Re: Feature request: hostname.default

2014-11-12 Thread Reyk Floeter
On Wed, Nov 12, 2014 at 03:10:01PM +, Stuart Henderson wrote:
 On 2014/11/12 09:49, rjc wrote:
  On Wed, Nov 12, 2014 at 09:13:37AM EST, Stefan Sperling wrote:
  
   On Wed, Nov 12, 2014 at 03:26:02PM +0200, Lars Engblom wrote:
  
I guess you mean the case of having several network interfaces. Let
all of the unconfigured interfaces get the IP settings from
hostname.default and write this in the documentation. It is easier
to plug in just one cable than having to guess all the names of the
interfaces (em0, bge0, re0, rl0 etc).
  
   One problem with this idea is that you can't have the same IP on
   multiple interfaces and expect things to work.
  
   A recent discussed on misc@ made this quite clear:
   http://marc.info/?l=openbsd-miscm=141564884907430w=2
  
  The scope there was even broader:
  
  PH That is not supported.  You MUST NOT have IPs in the same range on
  PH different interfaces.
  
  I think I know what the OP has in mind - having a default IP address
  configuration which gets assigned to an interface where media is
  present.
  
  The only way I see this working is with only a single Ethernet adaptor
  has the cable plugged in - otherwise it gets messy.
 
 It's messy anyway.

I agree but...

 You have to know which are normal network adapters
 and which are not - some obvious examples are enc0, pflog0, lo0
 

...any interface that is not listed by 'ifconfig -C'.

  One way or another, this shouldn't be too difficult to script and run
  from /etc/rc.firsttime.
 
 Yep. Much better idea.
 

Reyk



Re: Feature request: hostname.default

2014-11-12 Thread Lars Engblom

On 11/12/2014 11:19 AM, Stefan Sperling wrote:

On Wed, Nov 12, 2014 at 10:11:23AM +0200, Lars Engblom wrote:

Please consider to add support for a hostname.default. If no hostname.X is
matching the interface, this file would be used as last resource before
giving up configuring the interface.

Before configuring _which_ interface?


I guess you mean the case of having several network interfaces. Let all 
of the unconfigured interfaces get the IP settings from hostname.default 
and write this in the documentation. It is easier to plug in just one 
cable than having to guess all the names of the interfaces (em0, bge0, 
re0, rl0 etc).


After the first boot one can easily find out the names with ifconfig and 
then for example 'mv /etc/hostname.default /etc/hostname.em0'




Re: Feature request: hostname.default

2014-11-12 Thread Theo de Raadt
 On 11/12/2014 11:19 AM, Stefan Sperling wrote:
  On Wed, Nov 12, 2014 at 10:11:23AM +0200, Lars Engblom wrote:
  Please consider to add support for a hostname.default. If no hostname.X is
  matching the interface, this file would be used as last resource before
  giving up configuring the interface.
  Before configuring _which_ interface?

 I guess you mean the case of having several network interfaces. Let all 
 of the unconfigured interfaces get the IP settings from hostname.default 
 and write this in the documentation. It is easier to plug in just one 
 cable than having to guess all the names of the interfaces (em0, bge0, 
 re0, rl0 etc).

 After the first boot one can easily find out the names with ifconfig and 
 then for example 'mv /etc/hostname.default /etc/hostname.em0'

Two paragraphs written without any critical thought.

We won't be doing that...