Advertisement
Guest User

Untitled

a guest
May 11th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. #set -x
  4.  
  5. export PATH=/usr/local/bin:$PATH
  6.  
  7. IF=azirevpn-uk1
  8. NS=vpn
  9.  
  10. ip link add $IF type wireguard
  11. ip netns add $NS
  12. ip link set $IF netns $NS
  13.  
  14. ip netns exec $NS bash <<EOS
  15. #set -x
  16. #strace -f -o /var/log/wg-setconf.strace wg setconf $IF /etc/wireguard/netns/mini.conf
  17. wg setconf $IF /etc/wireguard/netns/mini.conf
  18. ip address add 10.10.X.Y/19 dev $IF
  19. ip link set mtu 1420 dev $IF
  20. ip link set $IF up
  21. route add default dev $IF
  22. ifconfig lo 127.0.0.1
  23. EOS
  24.  
  25. #echo "Opening shell, exit to finish, then run teardown:"
  26. #ip netns exec $NS bash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement