<div dir="ltr"><div>Yet another update, I was able to get it working .. but feel like it is a hack so comments welcome ... see below:<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 17, 2021 at 12:26 AM Brian Hutchinson <<a href="mailto:b.hutchman@gmail.com">b.hutchman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Update below<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 16, 2021 at 2:27 PM Brian Hutchinson <<a href="mailto:b.hutchman@gmail.com" target="_blank">b.hutchman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Hi Mikulėnas,<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 16, 2021, 3:12 AM Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Most of this looks like it could be done with systemd-networkd to create a bond .netdev, with a small oneshot service for i2c. (What's the exact criteria for when it should be run? Does it depend on bond0 being there, does it need to be last, etc?)</div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">It can be last in the startup chain I guess, don't know what other systemd things that might need the network to be up before the last unit file runs.</div><div dir="auto"><br></div><div dir="auto">I start linuxptp too so I would have the unit file that starts ptp4l start after the bond was created etc.</div><div dir="auto"><br></div><div dir="auto">Same thing for the i2c command to enable the switch.</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto"><br></div><div dir="auto">Brian</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 16, 2021, 02:58 Brian Hutchinson <<a href="mailto:b.hutchman@gmail.com" rel="noreferrer" target="_blank">b.hutchman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I'm on a IMX8 platform and have a Microchip KSZ9567 Ethernet switch. I can use IP commands to manually bring lan1 and lan2 interfaces up and then create a redundant/failover bond ... but I'm having difficulty figuring out how to do this the "systemd" way.</div><div><br></div><div>My first attempt was to just have systemd run a script of all the commands I do manually but during system startup there appears to be race conditions so I have to set my service type to "Idle" and sometimes even that doesn't work. So I want to exploit any systemd support for DSA and bonding.</div><div><br></div><div>Here is script my manual steps which is what I want systemd to ultimately do:</div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">#!/bin/bash
</span><br>
<br># Create a redundant bond between ksz9567 DSA lan1 and lan2 interfaces <br>
<br></span></div><div><span style="font-family:monospace"># Load bonding kernel module
<br>modprobe bonding
<br>
<br># Bring up CPU interface (cpu to switch port 7 - the RGMII link)
<br>ip link set eth0 up
<br>
<br># Create a bond
<br>echo +bond0 > /sys/class/net/bonding_masters
<br>
<br># Set mode to active-backup (redundancy failover)
<br>echo active-backup > /sys/class/net/bond0/bonding/mode
<br>
<br># Set time it takes (in ms) for slave to move when a link goes down
<br>echo 1000 > /sys/class/net/bond0/bonding/miimon
<br>
<br># Add slaves to bond
<br>
<br>echo +lan1 > /sys/class/net/bond0/bonding/slaves
<br>echo +lan2 > /sys/class/net/bond0/bonding/slaves
<br>
<br># Set IP and netmask of the bond
<br>ip addr add <a href="http://192.168.0.4/24" rel="noreferrer noreferrer" target="_blank">192.168.0.4/24</a> dev bond0
<br>
<br># And bring bond up. Pings and network connectivity should work now
<br>ip link set bond0 up
<br>
<br># For a board that doesn't have Ethernet switch hardware strapped to enable at boot .. enable it now
<br>i2cset -f -y 0 0x5f 0x03 0x00 0x01 i<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Thanks for any information, pointers etc.</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Regards,</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Brian<br></span></div></div></blockquote></div></blockquote></div></div></div></blockquote><div><br></div><div>So not sure I'm doing this right. eth0 needs to be up before lan1 and lan2 can be added to the bond. Not quite sure how to do that with systemd but I made the following files and see some progress but ping doesn't work so appears I have no network connectivity:</div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">root@imx8mmevk:/etc/systemd/network# cat 10-bond1.netdev </span><br>[NetDev]
<br>Name=bond1
<br>Kind=bond
<br>
<br>[Bond]
<br>Mode=active-backup
<br>PrimaryReselectPolicy=failure
<br>MIIMonitorSec=2s<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">root@imx8mmevk:/etc/systemd/network# cat 10-bond1.network </span><br>[Match]
<br>Name=bond1
<br>
<br>[Network]
<br>Address=<a href="http://192.168.0.4/24" target="_blank">192.168.0.4/24</a></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">root@imx8mmevk:/etc/systemd/network# cat 20-lan1.network </span><br>[Match]
<br>Name=lan1
<br>
<br>[Network]
<br>Bond=bond1
<br>PrimarySlave=true</span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">root@imx8mmevk:/etc/systemd/network# cat 30-lan2.network </span><br>[Match]
<br>Name=lan2
<br>
<br>[Network]
<br>Bond=bond</span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">ip link list
</span><br>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
<br> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
<br>2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1506 qdisc mq state UP mode DEFAULT group default qlen 1000
<br> link/ether f0:1f:af:6b:b2:17 brd ff:ff:ff:ff:ff:ff
<br>3: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
<br> link/ether f0:1f:af:6b:b2:17 brd ff:ff:ff:ff:ff:ff
<br>4: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
<br> link/ether f0:1f:af:6b:b2:17 brd ff:ff:ff:ff:ff:ff
<br>5: bond1: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
<br> link/ether be:87:0a:9b:13:03 brd ff:ff:ff:ff:ff:ff</span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">cat /proc/net/bonding/bond1
</span><br>Ethernet Channel Bonding Driver: v5.10.69
<br>
<br>Bonding Mode: fault-tolerance (active-backup)
<br>Primary Slave: None
<br>Currently Active Slave: None
<br>MII Status: down
<br>MII Polling Interval (ms): 2000
<br>Up Delay (ms): 0
<br>Down Delay (ms): 0
<br>Peer Notification Delay (ms): 0<br></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace">At this point there should be info on lan1 and lan2 status but don't see it.<br></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace">... so of course I can't ping.</span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace">Next I did systemctl restart systemd-networkd and saw the following:</span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">systemctl restart systemd-networkd
</span><br>root@imx8mmevk:~# [ 33.816313] device eth0 entered promiscuous mode
<br>[ 33.821026] audit: type=1700 audit(1636550966.339:2): dev=eth0 prom=256 old_prom=0 auid=4294967295 uid=995 gid=994 ses=4294967295
<br>[ 33.867164] ksz9477-switch 0-005f lan2: configuring for phy/gmii link mode
<br>[ 33.875066] bond1: (slave lan2): Enslaving as a backup interface with a down link
<br>[ 33.919055] ksz9477-switch 0-005f lan1: configuring for phy/gmii link mode
<br>[ 33.926683] bond1: (slave lan1): Enslaving as a backup interface with a down link
<br>[ 38.066148] ksz9477-switch 0-005f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
<br>[ 39.472022] bond1: (slave lan1): link status definitely up, 1000 Mbps full duplex
<br>[ 39.479537] bond1: (slave lan1): making interface the new active one
<br>[ 39.486154] bond1: active interface up!
<br>[ 39.490071] IPv6: ADDRCONF(NETDEV_CHANGE): bond1: link becomes ready</span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace">At which point I can ping. Feels like there still might be some kind of race condition as things won't work unless I manually issue <span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">systemctl restart systemd-networkd command after logging in.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">In kernel dmesg logs I see:</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[ 4.165940] bond1: (slave lan2): Opening slave failed
</span><br>[ 4.196834] bond1: (slave lan1): Opening slave failed
<br>[ 4.315588] Generic PHY fixed-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=POLL)
<br>[ 4.326181] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
<br>[ 4.561000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><span style="font-family:monospace"><br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
</span><br> Active: <span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;32mactive (running)</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0m since Sun 2020-09-20 10:43:59 UTC; 1 years 1 months ago
</span><br>TriggeredBy: <span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;32m*</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0m systemd-networkd.socket
</span><br> Docs: man:systemd-networkd.service(8)
<br> Main PID: 251 (systemd-network)
<br> Status: "Processing requests..."
<br> Tasks: 1 (limit: 1574)
<br> Memory: 1.5M
<br> CGroup: /system.slice/systemd-networkd.service
<br> `-251 /lib/systemd/systemd-networkd
<br>
<br>Nov 10 13:28:56 imx8mmevk systemd-networkd[251]: <span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;31m</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;39m</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;31mlan2: Could not join netdev: Network is down</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0m
</span><br>Nov 10 13:28:56 imx8mmevk systemd-networkd[251]: <span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;38;5;185m</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;39m</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;38;5;185mlan2: Failed</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0m
</span><br>Nov 10 13:28:56 imx8mmevk systemd-networkd[251]: <span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;31m</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;39m</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;31mlan1: Could not join netdev: Network is down</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0m
</span><br>Nov 10 13:28:56 imx8mmevk systemd-networkd[251]: <span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;38;5;185m</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;39m</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0;1;38;5;185mlan1: Failed</span><span style="color:rgb(255,255,255);background-color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">[0m
</span><br>Nov 10 13:28:56 imx8mmevk systemd-networkd[251]: eth0: IPv6 successfully enabled
<br>Nov 10 13:28:56 imx8mmevk systemd-networkd[251]: eth0: Link UP
<br>Nov 10 13:28:57 imx8mmevk systemd-networkd[251]: eth0: Gained carrier
<br>Nov 10 13:28:57 imx8mmevk systemd-networkd[251]: bond1: IPv6 successfully enabled
<br>Nov 10 13:28:57 imx8mmevk systemd-networkd[251]: bond1: Link UP
<br>Nov 10 13:28:58 imx8mmevk systemd-networkd[251]: eth0: Gained IPv6LL<br>
<br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><span style="font-family:monospace">... so looks like the bond stuff is trying to happen before eth0 (my DSA HOST/CPU interface to switch) is up. How can I make eth0 up with systemd? eth0 just needs to be up ... no IP etc., and the bond1 gets the IP etc.<br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">For now I'm doing the i2c command to enable my switch in u-boot but still need to incorporate that into systemd somehow.<br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">Any ideas as to what I'm doing wrong? I think at a minimum I need to bring eth0 up before the bonding stuff happens but not quite sure what that would look like using systemd.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">Regards,</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"><br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">Brian<br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></span></span></span></div></div></div></blockquote><div> </div><div>I tried and tried to get eth0 to come up before the bond was brought up. I had everything named in lexical order but didn't appear to matter. I added a eth0.network file and in it specified <code class="gmail-varname">ActivationPolicy=</code>always-up and other things but could not get eth0 to come up.</div><div><br></div><div>It was obvious the bond was trying to be established before eth0 was up and since this is using DSA that just won't work. Dmesg logs would show slaves being added before eth0 was up as in copy/paste from previous email.<br></div><div><br></div><div>So I added a service to bring eth0 up:</div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">cat eth0-up.service </span><br>[Unit]
<br>Description=Bring eth0 up before bonding
<br>Before=network-pre.target
<br>Wants=network-pre.target
<br>
<br>[Service]
<br>ExecStart=/usr/local/bin/eth0-up.sh
<br>RemainAfterExit=yes
<br>
<br>[Install]
<br>WantedBy=multi-user.target<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">cat /usr/local/bin/eth0-up.sh </span><br>#!/bin/bash
<br>ip link set eth0 up<br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">... I feel like this is a hack, that systemd can probably do this but either I can't figure out how or there is a problem with the code.</span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">Again, advice and info welcome.</span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">Regards,</span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace"><br></span></span></div><div><span style="font-family:monospace"><span style="font-family:monospace">Brian<br></span></span></div></div></div>