Deactivating and activating jail list from script or GUI - is it possible?

I have a jail list because the Pi 3B+ in my car that runs OpenWrt is connected to a 4G modem with limited data when it's on the road, but to the home wifi when it's at home or at the cabin. So I have created a jail list that is used to block everything except for the connection from the Car Pi (a separate Pi4 with media player software, a 2 TB SSD with around 180 000 tracks and a system that unlocks the car when my phone comes within a few meters and locks it when I leave) except for the addresses to Mercedes Me (which is used for the unlock/lock system) and time sync for the Pi.

In Home Assistant I have a sensor that pings the networks and knows if the car is within reach of a wifi. I have load balancing on the OpenWrt Pi so that when it can ping one of the networks the wifi will be prioritzed to such a degree that 4G isn't used.

The best case scenario would be if I could automate deactivating the jail list from Home Assistant/Node-RED when I'm at home and then activating it when I'm on the road. For now I am doing it manually by renaming adb_list.jail to adb_list.bak when I need to update something or have another reason to let the Pi reach Internet. Is there a sneaky way to do this with a script or something? And if not, could it be done from the GUI?

TTL = 65 for free data?

And the travelmate package for the rest?

Thanks, but is it possible to set it not to be connect to anything except for the whitelisted addresses on 4G with that? I thought that was based on data amount, not addresses. I have a very minimal data plan.

Sure, you can white list stuff.

But the TTL trick usually get you free surf/data, no matter which data plan you've got.

Many things can whitelist stuff, but I didn't think anything that a jail list could blacklist everything by default except for the few whitelisted. According to this thread the manual jail list is the way to do this:

As for the TTL trick does that work with a modem that works in LAN mode? I thought that had to be a pure modem firmware. I can't get that to work on my modem.

Found a way with a bit of searching, by creating rename commands in this plug-in: https://openwrt.org/packages/pkgdata/luci-app-commands

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