Hello Bob,
I went ahead and removed eth0:1 as we don't use it. So let's negate that factor 
and start over.

Starting from the beginning, there is this firewall agent we have installed 
that uses some custom coding to grab the interfaces on our server. Their agent 
is only working on Debian 8 (Jessie) and below. It doesn't work on Debian 9 
(stretch), which are the packages we are using on our server.

When you start with a regular Debian 8 image, you get output similar to the 
below. And this is just Debian 8.3 server with iproute2=3.16.0-2. Please note, 
my debian 8 and debian 9 servers are completely different, so deb8 has 
eth0/eth1 and deb9 has just eth0.


# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:56:b5:00:23
          inet addr:10.X.X.X Bcast:10.X.X.X  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:feb5:23/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:326656 errors:0 dropped:756 overruns:0 frame:0
          TX packets:11764 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:34993035 (33.3 MiB)  TX bytes:1650044 (1.5 MiB)

eth1      Link encap:Ethernet  HWaddr 00:50:56:b5:00:02
          inet addr:10.X.X.X  Bcast:10.X.X.X  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:feb5:2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:609769 errors:0 dropped:39962 overruns:0 frame:0
          TX packets:8863 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:47317216 (45.1 MiB)  TX bytes:11631004 (11.0 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:6493582 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6493582 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:733170898 (699.2 MiB)  TX bytes:733170898 (699.2 MiB)


If you upgrade said system from Debian 8 Jessie to Debian 9 Stretch, using 
apt-get dist-upgrade, you get complete package upgrades across the board. 
That's when your /sbin/ifconfig output changes to the below, where eth0 now 
becomes eth0: and so on. There is also some extra fields in there such as 
flags= and mtu on the first line.

# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 96.126.108.191  netmask 255.0.0.0  broadcast 96.255.255.255
        inet6 2600:3c03::f03c:91ff:fe70:989d  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::f03c:91ff:fe70:989d  prefixlen 64  scopeid 0x20<link>
        ether f2:3c:91:70:98:9d  txqueuelen 1000  (Ethernet)
        RX packets 1788  bytes 697207 (680.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2168  bytes 873594 (853.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 828  bytes 530016 (517.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 828  bytes 530016 (517.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

This agent is proprietary, so I can only share the basic cases it uses to get 
the interfaces.

1st case)
/sbin/ifconfig | grep flags= | awk '{print $1}'  -- On a Debian 8 system, this 
outputs nothing, as flags= is not on the ifconfig of these debian versions. It 
IS however on Debian 9 Stretch.
Debian 9 Stretch Output:

eth0:
lo:

If this doesn't give an output, like on Debian 8 Jessie, it moves on to the 
below check:
/sbin/ifconfig | grep Ethernet | awk '{print $1}' -- On a Debian 8 system, this 
outputs:

eth0
eth1


Notice, we have eth0 and lo with a colon at the end on Debian 9 Stretch. This 
is from stock package upgrades, where that colon is now in there after doing a 
dist-upgrade. This is not normal format for Debian 8 and below (when you run 
ifconfig).


Now, back to the first case, if that "ifconfig |grep flags=...." worked, which 
it only did on Debian 9 Stretch, it would use the below command to grab the 
interface information. But note, it's running based on the output of eth0: and 
not just eth0.

/sbin/ip -o link show eth0: |grep ether - This will NOT run on my Debian 9 
Stretch because from the output it got from ifconfig with the eth0:, eth0: 
becomes invalid as a device name. The whole point of the bug report is to point 
out that extra colon that throws everything off. The only way for this to work 
on Stretch is without the colon at the end.

Debian 9 Stretch:
# /sbin/ip -o link show eth0: |grep ether
RTNETLINK answers: No such device
Cannot send link get request: No such device

# /sbin/ip -o link show eth0 |grep ether
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 
mode DEFAULT group default qlen 1000\    link/ether f2:3c:91:70:98:9d brd 
ff:ff:ff:ff:ff:ff




So, given the clear difference of /sbin/ifconfig and /sbin/ip, MAINLY from the 
device name having a trailing colon (:) at the end, can that particular issue 
be corrected? Where it goes back to the Debian 8 and below format of just 
outputting eth0 and not eth0:


Also Bob, here is the output of "ip -o addr show eth0" you wanted I believe. My 
problem stemmed not from eth0, but eth0: being used in ifconfig. And this was 
just from upgrading Debian 8 Jessie to Debian 9 Stretch through a dist-upgrade. 
You can instantly see the difference in ifconfig after that upgrade.

Deb 9 Stretch:
# ip -o addr show eth0
2: eth0    inet 96.126.108.191/8 brd 96.255.255.255 scope global eth0\       
valid_lft forever preferred_lft forever
2: eth0    inet6 2600:3c03::f03c:91ff:fe70:989d/64 scope global mngtmpaddr 
dynamic \       valid_lft 287sec preferred_lft 47sec
2: eth0    inet6 fe80::f03c:91ff:fe70:989d/64 scope link \       valid_lft 
forever preferred_lft forever

Deb 8 Jessie:
# ip -o addr show eth0:
2: eth0    inet 10.X.X.X/24 brd 10.200.136.255 scope global eth0\       
valid_lft forever preferred_lft forever
2: eth0    inet6 fe80::250:56ff:feb5:23/64 scope link \       valid_lft forever 
preferred_lft forever



Justin McZeal, Sr. Linux Engineer
Professional Trading Solutions, Inc.
http://professionaltradingsolutions.com
2000 Bering Drive, Ste 250
Houston, Texas 77057
justin.mcz...@professionaltrading.com
(o) 832-516-6385
(c) 832-802-3660


-----Original Message-----
From: Bob Proulx [mailto:b...@proulx.com]
Sent: Wednesday, April 6, 2016 3:00 PM
To: Justin McZeal <justin.mcz...@professionaltrading.com>; 
820...@bugs.debian.org
Subject: Re: Bug#820212: iproute2: Colons in ethernet names under 
/sbin/ifconfig and /sbin/ip are not being recognized in Stretch

Justin McZeal wrote:
> and /sbin/ip -o link show eth0:1: to both come up without a hitch. The
> ones without the colon have been tested to fully work on a stock
> Debian 8 (jessie) image, not Debian 9 (stretch).

I cannot reproduce this on stock Jessie 8.4.  It needs "eth0" not "eth0:1".  
Note that eth0:1 is not an interface but simply a label so that older tools 
such as 'ifconfig' that don't understand the new feature can interface to them. 
 For me:

  # ip -o link show eth0:1
  RTNETLINK answers: No such device
  Cannot send link get request: No such device

It was created this way and displays on this Jessie 8.4 VM image:

  ip addr add 192.168.1.115/24 dev eth0 label eth0:1

  # ip -o addr show eth0
  2: eth0    inet 192.168.230.123/24 brd 192.168.230.255 scope global eth0\     
  valid_lft forever preferred_lft forever
  2: eth0    inet 192.168.1.115/24 scope global eth0:1\       valid_lft forever 
preferred_lft forever
  2: eth0    inet6 fe80::5054:ff:fe97:fb1d/64 scope link \       valid_lft 
forever preferred_lft forever

And therefore I wonder how this is working for you on your Jessie 8 system?  
Also testing on my up to date Sid system produced the same behavior.  (I also 
looked at one of my Linodes and it was the same there on Jessie 8 too.)

Also you showed a lot of config dumps (good) but didn't show the obvious one 
that I would like to see.  Could you please?

  ip -o addr show eth0

> root@sandbox:~# /sbin/ip -o link show eth0
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 
> mode DEFAULT group default qlen 1000\    link/ether f2:3c:91:70:98:9d brd 
> ff:ff:ff:ff:ff:ff

What does an ethernet device know of IP addresses?  I think 'link' is not the 
right thing to use here.  'address' is better for looking at IP addresses.

Bob

Reply via email to