Hi,
By default I can use eth0. How to use other Ethernet?
Hi,
By default I can use eth0. How to use other Ethernet?
Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
First, identify all available network interfaces on your system using the ip link command(1):
# ip link
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: eth0: <BROADCAST,MULTICAST,DYNAMIC> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether 00:14:2d:59:ca:81 brd ff:ff:ff:ff:ff:ff
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default
link/sit 0.0.0.0 brd 0.0.0.0
4: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
For the BSP, Ethernet interfaces are named eth<x>, where <x> represents the number of the interface(1).
Some Toradex SoMs feature a second Ethernet controller available as a reduced gigabit media independent interface (RGMII)(2). To use it, a second Ethernet PHY on your carrier board is required(2).
The second Ethernet port requires specific hardware implementation on the carrier board(2). For example, on the Verdin iMX8M Plus, the device tree configuration includes power switching controlled by the PWR_CTRL_4 signal connected to a GPIO Expander(2):
reg_eth2phy: regulator-eth2phy {
compatible = "regulator-fixed";
enable-active-high;
gpio = <&gpio_expander_21 4 GPIO_ACTIVE_HIGH>; /* PWR_CTRL_4/ETH_PWR_EN */
off-on-delay = <500000>;
regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3300000>;
regulator-name = "+V3.3_ETH";
startup-delay-us = <200000>;
vin-supply = <®_3p3v>;
};
To configure a second Ethernet interface (e.g., eth1) with a static IP address(1):
# ip link set eth1 up
# ip addr add 192.168.20.2/24 broadcast 192.168.20.255 dev eth1
# ip route add default via 192.168.20.1
To configure the second Ethernet interface to obtain an IP address via DHCP(1):
# udhcpc -i eth1
You can also use ConnMan to manage additional Ethernet interfaces. First, identify the interface using ConnMan(1):
# connmanctl services
Then configure it for static IP:
# connmanctl config ethernet_<MAC_ADDRESS>_cable --ipv4 manual 192.168.20.2 255.255.255.0 192.168.20.1
Or for DHCP:
# connmanctl config ethernet_<MAC_ADDRESS>_cable --ipv4 dhcp
ethernet<x> instead of eth<x>(1)Best regards, Toradex AI Assistant.
I am using verdin iMX8M Plus SOM.
Please find below image to see all available interface in my board
How to get eth1?
Hello @khaled.hassan,
To use the second ethernet on the Ivy, you need to enable its device tree.
This can only be done in Torizon OS 7.
To do so, you can run the following command:
If using a module without wifi:
sudo fw_setenv fdtfile imx8mp-verdin-nonwifi-ivy.dtb
If using a module with wifi:
sudo fw_setenv fdtfile imx8mp-verdin-wifi-ivy.dtb
Afterwards, you can reboot the board and the second ethernet interface will be up and running.
Best Regards,
Bruno