Changing between LAN and WAN automatically

Greetings!

I'm building a Pi CM4 based travel router with an LTE modem, and want to dynamically and automatically change the behavior of the Ethernet port.

I'm not sure this is possible automatically, but ideally this is what I'd like to do.

Pseudo code:

If eth0 receives a DHCP offer:
  eth0 == wan
  wlan == lan
  wwan == not used
else:
  eth0 == lan
  wlan == lan
  wwan == wan

Thanks!

have you looked at the travelmate package ?

2 Likes

I haven't, but I'll take a look. Thanks!