Re: ifconfig accepting hostname as ipv4 address

2012-06-11 Thread Jonathan McKeown
On Saturday 09 June 2012 23:29:02 Kevin Oberman wrote:
 On Sat, Jun 9, 2012 at 12:37 AM, Garrett Cooper yaneg...@gmail.com wrote:
 
     I agree that it's not the best configuration in the world, as it
  would only work 100% if a machine had proper DNS records or a
  definitive hosts file.
     There are already enough bugs with static IP configurations and
  hostnames as-is *I'm looking at you mountlate* -- no sense to
  introduce more potentially buggy interoperability that only works in a
  handful of niche cases.

 The idea was that you could enter all of the local interface names in
 /etc/hosts and than just put the names into the ifconfig commands. It
 was handy for keeping track of what port connected where on systems
 that had numerous interfaces, though this was more common in the day
 of async serial lines and modems.

 I'll admit that I have mixed feelings about its practicality today,
 though it does not hurt anything, as far as I can tell.

It works fine as long as the machine has its own address in /etc/hosts - does 
anyone not do that?

Also, note that I'm not suggesting adding any functionality at all; just 
replying to a suggestion that functionality be /removed/ - by pointing out 
that we find it useful and would rather not see it go.

Jonathan
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ifconfig accepting hostname as ipv4 address

2012-06-09 Thread Wojciech Puchar

input.
Moreover, ifconfig em0 some_valid_fqdn/MASK silently ignores it, so you can't 
set valid CIDR address using this notation.


Classful era has ended more than 10 years ago, do we still want to keep this 
behavior?



were not aware of that option, and it is rather stupid option - you should
work on addresses not names when configuring network
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ifconfig accepting hostname as ipv4 address

2012-06-09 Thread Garrett Cooper
On Sat, Jun 9, 2012 at 12:23 AM, Wojciech Puchar
woj...@wojtek.tensor.gdynia.pl wrote:
 input.
 Moreover, ifconfig em0 some_valid_fqdn/MASK silently ignores it, so you
 can't set valid CIDR address using this notation.

 Classful era has ended more than 10 years ago, do we still want to keep
 this behavior?

 were not aware of that option, and it is rather stupid option - you should
 work on addresses not names when configuring network

I agree that it's not the best configuration in the world, as it
would only work 100% if a machine had proper DNS records or a
definitive hosts file.
There are already enough bugs with static IP configurations and
hostnames as-is *I'm looking at you mountlate* -- no sense to
introduce more potentially buggy interoperability that only works in a
handful of niche cases.
Thanks,
-Garrett
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ifconfig accepting hostname as ipv4 address

2012-06-09 Thread Kevin Oberman
On Sat, Jun 9, 2012 at 12:37 AM, Garrett Cooper yaneg...@gmail.com wrote:
 On Sat, Jun 9, 2012 at 12:23 AM, Wojciech Puchar
 woj...@wojtek.tensor.gdynia.pl wrote:
 input.
 Moreover, ifconfig em0 some_valid_fqdn/MASK silently ignores it, so you
 can't set valid CIDR address using this notation.

 Classful era has ended more than 10 years ago, do we still want to keep
 this behavior?

 were not aware of that option, and it is rather stupid option - you should
 work on addresses not names when configuring network

    I agree that it's not the best configuration in the world, as it
 would only work 100% if a machine had proper DNS records or a
 definitive hosts file.
    There are already enough bugs with static IP configurations and
 hostnames as-is *I'm looking at you mountlate* -- no sense to
 introduce more potentially buggy interoperability that only works in a
 handful of niche cases.

The idea was that you could enter all of the local interface names in
/etc/hosts and than just put the names into the ifconfig commands. It
was handy for keeping track of what port connected where on systems
that had numerous interfaces, though this was more common in the day
of async serial lines and modems.

I'll admit that I have mixed feelings about its practicality today,
though it does not hurt anything, as far as I can tell.
-- 
R. Kevin Oberman, Network Engineer
E-mail: kob6...@gmail.com
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ifconfig accepting hostname as ipv4 address

2012-06-08 Thread Jonathan McKeown
On Thursday 07 June 2012 17:00:04 Alexander V. Chernikov wrote:
 Hello list!

 Since the early days ifconfig(8) has the following functionality:

[hostname in place of literal address]

 Moreover, ifconfig em0 some_valid_fqdn/MASK silently ignores it, so you
 can't set valid CIDR address using this notation.

I'm not sure that's true. Have you tried it? Because it seems to work here.

Jonathan
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ifconfig accepting hostname as ipv4 address

2012-06-08 Thread Alexander V. Chernikov

On 08.06.2012 11:20, Jonathan McKeown wrote:

On Thursday 07 June 2012 17:00:04 Alexander V. Chernikov wrote:

Hello list!

Since the early days ifconfig(8) has the following functionality:


