~abcdw/trop.in

3cd3b3ef494ed518748d3606fd6e050ec77657df — Andrew Tropin 11 months ago d6c407b
Add wg.sh script
1 files changed, 20 insertions(+), 0 deletions(-)

A files/wg/wg.sh
A files/wg/wg.sh => files/wg/wg.sh +20 -0
@@ 0,0 1,20 @@
set -x
# sudo guix shell wireguard-tools -- ./wg.sh

ip link add dev wg0 type wireguard
ip address add dev wg0 10.0.0.2/24
ip -6 address add dev wg0 fdf5:6028:947d:1234::2/128
ip address add dev wg0 10.0.0.2 peer 10.0.0.1
wg set wg0 private-key ./ixy.key
wg set wg0 peer 1OAHy0HLy2WXexCelrLkBz5WU2i0CZ8Y+O3uQVmlaVg= \
allowed-ips 0.0.0.0/0,::/0 endpoint 23.137.249.202:51828

ip route add 23.137.249.202 via 192.168.0.1

ip link set wg0 up

ip route del default
ip route add default dev wg0
ip -6 route del default
ip -6 route add default dev wg0
ip -6 route del default via fe80::eead:e0ff:fe42:bb23