How to disable LAN by cron?

Hi there,
I've already set my install up to turn off WiFi at the same time each night. I'm trying to do the same with my ethernet lan ports at 10pm. The LAN interface seems to be named br-lan. So far, I've tried:

00 22 * * * /sbin/ifdown br-lan


00 22 * * * ifdown br-lan

...but neither seem to work and all of the references I've found online seem to be for WiFi only.

So what command would I need to issue in cron, to shut down the LAN/ethernet each night?

You are aware of what a router is, correct?

  • Can you explain what issue you're having with the command?
  • Can you describe the expected outcome you desire by shutting down the LAN/Ethernet (e.g. lights off, no ARP, no LAN-to-WAN traffic, etc.)?

(I'd advice the VLAN interface; but depending on your desired outcome, that may not work either.)

1 Like

A curious question... but yes, I'm aware of what a router is...

This issue is that I would like the connectivity to the ethernet connected devices to be cut off at a certain time each night. The commands I tried didn't make any visible change to the connectivity.

The desired outcome is that devices connected via ethernet cease to get access to the internet after a certain time. I want this to encourage myself to switch off and wind down before going to bed. I already have the wifi turning off with /sbin/wifi down, but this does nothing to disconnect the devices connected to the ethernet ports.

There usually is not a way for software to turn off the ports at layer 1, i.e. turn the link lights out.

You can call swconfig to reassign each one to a VLAN that goes nowhere, which will drop all the packets.

Try ifdown lan

1 Like