After playing with this for a bit I have a working workaround, not ideal but it does work. Basically after playing about with what commands I could run once booted I could get it to work without physically removing the cable by bringing the main interface down and then up again worked a treat. After I did this I would get the message
Code: Select all
br0: port(enp0s25) entered forwarding state
and then everything would be working correctly.
I have created a bash script that quite simply brings the interface down, waits a few seconds then brings it back up again. I then created a systemd service and timer to run this script 45 seconds after the system boots. I needed to use a timer to delay the execution of the script otherwise it wouldn't take affect. I picked 45 seconds as it seemed good on my system, I reckon I could easily go to 25 but it would require testing. About 15 seconds after boot the network card comes up automatically and I want this to have completed before my script is run.
Below is my script, something I did find but never really looked into is that the ifup and ifdown commands are now deprecated in favour of ip based commands which would be something to keep in mind
Code: Select all
#!/bin/bash
ifdown enp0s25
sleep 3
ifup enp0s25
Here is my Service, an important thing in here is the minus (-) before the bash path in ExecStart, basically it tells systemd to ignore any returned fail state and to think it succeeded, without it systemd thinks the service fails.
Code: Select all
[Unit]
Description=Actually enable the Network Interfaces
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
User=root
ExecStart=-/bin/bash /media/data1/MyScripts/network.sh
[Install]
WantedBy=multi-user.target
And here is my timer
Code: Select all
[Unit]
Description=Runs the script on boot
[Timer]
#Time to wait after boot before activating
OnBootSec=45
Unit=internet.service
[Install]
WantedBy=multi-user.target
Obviously I would rather I could actually solve the problem, looking at the messages I get it seems that it is related to the main network interface not forwarding correctly to the bridge but I don't know where to start when solving this. I hope someone else finds this useful.