Make a link from enp0s8 to eth0 how? [SOLVED]

Getting your soundcard to work, using Debian on non-i386 hardware, etc

Make a link from enp0s8 to eth0 how? [SOLVED]

Postby Raymond Day » 2020-12-30 18:44

Installed Debian server on my old Magnia SG30 and it has a display in the front of it. I copied a folder to made for the built in LCD folder named "lcd-2.2" Did a make and make install.

Then on the command line did this:

Code: Select all
root@sg30:/home/raymond# ls
lcd-2.2  lcd-2.2.1.tar
root@sg30:/home/raymond# cd lcd-2.2/
root@sg30:/home/raymond/lcd-2.2# ls
firewall-off.sh  ipaddr  lcd-2.2    lcd.c   lcd.init  README
firewall.sh      lcd     lcd-2.2.c  lcd.c~  Makefile
root@sg30:/home/raymond/lcd-2.2# make
make: 'lcd' is up to date.
root@sg30:/home/raymond/lcd-2.2# make install
cp lcd /usr/sbin
cp lcd.init /etc/init.d/lcd
root@sg30:/home/raymond/lcd-2.2# lcd start
Usage: lcd [-f] <command> [...]
<command> can be server, write, read, fans
   server    run in server mode taking over LCD, buttons and fans
   write     writes next two parameters to display
   read      reads LCD buttons with optional timeout
   fans      turn fans on or off
Use the -f option to display temperatures in Fahrenheit.
root@sg30:/home/raymond/lcd-2.2# lcd server
sh: 1: /usr/local/sbin/ipaddr: not found
sh: 1: /usr/local/sbin/ipaddr: not found
Device "eth0" does not exist.
Use of uninitialized value $1 in print at /usr/local/sbin/ipaddr line 11.
Device "eth1" does not exist.
Use of uninitialized value $1 in print at /usr/local/sbin/ipaddr line 11.


It does not come back to the command line but it does work when I press the button next to the LCD it changes the display and does show a lot of nice data works but the IP don't work. I did hand like copy the "ipaddr" to /usr/local/sbin/ and now it says eth0 and eth1 does not exist when I press the button.

It's a bin file don't know how to edit it.

So can I make a symbolic line from:

