Change physical NIC below the red interface by bash scripting

Hello together,

i want to do what the “setup” does when it defines the physical network interfaces -
in this case for “red”,
but want to do exactly the same things in a script / cron job,
which results in an reactivated and working “red” ,
but with a changed physical apapter below
( as a flip flop mech., when there is no ping or other traffic on the current “red” possible).

We want to setup a really easy failover, a short outage is ok.

  • 3 pings to different targets and / or a dnslookup fail - then change physical nic bleow the “red” adapter.

We have two different lines with 2 absolutely identical “Fritz Boxes”
Even the LAN IP on port 1 of each Fritz is the same, but only one is connected to the current red now :slight_smile:
I Have a two port USB Nic ( 2 separate mac addresses for sure ) available for “red”
Only one is active now and connected to “Fritz Box” one.
The other one is down now and connected to “Fritz Box” two and should only then come up as the new “red” when a failure of the other connection is detected.
We want to keep it as simple as this is.
Shure we could design a VLAN on the switch, connect red and connect the 2 “Fritzes” with different IPs to it,
and run a cron job, with some “magic to change the default route”, do some ip route(2) / ip rule and iptables things … but thats not that, what i want to do here and i don’t want to customize the IPFire upside down for such a simle thing :slight_smile:
Another thing is, that the switch ports are really rare there in the small office…
so that i don’t want to block another 3 ports for the routing VLAN solution.

Thank you,

Vossi
So i only need the "mechanics IpFire does in its setup routine while changing an adapter for red.