Bug #3357

Role disappears from ethernet interface

Added by Giacomo Sanchietti over 5 years ago. Updated over 5 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-base
Target version:v6.7
Security class: Resolution:
Affected version: NEEDINFO:No

Description

When a ethernet interface has been connected/disconnected to/from the system, the kernel sends an event to udev.
Udev will take care to adjust the network interface:
  • for each new interface, a new record is created
  • if an interface has been removed, the role of the interface is removed

This is a desired behavior for USB ethernet cards, but can generate problems when the hardware or the driver is bugged and the ethernet interface disappears only for a limited time.
Example:

Feb  8 14:34:40 firewall kernel: pciehp 0000:00:1c.2:pcie04: Card not present on Slot(34)
Feb  8 14:34:40 firewall kernel: e1000e 0000:04:00.0: eth2: removed PHC
Feb  8 14:34:41 firewall /sbin/e-smith/db[14382]: /var/lib/nethserver/db/networks: OLD eth2=ethernet|bootproto|none|gateway|192.168.0.251|hwaddr|00:90:0b:35:69:xx|ipaddr|192.168.0.1|netmask|255.255.255.0|role|red
Feb  8 14:34:41 firewall /sbin/e-smith/db[14382]: /var/lib/nethserver/db/networks: NEW eth2=ethernet|bootproto|none|gateway|192.168.0.251|hwaddr|00:90:0b:35:69:xx|ipaddr|192.168.0.1|netmask|255.255.255.0|role|

After a couple of seconds, the interface will be resumed but since the role has been removed, the system will not be able to correctly apply network and firewall configuration.

Steps to reproduce

Since the problem is hard to reproduce with PCI or embedded ethernet interface, use a USB ethernet device:
  1. Connect the USB card
  2. Configure the USB card with a role and an IP address
  3. Disconnect the USB and check the associated record doesn't have a role

Workaround

Update networks db by assign a role to the network interface (eg. eth1):

db networks setprop eth1 role green
signal-event interface update

Associated revisions

Revision 567b6ba1
Added by Giacomo Sanchietti over 5 years ago

udev-update-network: do not remove role prop if an interface has gone away. Refs #3357

History

#1 Updated by Giacomo Sanchietti over 5 years ago

  • Category set to nethserver-base
  • Status changed from NEW to TRIAGED
  • Target version set to v6.7
  • % Done changed from 0 to 20

#2 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Giacomo Sanchietti
  • % Done changed from 20 to 30

#3 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

#4 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-base-2.9.5-1.6.g567b6ba.ns6.noarch.rpm
Test case
  • Check the bug is not reproducible: you should be able to disconnect and reconnect an ethernet device with no need to reconfigure it

Note
If you are using USB ethernet devices, after the stick has been unplugged, you must remove the record from networks db:

db delete networks delete ethx
signal-event interface-update

#5 Updated by Filippo Carletti over 5 years ago

  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90

Pre upgrade:

[root@nscom ~]# db networks show eth2
eth2=ethernet
    bootproto=none
    hwaddr=00:80:c8:38:eb:49
    ipaddr=10.10.11.12
    netmask=255.255.0.0
    role=blue

Feb 23 18:19:02 nscom kernel: usb 1-1: USB disconnect, device number 2
Feb 23 18:19:02 nscom kernel: asix 1-1:1.0: eth2: unregister 'asix' usb-0000:00:0b.0-1, ASIX AX88772 USB 2.0 Ethernet
Feb 23 18:19:03 nscom /sbin/e-smith/db[17000]: /var/lib/nethserver/db/networks: OLD eth2=ethernet|bootproto|none|hwaddr|00:80:c8:38:eb:49|ipaddr|10.10.11.12|netmask|255.255.0.0|role|blue
Feb 23 18:19:03 nscom /sbin/e-smith/db[17000]: /var/lib/nethserver/db/networks: NEW eth2=ethernet|bootproto|none|hwaddr|00:80:c8:38:eb:49|ipaddr|10.10.11.12|netmask|255.255.0.0|role|

Post upgrade:

Feb 23 18:27:39 nscom kernel: usb 1-1: USB disconnect, device number 3
Feb 23 18:27:39 nscom kernel: asix 1-1:1.0: eth2: unregister 'asix' usb-0000:00:0b.0-1, ASIX AX88772 USB 2.0 Ethernet
Feb 23 18:27:41 nscom ntpd[17421]: Deleting interface #15 eth2, 10.10.11.12#123, interface stats: received=0, sent=0, dropped=0, active_time=38 secs

I deleted the eth from the network menu.

#6 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Releases in nethserver-updates:
  • nethserver-base-2.9.6-1.ns6.noarch.rpm

Also available in: Atom PDF