Code: Select all
root@sg30:~# ifconfig
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.105  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::210:c6ff:fe1f:5ab3  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b3  txqueuelen 1000  (Ethernet)
        RX packets 94444  bytes 12609409 (12.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5501  bytes 1525192 (1.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.100  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::210:c6ff:fe1f:5ab2  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b2  txqueuelen 1000  (Ethernet)
        RX packets 90433  bytes 12394484 (11.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1075  bytes 89716 (87.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1368  bytes 137213 (133.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1368  bytes 137213 (133.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@sg30:~#


So enp0s8 to eth0 and enp0s9 to eth1

I don't know where they are if they are in a folder.

Did find this link:

sys/class/net/devices/pci0000:00/0000:00:08.0/net/enp0s8

So can I do this command:

ln -s /sys/class/net/devices/pci0000:00/0000:00:08.0/net/enp0s8 /sys/class/net/devices/pci0000:00/0000:00:08.0/net/eth0

Then reboot I guess and would that work? I have not tried it yet, not sure if that is the right way to do it.

This is a server not a desktop. Not scream on it just that little LCD in the front that looks like it's working now. But not all working yet. But most looks like.

-Raymond Day
Last edited by Raymond Day on 2020-12-31 00:27, edited 1 time in total.
Raymond Day
 
Posts: 20
Joined: 2020-12-25 15:23

Re: Make a link from enp0s8 to eth0 how?

Postby Head_on_a_Stick » 2020-12-30 19:01

Sysfs is a virtual filesystem that is created by the kernel during the boot process, any symlinks would not persist. And anyway just symlinking that file wouldn't do what you want.

It is possible to disable the predictable nomenclature for the network interfaces: https://www.freedesktop.org/wiki/Softwa ... faceNames/

But this is clearly an XY problem. What is this mysterious "lcd" program? What are you trying to do with it?
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Make a link from enp0s8 to eth0 how?

Postby Raymond Day » 2020-12-30 19:54

Just made a YouTube video will show how this works. All but the IP is working if could just fix that.

-Raymond Day
Raymond Day
 
Posts: 20
Joined: 2020-12-25 15:23

Re: Make a link from enp0s8 to eth0 how?

Postby Raymond Day » 2020-12-30 20:16

I just renamed them looks like it worked. I have not rebooted it yet to see if it stays.

Code: Select all
root@sg30:~# ifconfig
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.105  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::210:c6ff:fe1f:5ab3  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b3  txqueuelen 1000  (Ethernet)
        RX packets 430  bytes 50679 (49.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 46  bytes 6060 (5.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.100  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::210:c6ff:fe1f:5ab2  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b2  txqueuelen 1000  (Ethernet)
        RX packets 589  bytes 71900 (70.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 160  bytes 48648 (47.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 156 (156.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 156 (156.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@sg30:~# ifconfig enp0s8 down
root@sg30:~# ip link set enp0s8 name eth0
root@sg30:~# ifconfig eth0 up
root@sg30:~# ifconfig
enp0s9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.100  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::210:c6ff:fe1f:5ab2  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b2  txqueuelen 1000  (Ethernet)
        RX packets 3939  bytes 582974 (569.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 357  bytes 83418 (81.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.105  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::da89:9903:b1ac:19c7  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b3  txqueuelen 1000  (Ethernet)
        RX packets 3205  bytes 471701 (460.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 99  bytes 12194 (11.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 32  bytes 2733 (2.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 32  bytes 2733 (2.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@sg30:~# ifconfig enp0s9 down
root@sg30:~# ip link set enp0s9 name eth1
root@sg30:~# ifconfig eth1 up
root@sg30:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.105  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::da89:9903:b1ac:19c7  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b3  txqueuelen 1000  (Ethernet)
        RX packets 3831  bytes 561205 (548.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 170  bytes 19978 (19.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.100  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::7dbd:dca9:dd3a:5f8e  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b2  txqueuelen 1000  (Ethernet)
        RX packets 4431  bytes 655563 (640.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 446  bytes 101851 (99.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 36  bytes 2889 (2.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 36  bytes 2889 (2.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@sg30:~#


Because have 2 networks on it when I did the ifconfig down I was still connected.

Tested the LCD and now it shows the 2 IP addresses.

-Raymond Day
Raymond Day
 
Posts: 20
Joined: 2020-12-25 15:23

Re: Make a link from enp0s8 to eth0 how?

Postby Raymond Day » 2020-12-30 20:21

Just rebooted it and it did not save. It's back to its old default ethernet names. How can I save it?

-Raymond Day
Raymond Day
 
Posts: 20
Joined: 2020-12-25 15:23

Re: Make a link from enp0s8 to eth0 how?

Postby Head_on_a_Stick » 2020-12-30 20:32

Raymond Day wrote:How can I save it?

Read my post again, I've already provided a link that explains how to revert to the "eth" naming system.

Raymond Day wrote:made a YouTube video

I'm not watching that, I don't have the patience. Sorry.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Make a link from enp0s8 to eth0 how?

Postby Raymond Day » 2020-12-30 20:56

Went to that link it says to do it make a link to

Save the file and reopen it and it has nothing in it. Just a blank file. ln -s /dev/null /etc/systemd/network/99-default.link

So I copied from the old Ubuntu load still have it on another SSD /etc/systemd/network/70-persistend-net.rules file. Put this in it copied from what was working in it as Ubuntu 18.

Code: Select all
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x1209 (e100)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:c6:1f:5a:b2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:c6:1f:5a:b3", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


Rebooted and it did not change same thing. Wow it is hard to change the Ethernet name and have it save on boot up.

Rename the 70-persistend-net.rules to 99-default.link rebooted and still did not save it.

-Raymond Day
Raymond Day
 
Posts: 20
Joined: 2020-12-25 15:23

Re: Make a link from enp0s8 to eth0 how?

Postby Head_on_a_Stick » 2020-12-30 21:11

Raymond Day wrote:Save the file and reopen it and it has nothing in it. Just a blank file.

Yes, that is expected, /dev/null doesn't contain anything. The clue is in the name.

Check you've done it correctly, the output for this command should end with an arrow pointing to /dev/null:
Code: Select all
ls -l /etc/systemd/network/99-default.link

And check if you're actually using systemd as the init system:
Code: Select all
cat /proc/1/comm

If the symlink technique isn't working then try the third option listed in my link. See https://wiki.archlinux.org/index.php/Ke ... eters#GRUB for the method.

Raymond Day wrote:So I copied from the old Ubuntu load still have it on another SSD /etc/systemd/network/70-persistend-net.rules file.

That's not a .link file. Read systemd.link(5).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Make a link from enp0s8 to eth0 how?

Postby Raymond Day » 2020-12-31 00:11

Do not get this it works with eth1 but not eth0.

Every reboot it looks like names it rename1 rename2 rename3

That is how much I tested it. Rebooted it. Got this file at /etc/systemd/network/99-default.link

Code: Select all
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x1209 (e100)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:c6:1f:5a:b2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x10ec:0x8139 (8139too)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:10:c6:1f:5a:b3", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

[Match]
MACAddress=00:10:c6:1f:5a:b3
[Link]
Name=eth0

[Match]
MACAddress=00:10:c6:1f:5a:b2
[Link]
Name=eth1


They are the same only eth0 and eth1 and the last number of the MAC address.

Is there some other way to put this in for the other Ethernet?

Should I make a 100-default.link with it in it?

After a lot of reboots it shows this.

Code: Select all
root@sg30:~# ifconfig
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.101  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::210:c6ff:fe1f:5ab3  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b3  txqueuelen 1000  (Ethernet)
        RX packets 745  bytes 90667 (88.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 175  bytes 29948 (29.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 18  bytes 1692 (1.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 18  bytes 1692 (1.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

rename3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.100  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::71e2:3d9a:d057:7a10  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b2  txqueuelen 1000  (Ethernet)
        RX packets 588  bytes 72725 (71.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 49  bytes 5714 (5.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@sg30:~#


Just don't get why it's doing the rename3


-Raymond Day
Raymond Day
 
Posts: 20
Joined: 2020-12-25 15:23

Re: Make a link from enp0s8 to eth0 how?

Postby Raymond Day » 2020-12-31 00:26

Wow it worked I had to make 2 files just guessing and rebooted and it has the names of eth0 and eth1 now and the LCD now shows the IP address.

Code: Select all
root@sg30:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.23  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::210:c6ff:fe1f:5ab2  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b2  txqueuelen 1000  (Ethernet)
        RX packets 793  bytes 85050 (83.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 107  bytes 16848 (16.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.86.101  netmask 255.255.255.0  broadcast 192.168.86.255
        inet6 fe80::210:c6ff:fe1f:5ab3  prefixlen 64  scopeid 0x20<link>
        ether 00:10:c6:1f:5a:b3  txqueuelen 1000  (Ethernet)
        RX packets 770  bytes 81170 (79.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 137  bytes 18388 (17.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 156 (156.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 156 (156.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@sg30:~# cd /etc/systemd/network/
root@sg30:/etc/systemd/network# ls -l
total 8
-rw-r--r-- 1 root root 53 Dec 30 20:09 98-default.link
-rw-r--r-- 1 root root 55 Dec 30 20:09 99-default.link
root@sg30:/etc/systemd/network#


In the files they just have this 2 line code.

Code: Select all
[Match]
MACAddress=00:10:c6:1f:5a:b3
[Link]
Name=eth1


The same with the 99 file only eth0 and the other mac address.

Wow got it working on reboot now. Took a while.

Never did do a link but a rename.

-Raymond Day
Raymond Day
 
Posts: 20
Joined: 2020-12-25 15:23

Re: Make a link from enp0s8 to eth0 how? [SOLVED]

Postby Raymond Day » 2020-12-31 02:57

O one more thing on the command you said to do. Looks like it is working on my system.

Code: Select all
root@sg30:/etc/systemd/network# cat /proc/1/comm
systemd
root@sg30:/etc/systemd/network#


So it just comes back says "systemd". I remember I did that before when I 1st seen your post and it came back blank.

-Raymond Day
Raymond Day
 
Posts: 20
Joined: 2020-12-25 15:23

Re: Make a link from enp0s8 to eth0 how? [SOLVED]

Postby Head_on_a_Stick » 2020-12-31 09:51

You shouldn't use .link files to rename interfaces with "eth":
systemd.link(5) wrote:Note that specifying a name that the kernel might use for another interface (for example "eth0") is dangerous because the name assignment done by udev will race with the assignment done by the kernel, and only one interface may use the name. Depending on the order of operations, either udev or the kernel will win, making the naming unpredictable. It is best to use some different prefix, for example "internal0"/"external0" or "lan0"/"lan1"/"lan3".

If you want to assign "eth" names to specific cards then disable the predictable naming system completely (either by symlink to /dev/null or by kernel parameter) and then follow this guide:

https://serverfault.com/questions/60148 ... -net-names
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to Hardware

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable