operating_systems:linux:debian:interface_name
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| operating_systems:linux:debian:interface_name [2017/10/30 09:44] – kroduit | operating_systems:linux:debian:interface_name [2022/02/01 13:34] (current) – ateixeira | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| With stretch, this problem is more complex, we have to work with the [[https:// | With stretch, this problem is more complex, we have to work with the [[https:// | ||
| - | < | + | < | 
| eth0 / enp4s0 | eth0 / enp4s0 | ||
| eth1 / enp3s0 | eth1 / enp3s0 | ||
| Line 14: | Line 14: | ||
| For more security, we match the PCI id and the MAC address. Informations below are for the netgate 4860 (centrale 3540). I think you have to check your hardware because it can change over time. | For more security, we match the PCI id and the MAC address. Informations below are for the netgate 4860 (centrale 3540). I think you have to check your hardware because it can change over time. | ||
| - | - Getting the PCI ID and MAC address for each interface.< | + | - Getting the PCI ID and MAC address for each interface.< | 
| + | udevadm info -e | grep -A 5 -B 18 " | ||
| P: / | P: / | ||
| E: DEVPATH=/ | E: DEVPATH=/ | ||
| Line 38: | Line 39: | ||
| E: USEC_INITIALIZED=4244300 | E: USEC_INITIALIZED=4244300 | ||
| [...]</ | [...]</ | ||
| - | - Add rules for the interface name.< | + | - Add rules for the interface name.< | 
| - | SUBSYSTEM==" | + | SUBSYSTEM==" | 
| - | SUBSYSTEM==" | + | SUBSYSTEM==" | 
| - | SUBSYSTEM==" | + | SUBSYSTEM==" | 
| - | SUBSYSTEM==" | + | SUBSYSTEM==" | 
| - | SUBSYSTEM==" | + | SUBSYSTEM==" | 
| + | - **Only for Jessie (and lower?)**: remove the existing udev rules in /etc and prevent the file generation on next reboot.< | ||
| + | echo "# disable net-generator rules in / | ||
| + | rm / | ||
| - Adapt interfaces list (specific to your installation).< | - Adapt interfaces list (specific to your installation).< | ||
| allow-hotplug eth1 | allow-hotplug eth1 | ||
| - | iface eth1 inet dhcp | + | iface lan1 inet dhcp | 
| [...]</ | [...]</ | ||
| - Reboot< | - Reboot< | ||
| - And check results.< | - And check results.< | ||
| - Check the correspondence between NIC label and physical label.< | - Check the correspondence between NIC label and physical label.< | ||
| - | Oct 30 10:11:50 3540 kernel: [  129.120407] igb 0000: | + | Oct 30 10:11:50 3540 kernel: [  129.120407] igb 0000: | 
| - | Oct 30 10:11:52 3540 kernel: [  131.774607] igb 0000: | + | Oct 30 10:11:52 3540 kernel: [  131.774607] igb 0000: | 
| [...]</ | [...]</ | ||
| - If you have some trouble, you can add log.< | - If you have some trouble, you can add log.< | ||
| + | |||
| + | <note tip>Why interface name suggested are lanX instead of ethX?</ | ||
| + | I've made some tests with debian 8 and i encounter this problem: | ||
| + | If i comment 1 line in udev rules (for example eth4), eth4 retrieve his old default name (eth2) and eth2 get the name " | ||
| + | If i comment the lan4 line in udev rules, lan4 (eth4 physical) become eth2, but lan2 stay lan2 and eth4 physical simply doesn' | ||
| + | |||
| + |  | ||
| + | [[https:// | ||
| + | |||
| + | found Path and MAC address | ||
| + | < | ||
| + | ifconfig | ||
| + | udevadm info -e | grep -A 5 -B 18 " | ||
| + | </ | ||
| + | |||
| + | add files like 1x-lanx.link in / | ||
| + | < | ||
| + | [Match] | ||
| + | Path=< | ||
| + | MACAddress=00: | ||
| + | |||
| + | [Link] | ||
| + | Name=lan0 | ||
| + | </ | ||
| + | |||
| + | |||
| + | <note important> | ||
| + | |||
| + | add file 99-default.link in / | ||
| + | < | ||
| + | [Link] | ||
| + | NamePolicy=kernel database onboard slot path | ||
| + | MACAddressPolicy=persistent | ||
| + | </ | ||
| + | |||
| + | to permit user-defined name of USB network interfaces, it's necessary to enable the 80-net-setup-link.rules rule with this command : | ||
| + | < | ||
| + | sudo ln -s / | ||
| + | </ | ||
| + | |||
| + |  | ||
| + | |||
| + | found ID_PATH and MAC address | ||
| + | < | ||
| + | udevadm info -e | grep -A 5 -B 18 " | ||
| + | ip a | ||
| + | </ | ||
| + | |||
| + | edit files like 1x-lanx.link in / | ||
| + | < | ||
| + | [Match] | ||
| + | Path=< | ||
| + | MACAddress=00: | ||
| + | |||
| + | [Link] | ||
| + | Name=lan0 | ||
| + | </ | ||
| + | |||
| + | make sure file 99-default.link is present in / | ||
| + | < | ||
| + | [Link] | ||
| + | NamePolicy=kernel database onboard slot path | ||
| + | MACAddressPolicy=persistent | ||
| + | </ | ||
| + | |||
| + | to permit user-defined name of USB network interfaces, it's necessary to enable the 80-net-setup-link.rules rule with this command : | ||
| + | < | ||
| + | sudo ln -s / | ||
| + | </ | ||
operating_systems/linux/debian/interface_name.1509356662.txt.gz · Last modified: 2017/10/30 09:44 by kroduit
                
                