[hostname in place of literal address]


Moreover, ifconfig em0 some_valid_fqdn/MASK silently ignores it, so you
can't set valid CIDR address using this notation.


I'm not sure that's true. Have you tried it? Because it seems to work here.
Strangely enough, it works on another machine. Ok, this one works and 
can unfortunately be used by other people.


However, original question remains.



Jonathan



___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ifconfig accepting hostname as ipv4 address

2012-06-08 Thread Jonathan McKeown
On Friday 08 June 2012 09:43:25 Alexander V. Chernikov wrote:
 On 08.06.2012 11:20, Jonathan McKeown wrote:
  On Thursday 07 June 2012 17:00:04 Alexander V. Chernikov wrote:
  Hello list!
 
  Since the early days ifconfig(8) has the following functionality:
 
  [hostname in place of literal address]
 
  Moreover, ifconfig em0 some_valid_fqdn/MASK silently ignores it, so you
  can't set valid CIDR address using this notation.
 
  I'm not sure that's true. Have you tried it? Because it seems to work
  here.

 Strangely enough, it works on another machine. Ok, this one works and
 can unfortunately be used by other people.

 However, original question remains.

So your question is, do we want to keep the behaviour of being able to 
configure an interface by hostname as well as by IP address?

My vote is yes. Sure, a typo in the parameters to ifconfig can cause problems 
under some circumstances. So can a typo in any command. I don't think that's 
a good enough reason to remove functionality you regard as ``unfortunate''. 
We find it useful, and a significant aid to maintainability and readability 
of configuration files.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ifconfig accepting hostname as ipv4 address

2012-06-08 Thread Thomas Rasmussen

On 08.06.2012 11:04, Jonathan McKeown wrote:

We find it useful, and a significant aid to maintainability and readability
of configuration files.

Hello,

What happens if your server reboots while the DNS
server is down/unavailable ?

This seems to be a bad idea for the same reasons
that putting hostnames in firewall configs are a bad idea:

You want the system to boot and work correctly
regardless of whether the systems DNS servers
were responsive at boot time or not.

Best regards

Thomas Steen Rasmussen

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ifconfig accepting hostname as ipv4 address

2012-06-08 Thread David Brodbeck
On Fri, Jun 8, 2012 at 10:08 AM, Thomas Rasmussen tho...@gibfest.dk wrote:
 On 08.06.2012 11:04, Jonathan McKeown wrote:

 We find it useful, and a significant aid to maintainability and
 readability
 of configuration files.

 Hello,

 What happens if your server reboots while the DNS
 server is down/unavailable ?

Shouldn't this still work if the machine has its own hostname
associated with its IP in /etc/hosts?  Is that not still common
practice?

I can see the logic here.  By putting the IP in /etc/hosts and the
hostname in the ifconfig, you only have to edit the address in one
place if it ever changes.

This reminds me that the old (pre-NWAM) way to configure Solaris with
a static IP was to put the IP and hostname in /etc/hosts, the hostname
in /etc/hostname.e1000g0 (or whatever your interface name was), the
gateway address in /etc/defaultrouter, and the network address and
netmask in /etc/netmasks.


-- 
David Brodbeck
System Administrator, Linguistics
University of Washington
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


ifconfig accepting hostname as ipv4 address

2012-06-07 Thread Alexander V. Chernikov

Hello list!

Since the early days ifconfig(8) has the following functionality:

..
 address
 For the DARPA-Internet family, the address is either a 
host name
 present in the host name data base, hosts(5), or a DARPA 
Internet

 address expressed in the Internet standard “dot notation”.

E.g. one can write `ifconfig em0 some_possibly_unqualified_fqdn` and get
inet address assigned to the card with classful mask.

Now this can lead to fun things if you have misprinted some keyword 
and this keyword exists in the local DNS zone (or wildcard is configured).


The most favorite one (we have wilcard configured in one of our search 
zones):

18:45 [0] dhcp170-36-red# ifconfig vlan123 desroy
18:45 [0] dhcp170-36-red# echo $?
0
18:45 [0] dhcp170-36-red# ifconfig vlan123
vlan123: flags=8003UP,BROADCAST,MULTICAST metric 0 mtu 1500
ether 00:00:00:00:00:00
inet 213.180.204.242 netmask 0xff00 broadcast 213.180.204.255
inet6 fe80::222:4dff:fe50:cd2f%vlan123 prefixlen 64 scopeid 0xd
nd6 options=21PERFORMNUD,AUTO_LINKLOCAL
vlan: 0 parent interface: none

This is also one of the reasons why ifconfig sometimes hangs on 
invalid input.
Moreover, ifconfig em0 some_valid_fqdn/MASK silently ignores it, so you 
can't set valid CIDR address using this notation.


Classful era has ended more than 10 years ago, do we still want to keep 
this behavior?



--
WBR, Alexander
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org