Schedule disconnect to other router

I have Gli router connected to huawei modem connected to Peplink
I want Gli router to disconnect Peplink if huawei DNS cannot be reached
Peplink cannot tell if Gli router has no internet due to DHCP
I want WAN to terminate so peplink will know router is not working

ip link set <name> down
ip link set <name> up

or, the much more invasive

/etc/init.d/network restart

Edit:

NAME
       ip-link - network device configuration

SYNOPSIS
       ip link  { COMMAND | help }

       ip link add [ link DEVICE ] [ name ] NAME
               [ txqueuelen PACKETS ]
               [ address LLADDR ] [ broadcast LLADDR ]
               [ mtu MTU ] [ index IDX ]
               [ numtxqueues QUEUE_COUNT ] [ numrxqueues QUEUE_COUNT ]
               [ gso_max_size BYTES ] [ gso_max_segs SEGMENTS ]
               type TYPE [ ARGS ]

       ip link delete { DEVICE | group GROUP } type TYPE [ ARGS ]

       ip link set { DEVICE | group GROUP }
               [ { up | down } ]

brings the link (interface) down, which runs the hotplug scripts for “interface not available”, then up again, running the hotplug scripts for “interface becomes available”

/etc/init.d/network restart reads the network configuration from UCI, and reconfigures it as needed using netifd

1 Like

could you explain how this command works
when huawei modem cannot resolve DNS, it still gives carrier IP address
I can ping the assigned IP address but pings to the internet do not resolve

WWAN modems and WWAN providers can be fickle. The modems often don’t report when the wireless link goes down, so “your” router doesn’t know that the link is gone. The providers sometimes don’t respond to pings on their gateways or routers.

Without more information on the status of your modem and link, it is hard to further diagnose.