How to configure the Ethernet interface

Dear Support,

I have a Verdin evaluation board with i.MX8 Mini and I have installed TorizonCore 6 on it.

I have connected a LAN7850 evaluation USB to LAN board and “eth0” is for that, and I am trying to assign an IP address to it using the command line,

sudo ip addr add 10.50.49.65/24 broadcast 10.50.49.255 dev eth0

but it is not working and I can not connect to that with putty.

I contacted Microchip support, and they suggested creating interfaces in the /etc/network on the interfaces by creating that and adding certain lines to it.

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

address 10.50.49.65

netmask 255.255.255.0

broadcast 10.50.49.255

However, after doing so, I still cannot access the Ethernet interface for eth0 and ethernet0. I lost connection.

I would greatly appreciate your assistance in properly configuring the Ethernet interface for eth0.

torizon@verdin-imx8mm-07219476:~$ ifconfig
br-5c04c2058d7f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        inet6 fe80::42:5dff:fe40:e97  prefixlen 64  scopeid 0x20<link>
        ether 02:42:5d:40:0e:97  txqueuelen 0  (Ethernet)
        RX packets 16  bytes 10564 (10.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48  bytes 7282 (7.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:78:26:46:6b  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::ea32:6101:21c4:bf07  prefixlen 64  scopeid 0x20<link>
        ether 4a:9b:27:b7:38:a0  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 41  bytes 6630 (6.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ethernet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.50.49.69  netmask 255.255.255.0  broadcast 10.50.49.255
        inet6 fe80::df9a:6318:4106:4922  prefixlen 64  scopeid 0x20<link>
        ether 00:14:2d:6e:29:14  txqueuelen 1000  (Ethernet)
        RX packets 1182  bytes 117854 (115.0 KiB)
        RX errors 0  dropped 36  overruns 0  frame 0
        TX packets 176  bytes 37442 (36.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Best regards,
Mehrdad

Could you please provide more information about your case?

  • Output from lsusb command
  • Run the command sudo ip addr flush dev eth0 to clear any previously assigned IP addresses.
  • Run the command sudo ip addr add 10.50.49.65/24 dev eth0 to assign the IP address 10.50.49.65 with subnet mask 255.255.255.0 to the eth0 interface.
  • Check and share the output of the command ifconfig eth0 to verify that the IP address has been assigned to the interface.

Hi @alex.tx ,

Device 4 is for my USB-to-ethernet lan7850

torizon@verdin-imx8mm-07219476:~$ lsusb
Bus 001 Device 003: ID 0424:2740 Microchip Technology, Inc. (formerly SMSC) Hub Controller
Bus 001 Device 004: ID 0424:7850 Microchip Technology, Inc. (formerly SMSC)
Bus 001 Device 002: ID 0424:2744 Microchip Technology, Inc. (formerly SMSC) Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

And by using the command you mentioned the output looks like the below, and the broadcast is zero, which is incomplete.

login as: torizon
torizon@verdin-imx8mm-07219476's password:
torizon@verdin-imx8mm-07219476:~$ sudo ip addr flush dev eth0
Password:
torizon@verdin-imx8mm-07219476:~$
torizon@verdin-imx8mm-07219476:~$ sudo ip addr add 10.50.49.65/24 dev eth0



torizon@verdin-imx8mm-07219476:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.50.49.65  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::f49b:b7cc:1b58:dcda  prefixlen 64  scopeid 0x20<link>
        ether e2:d3:9f:36:7a:15  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 31  bytes 5076 (4.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ethernet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.50.49.69  netmask 255.255.255.0  broadcast 10.50.49.255
        inet6 fe80::df9a:6318:4106:4922  prefixlen 64  scopeid 0x20<link>
        ether 00:14:2d:6e:29:14  txqueuelen 1000  (Ethernet)
        RX packets 716  bytes 65538 (64.0 KiB)
        RX errors 0  dropped 18  overruns 0  frame 0
        TX packets 77  bytes 12236 (11.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sudo ip addr add 10.50.49.65/24 brd 10.50.49.255 dev eth0
is complete but still doesn’t work

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.50.49.65  netmask 255.255.255.0  broadcast 10.50.49.255
        ether e2:d3:9f:36:7a:15  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 112  bytes 17688 (17.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ethernet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.50.49.69  netmask 255.255.255.0  broadcast 10.50.49.255
        inet6 fe80::df9a:6318:4106:4922  prefixlen 64  scopeid 0x20<link>
        ether 00:14:2d:6e:29:14  txqueuelen 1000  (Ethernet)
        RX packets 4067  bytes 356399 (348.0 KiB)
        RX errors 0  dropped 102  overruns 0  frame 0
        TX packets 117  bytes 20092 (19.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

If I use the command above, the http://10.50.49.69:8840/#!/1/docker/containers is not working, and I also cannot connect to 10.50.49.65 with Putty.

Best regards,
Mehrdad

I shared the ip link show output, which may be useful. Another board, so the Mac addresses of them are different.

torizon@verdin-imx8mm-07219476:~$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
3: ethernet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:14:2d:6e:29:14 brd ff:ff:ff:ff:ff:ff
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 2a:ee:90:21:9d:2a brd ff:ff:ff:ff:ff:ff
5: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
    link/can
6: mlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether 8a:ab:c0:08:86:00 brd ff:ff:ff:ff:ff:ff permaddr 48:e7:da:ff:5c:31
7: uap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether 6a:44:76:03:25:9b brd ff:ff:ff:ff:ff:ff permaddr 48:e7:da:ff:5e:31
8: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
    link/ether 02:42:ab:f2:e9:c5 brd ff:ff:ff:ff:ff:ff
9: br-f0b86e161846: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 02:42:b3:0a:40:63 brd ff:ff:ff:ff:ff:ff
11: veth2d4a573@if10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f0b86e161846 state UP mode DEFAULT group default
    link/ether c6:79:35:77:a5:8d brd ff:ff:ff:ff:ff:ff link-netnsid 0
13: veth566a4d4@if12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f0b86e161846 state UP mode DEFAULT group default
    link/ether 82:85:4d:dd:26:ef brd ff:ff:ff:ff:ff:ff link-netnsid 1

Could you explain what exactly doesn’t work? Have you check if All involved HW works as expected?
What happened if you try to ping 10.50.49.65 from another machine in the same subnet?

I apologize for the unclear explanation. To clarify, when I try to connect to eth0 using Putty, I am unable to establish a connection for eth0. Although I can successfully ping both the eth0 and ethernet0 connections, if I disconnect the ethernet0, the eth0 connection stops functioning.

Regarding HW, the evaluation board works perfectly when connected to my PC via USB, allowing me to ping and access the internet.

SO it’s not a problem with Ethernet but rather with SSH server or your Putty configuration.

Hello @Mehrdad ,

Were you able to fix your issue?

Best regards,
Josep

1 Like

Hi @josep.tx ,

Currently, I have not yet made any significant progress in this area. However, I would like to mention that everything appears to be functioning properly with the EEPROM. The LAN7850 evaluation has an EEPROM chip where the MAC address is configured. In the absence of an EEPROM, we need to resort to OTP (one-time programmable) solutions and with OTP works fine.

Without OTP and EEPROM, the device tree assigns random numbers as the MAC address, which is obviously undesirable.

If any significant developments occur, I will keep you updated. It is likely that utilizing EEPROM or OTP would be sufficient.

Thank you for your support.

Best regards,
Mehrdad

Hello @Mehrdad ,
Thank you very much for your feedback.

Best regards,
Josep

1 Like