0

I have an eth0 on which I have created VLAN 2554 (using ip link add). And then I have added three addresses, giving each one a label (using ip address add ... label eth0.2554:99). And ip addr shows me:

3: eth0.2554@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc noqueue state UP group default qlen 1000
    link/ether d0:5f:64:3f:d6:f4 brd ff:ff:ff:ff:ff:ff
    inet 10.25.54.97/27 brd 10.25.54.127 scope global eth0.2554
       valid_lft forever preferred_lft forever
    inet 10.25.54.1/26 brd 10.25.54.63 scope global eth0.2554:0
       valid_lft forever preferred_lft forever
    inet 10.25.54.129/25 brd 10.25.54.255 scope global eth0.2554:1
       valid_lft forever preferred_lft forever

Should I be surprised that add rule ... iif "eth0.2554:0" ... is rejected "interface does not exist" ?

I'm guessing that netfilter knows nothing about the ":99" on the end of an "xxx:99" 'label'. Either that or there is some other spell I need to cast to make this work ?

Chris Hall
  • 191
  • 1
  • 1
  • 7

1 Answers1

2

Those labels are solely for human consumption; Linux doesn't do anything with them, and hasn't in over a decade. You can use the actual interface name eth0.2554, but you probably will want to use IP address in this scenario.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • OK... so I get nil points for a stupid question :-( Is it also a stupid question to ask where I discover what (if anything) the `label` in `ip address add` can be used for (other than as a filter in `if address show`) ? – Chris Hall Sep 23 '20 at 09:44
  • Sorry: s/if address/ip address/. Also other than as a filter in `ip address flush` (and `ip address save`, whatever that is.) – Chris Hall Sep 23 '20 at 10:28
  • I suspect you've already found all the uses for the label. – Michael Hampton Sep 23 '20 at 16:15