Multiple Systemd Network

Hi

I am trying to ad multiple network configuration file for my systemd-network. Below is the snapshot content.

When only the eth0.network is present in the folder. The eth0 is able to configure properly and having both IPV4 and IPV6 IP address. When i added in the wlan0 the eth0 is not able to get an IPV4 IP address dynamically.

Dear @jy.teh ,

thanks for using the community.

What image and hardware versions are you using?

It would help us if you could provide a “dmesg” log.

Best Regards
Kevin

Are you sure wlan0 really is connected / associated with AP? Is systemd-networkd really running?

Hi Kevin

I am using a custom made image and a custom carrier board.

please find the dmesg attached.

link text

On start up the eth0 could not get an IPV4 address i keep seeing

[upload|WBRise68/oC8Amls4lfQ6xsyhNU=]

After i connect to the wifi using wpa_supp, both eth0 and wlan0 is able to get an IP address.

[upload|7B/xSmXhJ6205ZOz1V0Vmt6vHTs=]

Is it possible to get the eth0 connected without wlan0?

Hi Edward

Wlan0 is able to connect and associated with AP.
The problem is Eth0 is not able be connected. I could not get an IPV4 address on start up. What i get is something like this

[upload|4SSP8XvSW/bgzminLTYOZAPsG+w=]

But once I connect to the wlan0, both Eth0 and Wlan0 is able to get an IPV4 address.

[upload|vUejDBGeZGBDiQY8zzzpfJw1lcY=]

On start up i query the status of the systemd-networkd and it is running
[upload|UYI9zgZxVfYu2Xqc2Q1iTDQIUq4=]

Dear @jy.teh,

thank you for providing the information.

We will analyze your data and give you some recommendations soon.

Best Regards
Kevin

Hi @jy.teh,

Your systemd-networkd status shows periodic eth0 carrier gain then loss. Something’s wrong to hardware. Broken cable / broken switch / power supply issues / …

When I insert cable systemd-networkd status gives just one “Gained” event. It doesn’t depend on WiFi card presence or connection status:

Jun 14 07:03:44 rcserv systemd-networkd[400]: eth0: Gained carrier
Jun 14 07:03:46 rcserv systemd-networkd[400]: eth0: Gained IPv6LL
Jun 14 07:03:46 rcserv systemd-networkd[400]: eth0: DHCPv4 address 192.168...0.1

Hi Edward

I dont think the hardware is a problem.
From the 1st screenshots to the 2nd screenshots above, the connection of the LAN was not touched.
When I connect to a WIFI AP the eth0 able to connect successfully, the Carrier gain and loss does not appear anymore.

How WiFi may persuade wire to drop link? Perhaps some service may do something to ethernet. But systemd-networkd works rock solid for me on different families SOC’s. Both, with WiFi and without WiFi. Try stopping relevant and not relevant services, perhaps some of them does bad things.

You wrote you added wlan and ethernet got broken. Then please show what you added to /etc/systemd/networkd.

I will try to playing around stopping relevant and non relevant services.

Here is a screenshot of the eth0 and wlan conf file.

[upload|Qs5cS1EcGXqg0rydXZ/7Wbl2aIY=]

Another thing that make me feel that it is not a hardware issue is, if i remove the eth0.network file from /etc/systemd/networkd and manual bring the eth0 up using the command “ifconfig” and assign ip using “udhcpc”. It is fine.
[upload|ffpeDux3wdpd2bqLTD5QGI0JNTk=]

Obviously your network files are fine.

Are you using 802.1x wired ethernet authentication?

if i remove the eth0.network file from /etc/systemd/networkd and manual bring the eth0 up using the command “ifconfig” and assign ip using “udhcpc”. It is fine.

What about leaving eth0.network in place but starting with ethernet unplugged and plugging it only after WiFi connects? WiFi adds quite a lot to power consumption with noticeable peak while establishing connection. Doing manually later may reduce peak current. Something makes link down periodically. I don’t think it’s systemd-networkd. Can you use different WiFi adapter?

I am not using 802.1x wired ethernet authentication. There is no wpa_supp conf. for eth0.

What systemd version that you are using?
Currently i am using the 1.242.

I tried your valuable suggestion of connecting the wifi first before connecting the lan cable and vice versa. It is still the same. In both condition the eth0 keeps disconnecting.

Dear @jy.teh,

is this happening only when you are using your own carrier board?

Would it be possible for you to try to reproduce the issue, while using one of Toradex’ carrier boards?

Best Regards
Kevin

# systemctl --version
systemd 244 (244.5+)

It is BSP 5.2. It was fine as well with 5.0.

As I understand ethernet was working until You added wifi. Why don’t you rollback your changed? Something must be in those changes.

Hi Kevin,

I tried your suggestion on switching the SOM from our carrier board to using one of Toradex Carrier board and it is working.

I get my hardware team to find what are the differences between our carrier board and Toradex Carrier board and the difference are Toradex Carrier board is using the Gigabit Ethernet Port and our carrier board is using the 10/100Mbit Ethernet Port.

What could cause it to work differently? Are there any driver that was missing?

HI Edward,

I tried the suggestion from Kevin of using the Toradex Carrier board and it is working.

The difference between the Toradex Carrier board and the carrier board I am using are Toradex is using the Gigabit Ethernet Interface and the carrier board I am using is the 10/100 Ethernet interface.

If I rollback my changes ( adding the configuration file of wlan) it is working, just that when I add in the configuration file of wlan. The eth0 keeps disconnecting.

Hi Edward

I tried rolling back my changes( removing the wlan0 config file) and the eth0 is working fine.

I tried Kevins suggestion of trying it on the Toradex Carrier board and it is working. The differences between our carrier board and Toradex Carrier board and the difference are Toradex Carrier board is using the Gigabit Ethernet Port and our carrier board is using the 10/100Mbit Ethernet Port.

Is there any settings in the systemd for Gigabit and 10/100Mbit ehternet port?
I added in the Autonegotiation flag but it is still failing.

Hi @jy.teh ,

I don’t what’s going on. I don’t believe systemd is to blame.

It is not clear what’s the difference between your carrier board and TDX carrier board. Just two 1000TX wire pairs not wired to connector with magnetics? Perhaps a) those unused pairs need some termination or b) perhaps WiFi affects whose unterminated pairs and you need to tell in device tree that your phy is only 100Mbps capable. It is not clear for me which DT file you should look at. If I understood kernel Documentation properly it should be max-speed = <100>; setting among other phy settings. Like this one, but please review other settings if they mach your Apalis and carrier:

&fec {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_enet>;
	phy-handle = <&ethernet_phy0>;
	phy-mode = "rgmii-id";
	status = "okay";

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;
		ethernet_phy0: ethernet-phy@0 {
			compatible = "marvell,88E1510";
			device_type = "ethernet-phy";
			/* Set LED0 control: */
			/* On - Link, Blink - Activity, Off - No Link */
			marvell,reg-init = <3 0x10 0 0x1011>;
			max-speed = <100>;
			reg = <0>;
		};
	};
};