How to handle network if there are two interfaces for wan?

Hi All,

We are developing our own 5G cellular router with OpenWrt 21.02.0.
Device have 1 LAN port, 2 WAN ports(wan2 for ethernet port and wan for 5G cellular port).

This is board.json from device.

root@OpenWrt:~# cat /etc/board.json 
	"model": {
		"id": "ABC",
		"name": "ABC"
	"network": {
		"lan": {
			"ports": [
			"protocol": "static"
		"wan2": {
			"device": "eth0.2",
			"protocol": "dhcp"
		"wan": {
			"ifname": "ccm",
			"protocol": "mipc"
		"wan6": {
			"ifname": "ccm",
			"protocol": "mipc"


  1. How to define hot plug for wan/wan2? How to update routing table when wan/wan2 is plugin?
  2. How to define the routing table priority when both wan and wan2 are plugging?
    We would like to see wan port have higher priority.
  3. How to do load balance betwenn wan and wan2?
    If there are some devices already have above features at OpenWrt 21.02.0 branch, please let me know.
    We will try to study it first. Thanks.

Hi @vgaetera

Thanks. We will study this first. Have a good day.

1 Like

Hi @vgaetera

After trying mwan3, I think I need some help. Thanks.

By default, device are plugin wan2(ethernet) and wan(5G cellular).
I can see following info and I can ping

root@OpenWrt:~# ip route s
default via dev ccm proto static src dev ccm proto kernel scope link src dev br-lan proto kernel scope link src dev eth0.2 proto kernel scope link src 

Then, I try to unplug wan(5G cellular) and fail to ping
Look like route is not correct.

root@OpenWrt:~# ip route dev br-lan proto kernel scope link src dev eth0.2 proto kernel scope link src 


  1. How do I define plugin/unplug behavior for wan and wan2 interface?
  2. What is the classic action when wan/wan2 is plugin/unplug? Any target project I can refer?

Please help. Thanks.

Hi all,

I following hotplug wiki page to add my action script for wan/wan2.
But, looks like uevent from wan2 is not stable.
Anyone have such experience to debug? Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.