How can I limit OSMC to LAN communications only?

This is not on a full router so I can’t do any blocking router based blocking so it would have to be OSMC itself.

I want to have my system setup so when I’m at work in the lunch room during break I can hookup my Pi to the TV and then control it and stream files to with Yatse on my phone with the Pi tethered to my phone. Which works great as it is using a old phone with no current service. But I want to not carry around the extra phone and just use my main one. I would also like to ensure that none of my phone data is used without just turning it off for everything.

How can I do this because at home in testing using iftop I have noticed contant connections to WAN addresses that would use my mobile data.

I’m asking here instead of a general Linux forum because I notice the networking setup is different then most because iptables is not installed so I want something clean for the OSMC distro.

Disable Mobile data on the phone.

You can install iptables with ease:

apt-get install iptables

but you could probably null route rest of world or remove the route.


I tried removing the gateway and it will not actually go away.

I tested the following command on my laptop and xbmcbuntu and OSMC on my home network for testing and it worked great on the laptop and xbmcbuntu I lost WAN access but not LAN.

On OSMC though the command ran without a error but when I check a second later by just running “sudo route” it has not been deleted

sudo route del default gw

Also for when that is figured out how with OSMC’s connman setup would I be able to have a post-up script the equivalent of putting a shell script in /etc/NetworkManager/dispatcher.d/ on a Ubuntu system. So it get ran after the network comes up.