Answer the question
In order to leave comments, you need to log in
How to make No route to host to subnet?
There are various pieces of hardware, one way or another on Linux (VPS, routers, PCs), there are tunnels between them (OpenVPN, IPSec, ..).
Let's say there is a tunnel between subnets 192.168.0.0/24 and 192.168.1.0/24, for example on OpenVPN. When it falls, the packets will go through the default route, i.e. to the provider's network, which is not very desirable. The solution in the forehead - to add a rule for dropping packets to a remote subnet when the tunnel is down and deleting it when it is up - I don’t really like it because it’s not clear - it’s really a loss for some reason, or the tunnel does not work at all.
How can I give No route to host, if there is a default route? The search gives a solution to the problem No route to host, but how to do this problem - nothing sensible ...
Answer the question
In order to leave comments, you need to log in
When it falls, the packets will go through the default route, i.e. to the provider's network, which is not very desirable
You can add a second static route to the desired network with a lower metric leading to the null0 interface. Then, if vpn fails, the first route will fly off, the second one will remain and generate no route to host. Linux example .
You can also try experimenting with adding the tunnel interface to the bridge and using the new brX interface for routing. Then, when the tunnel falls, the brX interface will remain, but the router will still generate no route to host
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question