Enable default route after establishing connection only

smith151 at ngs.ru smith151 at ngs.ru
Tue Jan 28 09:50:23 CET 2020


I am using default route on wireguard. And sometimes 
remote server is not acceptable. The reasons may differ - 
planned maintenance of server, internet troubles, blocked 
IPs of server by country black list an so on.

In case when wireguard server is not reachable wireguard 
client always setting default route via wg0 peer. And all 
internet traffic is not available in this case. How can I 
set up wireguard to enable default route after 
establishing connection only?

I am using wireguard v.20200121 on Debian 10 buster. The 
config file of client is very simple:

```
[Interface]
Address = 1.2.3.2
PrivateKey = ClientPrivateKey=

[Peer]
PublicKey = ServerPublicKey=
Endpoint = 1.2.3.1:51820
PersistentKeepalive = 25
AllowedIPs = 0.0.0.0/0,::/0
```


More information about the WireGuard mailing list