bundles/wireguard: send pings over vpn, if pppd reconnects
This commit is contained in:
parent
c1885e20b6
commit
014b37082c
2 changed files with 19 additions and 0 deletions
12
bundles/wireguard/files/pppd-ip-up
Normal file
12
bundles/wireguard/files/pppd-ip-up
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# We need to send some traffic over the wireguard tunnel to make sure
|
||||
# it gets connected. Easiest way is to simply send some pings to the
|
||||
# other side.
|
||||
|
||||
% for peer, config in node.metadata.get('wireguard', {}).get('peers', {}).items():
|
||||
% for ip in sorted(config['ips']):
|
||||
# refresh connection to ${peer} ${ip}
|
||||
/usr/bin/ping -c 4 ${ip.split('/')[0] if '/' in ip else ip}
|
||||
% endfor
|
||||
% endfor
|
Loading…
Add table
Add a link
Reference in a new issue