SIOCSIFNETMASK No such device
Mentre avviavo una Debian, ho visto dei messaggi che mi hanno insospettito:
SIOCSIFNETMASK: No such device SIOCSGIFADDR: No such device eth0: ERROR while getting interface flags: no such device eth1: ERROR while getting interface flags: no such device
Facendo:
$ ifconfig
veniva visualizzata solo l’interfaccia loopback, mentre con:
$ ifconfig -a
non c’erano più la eth0 e la eth1, ma la eth2 e eth3 (Figura 1):
Andando a vedere il log: /var/log/messages ho notato:
kernel: [..] udev: renamed network interface eth0 to eth2 kernel: [..] udev: renamed network interface eth1 to eth3
Successivamente ho controllato il file:
/etc/udev/rules.d/70-persistent-net.rules
e ho visto le seguenti righe:
# PCI device 0x8086:0x1076 (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*:*:*:*:*:*c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x1076 (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*:*:*:*:*:*d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x1076 (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*:*:*:*:*:*6", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:0x1076 (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*:*:*:*:*:*7", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
A questo punto sono andato a controllare (sempre da ifconfig -a, vedi Figura 1) i MAC delle schede, ho commentato le prime due righe (con MAC diverso) e ho modificato le ultime due mettendo “eth0” e “eth1” al posto di “eth2” e “eth3” (Figura 2):
# PCI device 0x8086:0x1076 (e1000) #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*:*:*:*:*:*c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x1076 (e1000) #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*:*:*:*:*:*d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x1076 (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*:*:*:*:*:*6", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x1076 (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="*:*:*:*:*:*7", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
Dopo aver fatto ciò, ho riavviato ed è tornato tutto come prima.
SIOCSIFNETMASK: No such device
SIOCSGIFADDR: No such device
SIOCSGIFADDR: No such device