Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

disable public internet access linux

GW="$(sudo /sbin/route -n | awk '$1=="0.0.0.0" {print $2; exit}')"
sudo /sbin/route del default gw "$GW"
echo "$GW" >~/my_tmp_file

The last line saves the value in a file for later use when you want to restart the network:
sudo /sbin/route add default gw "$(cat ~/my_tmp_file)"
Source by superuser.com #
 
PREVIOUS NEXT
Tagged: #disable #public #internet #access #linux
ADD COMMENT
Topic
Name
3+2 =