Ubuntu – Allow only network connections but not connect to internet

network-managernetworkingtraceroute

I can do this by going to the network manager

edit connections > myconn > ipv4 > routes

and check
"use this connection only for resources on its network"

all this without inputing my sudoer password, how can I do the same in command line mode? without sudo if possible! thank you.

Best Answer

You can use the ip command for setting up routes. You basically need to remove your default route. At make sure you have a route entry into your local network.