A
A
Asparagales2019-04-03 14:20:39
linux
Asparagales, 2019-04-03 14:20:39

How to automatically block the Internet when the VPN connection is broken in Linux?

Usually there are such tips: Connect VPN, then run the command in the console route del default
. If the VPN connection breaks, the entire network will turn off automatically. To turn on the Internet again, you need to execute the command route add default gw 192.168.1.1 eth0
. Except the route command is part of the outdated net-tools network utilities package and in modern distributions it has been replaced by the iproute2 package. What commands should be given in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
latush, 2019-04-03
@Asparagales

ip route del default
ip route add default via 192.168.1.1 dev eth0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question