1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-12-25 14:29:24 +08:00

vpn: Updated WireGuard & Tinc configuration

This commit is contained in:
Neo_Chen 2020-05-11 20:10:33 +08:00
parent 41d43ad1e2
commit 1be0a431e4
3 changed files with 19 additions and 6 deletions

View file

@ -1,13 +1,14 @@
#!/bin/sh #!/bin/sh
IP="10.127.x.x" IP=""
PEER=""
case `uname` in case "`uname`" in
Linux) Linux)
ip link set $INTERFACE up ip link set "$INTERFACE" up
ip addr add "$IP" dev $INTERFACE ip addr add "$IP" peer "$PEER" dev "$INTERFACE"
;; ;;
*BSD) *BSD)
ifconfig $INTERFACE "$IP" ifconfig "$INTERFACE" "$IP" "$PEER"
;; ;;
esac esac

12
vpn/wg-postup.sh Normal file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
IF="$1"
LOCAL_IP="$2"
PEER_IP="$3"
LOCAL_IPV6="$4"
PEER_IPV6="$5"
ip addr del "$LOCAL_IP" dev "$IF"
ip addr add "$LOCAL_IP" peer "$PEER_IP" dev "$IF"
ip addr del "$LOCAL_IPV6"
ip addr add "$LOCAL_IPV6" peer "$PEER_IPV6" dev "$IF"

View file

@ -1,6 +1,6 @@
[Interface] [Interface]
Address = 10.127.x.x/32, fd80::/32 Address = 10.127.x.x/32, fd80::/32
PostUp = /path/to/wg-postup.sh 10.127.x.x/32 <Peer IPv6> <IPv6 src> fd80::/32 <Peer IPv6> PostUp = /path/to/wg-postup.sh <Interface Name> 10.127.x.x/32 <Peer> fd80::/32 <Peer IPv6>
# Custom DNS # Custom DNS
#DNS = 127.0.0.1 #DNS = 127.0.0.1
# Set MTU to 1412 if using PPP # Set MTU to 1412 if using PPP