Last active
June 3, 2019 19:36
-
-
Save chadmayfield/013668e0bccac5fda663aec916f7b18e to your computer and use it in GitHub Desktop.
Revisions
-
chadmayfield revised this gist
Jun 3, 2019 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,14 @@ Beginning in Systemd v197, network interfaces assigned by systemd/udev are "predicatble"; Names are now based on; * Index numbers for on-board devices (eno1) * PCI-ehotplug slot index numbers (ens1) * Physical/geographical location of hardware connector (enp2s0) * MAC address (enx78e7d1ea46da) * Classic, unpredictable kernel-native naming (eth0) Links; * [Predicatable Network Interface names](https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/) * [udev-builtin-net_id.c @ freedesktop.org](https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c) * [udev-builtin-net_id.c @ github.com/systemd](https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L12) -
chadmayfield revised this gist
Jun 3, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ Two character prefixes based on the type of interface: #### Find network interface ```` ls /sys/class/net | grep -E "^e(m|n(o|p|s)|th)[0-9]|wl(an|p)" find /sys/class/net ! -type d | xargs --max-args=1 realpath | awk -F\/ '/pci/{print $NF}' ```` -
chadmayfield revised this gist
Jun 3, 2019 . 1 changed file with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,16 +17,20 @@ Two character prefixes based on the type of interface: [SO Answer: Find available network interfaces](https://unix.stackexchange.com/a/125401) #### Find network interface ```` ls /sys/class/net | grep -E "^e(m|n(o|p|s)|th[0-9])|wl(an|p)" find /sys/class/net ! -type d | xargs --max-args=1 realpath | awk -F\/ '/pci/{print $NF}' ```` #### Find available network interfaces ```` ip r | grep " src "|cut -d " " -f 3,12 | xargs ip addr show | awk '/inet.*brd/{print $NF}' ip -o link show up | awk -F': ' '{print $2}' ip -o -4 addr show ip -o link ls up lshw -class network ```` #### Observed Interface Names ```` -
chadmayfield revised this gist
Jun 3, 2019 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,8 @@ ip -o link ls up lshw -class network` #### Observed Interface Names ```` em1 eno1 enp0s31f6 enp0s29u1u2 @@ -48,4 +49,5 @@ wlp3s0 wlp3s0b1 wlp19s0 wwp0s29u1u4i6 ```` -
chadmayfield revised this gist
Jun 3, 2019 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,10 @@ # Network Interface Notes Beginning in Systemd v197, network interfaces assigned by systemd/udev are "predicatble"; * [Predicatable Network Interface names](https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/) * [udev-builtin-net_id.c @ freedesktop.org](https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c) * [udev-builtin-net_id.c @ github.com/systemd](https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L12) ```` Two character prefixes based on the type of interface: -
chadmayfield created this gist
Jun 3, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ # Network Interface Notes https://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L12 https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ ```` Two character prefixes based on the type of interface: * en -- ethernet * sl -- serial line IP (slip) * wl -- wlan * ww -- wwan ```` [SO Answer: Find available network interfaces](https://unix.stackexchange.com/a/125401) #### Find network interface `ls /sys/class/net | grep -E "^e(m|n(o|p|s)|th[0-9])|wl(an|p)" find /sys/class/net ! -type d | xargs --max-args=1 realpath | awk -F\/ '/pci/{print $NF}'` #### Find available network interfaces `ip r | grep " src "|cut -d " " -f 3,12 | xargs ip addr show | awk '/inet.*brd/{print $NF}' ip -o link show up | awk -F': ' '{print $2}' ip -o -4 addr show ip -o link ls up lshw -class network` #### Observed Interface Names `em1 eno1 enp0s31f6 enp0s29u1u2 enp2s0 enp2s0f1 enp5s0 enp7s0 ens1 enx78e7d1ea46da eth0 p7p1 wlan0 wlp0s12f0 wlp3s0 wlp3s0b1 wlp19s0 wwp0s29u1u4i6`