Alex Kost skribis: > Ludovic Courtès (2016-06-02 11:07 +0300) wrote: > >> Alex Kost skribis: >> >>> Tomáš Čech (2016-06-01 07:53 +0300) wrote: >>> >>>> On Tue, May 31, 2016 at 11:10:21PM +0200, Ludovic Courtès wrote: >>>>>Matthew Jordan skribis: >>>>> >>>>>> mentions using ifconfig, correct me if I"m wrong but isn't ifconfig >>>>>> considered deprecated? >>>>> >>>>>This ifconfig (part of GNU Inetutils) is maintained, so I think it’s >>>>>fine. :-) >>>> >>>> Yes, ifconfig is considered deprecated for more than decade. I'm not >>>> networking guy but colleague of mine who is told me that ifconfig is >>>> just ugly wrapper not reflecting how the kernel is handling it. >>>> http://serverfault.com/questions/633087/where-is-the-statement-of-deprecation-of-ifconfig-on-linux >>>> >>>> iproute2 is way to go. >>> >>> I would also prefer to see "ip" command instead of "ifconfig" in the >>> manual. Alternatively both can be mentioned.. >> >> I have a hard time leaving ifconfig/iwconfig. ;-) >> >> I was about to change the manual’s examples to ‘ip’, but then realized >> that this is Linux-specific and doesn’t buy us much for these simple >> cases. So, what about this: > > Wow, do you mean that ifconfig is not only for Linux kernel? Exactly. Under the hood, ‘ip’ uses Linux-specific netlink socket interfaces, whereas GNU ifconfig uses the good ol’ ioctls that most Unices support (including GNU/Hurd): --8<---------------cut here---------------start------------->8--- ~$ sudo strace -e socket ip a socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, 0) = 3 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 5c:26:0a:64:07:23 brd ff:ff:ff:ff:ff:ff inet 193.50.110.57/24 brd 193.50.110.255 scope global eno1 valid_lft forever preferred_lft forever inet6 fe80::5e26:aff:fe64:723/64 scope link valid_lft forever preferred_lft forever 3: wlp0s29u1u2: mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether 60:02:b4:99:9b:31 brd ff:ff:ff:ff:ff:ff +++ exited with 0 +++ ludo@pluto ~$ sudo strace -e ioctl ifconfig -a ioctl(3, SIOCGIFINDEX, {ifr_name="wlp0s29u1u2", ifr_index=3}) = 0 ioctl(3, SIOCGIFINDEX, {ifr_name="lo", ifr_index=1}) = 0 ioctl(3, SIOCGIFINDEX, {ifr_name="eno1", ifr_index=2}) = 0 ioctl(5, SIOCGIFINDEX, {ifr_name="eno1", ifr_index=2}) = 0 ioctl(4, SIOCGIFHWADDR, {ifr_name="eno1", ifr_hwaddr=5c:26:0a:64:07:23}) = 0 ioctl(4, SIOCGIFHWADDR, {ifr_name="eno1", ifr_hwaddr=5c:26:0a:64:07:23}) = 0 ioctl(4, SIOCGIFHWADDR, {ifr_name="eno1", ifr_hwaddr=5c:26:0a:64:07:23}) = 0 ioctl(4, SIOCGIFHWADDR, {ifr_name="eno1", ifr_hwaddr=5c:26:0a:64:07:23}) = 0 eno1 Link encap:Ethernet HWaddr 5C:26:0A:64:07:23 [...] --8<---------------cut here---------------end--------------->8--- > If ifconfig is a general thing (suitable for Hurd) then I agree; we > should probably leave it as it is now. Otherwise I would also add a > mention how to do it with "ip", like this: