AlastorCrimson

openvpn

Apr 18th, 2021
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.66 KB | None | 0 0
  1. openvpn.MyVPNProvider=openvpn
  2. openvpn.MyVPNProvider.config='/etc/openvpn/MyVPNProvider.ovpn'
  3. openvpn.MyVPNProvider.enabled='1'
  4. openvpn.MyVPNProvider2=openvpn
  5. openvpn.MyVPNProvider2.config='/etc/openvpn/MyVPNProvider2.ovpn'
  6. drwxr-xr-x 2 root root 4096 Apr 12 15:45 .
  7. drwxr-xr-x 22 root root 4096 Apr 9 05:08 ..
  8. -rw-r--r-- 1 root root 50 Apr 13 22:49 MyVPNProvider.auth
  9. -rw-r--r-- 1 root root 6151 Apr 13 22:49 MyVPNProvider.ovpn
  10. -rw-r--r-- 1 root root 50 Apr 13 22:50 MyVPNProvider2.auth
  11. -rw-r--r-- 1 root root 6153 Apr 13 22:50 MyVPNProvider2.ovpn
  12. -rw------- 1 root root 248 Apr 10 23:03 client.conf
  13. -rwxr-xr-x 1 root root 363 Apr 10 23:02 client.sh
  14. -rwxr-xr-x 1 root root 200 Apr 11 00:51 killswitch.sh
  15. ==> /etc/openvpn/MyVPNProvider.auth <==
  16. egjqu1vwdl3qs4v8xwlzd8fn
  17. 3jntue5i54x7cyketaryouc5
  18.  
  19. ==> /etc/openvpn/MyVPNProvider.ovpn <==
  20.  
  21. dev tun0
  22. fast-io
  23. persist-key
  24. persist-tun
  25. nobind
  26. remote country-ca-version-2.vpnprovider.com 1195
  27.  
  28. remote-random
  29. pull
  30. comp-lzo no
  31. tls-client
  32. verify-x509-name Server name-prefix
  33. ns-cert-type server
  34. key-direction 1
  35. route-method exe
  36. route-delay 2
  37. tun-mtu 1500
  38. fragment 1300
  39. mssfix 1200
  40. verb 3
  41. cipher AES-256-CBC
  42. keysize 256
  43. auth SHA512
  44. sndbuf 524288
  45. rcvbuf 524288
  46. auth-user-pass MyVPNProvider.auth
  47. pull-filter ignore "redirect-gateway"
  48.  
  49. <cert>
  50. -----BEGIN CERTIFICATE-----
  51. xxx
  52. -----END CERTIFICATE-----
  53. </cert>
  54. <key>
  55. -----BEGIN RSA PRIVATE KEY-----
  56. xxx
  57. -----END RSA PRIVATE KEY-----
  58. </key>
  59. <tls-auth>
  60. #
  61. # 2048 bit OpenVPN static key
  62. #
  63. -----BEGIN OpenVPN Static key V1-----
  64. xxx
  65. -----END OpenVPN Static key V1-----
  66. </tls-auth>
  67. <ca>
  68. -----BEGIN CERTIFICATE-----
  69. xxx
  70. -----END CERTIFICATE-----
  71. </ca>
  72.  
  73. ==> /etc/openvpn/MyVPNProvider2.auth <==
  74. xxxx
  75. xxxx
  76.  
  77. ==> /etc/openvpn/MyVPNProvider2.ovpn <==
  78.  
  79. dev tun0
  80. fast-io
  81. persist-key
  82. persist-tun
  83. nobind
  84. remote country-2-ca-version-2.vpnprovider.com 1195
  85.  
  86. remote-random
  87. pull
  88. comp-lzo no
  89. tls-client
  90. verify-x509-name Server name-prefix
  91. ns-cert-type server
  92. key-direction 1
  93. route-method exe
  94. route-delay 2
  95. tun-mtu 1500
  96. fragment 1300
  97. mssfix 1200
  98. verb 3
  99. cipher AES-256-CBC
  100. keysize 256
  101. auth SHA512
  102. sndbuf 524288
  103. rcvbuf 524288
  104. auth-user-pass MyVPNProvider.auth
  105. pull-filter ignore "redirect-gateway"
  106.  
  107. <cert>
  108. -----BEGIN CERTIFICATE-----
  109. xxxx
  110. -----END CERTIFICATE-----
  111. </cert>
  112. <key>
  113. -----BEGIN RSA PRIVATE KEY-----
  114. xxxx
  115. -----END RSA PRIVATE KEY-----
  116. </key>
  117. <tls-auth>
  118. #
  119. # 2048 bit OpenVPN static key
  120. #
  121. -----BEGIN OpenVPN Static key V1-----
  122. xxxx
  123. -----END OpenVPN Static key V1-----
  124. </tls-auth>
  125. <ca>
  126. -----BEGIN CERTIFICATE-----
  127. xxxx
  128. -----END CERTIFICATE-----
  129. </ca>
  130.  
  131. ==> /etc/openvpn/client.conf <==
  132. user nobody
  133. group nogroup
  134. #script-security 2
  135. #up /etc/openvpn/client.sh
  136. #down /etc/openvpn/client.sh
  137. #script-security 2
  138. #up /etc/openvpn/client.sh
  139. #down /etc/openvpn/client.sh
  140. script-security 2
  141. up /etc/openvpn/client.sh
  142. down /etc/openvpn/client.sh
  143.  
  144. ==> /etc/openvpn/client.sh <==
  145. #!/bin/sh
  146. env | sed -n -e "
  147. /^foreign_option_.*=dhcp-option.*DNS/s//nameserver/p
  148. /^foreign_option_.*=dhcp-option.*DOMAIN/s//search/p
  149. " | sort -u > /tmp/resolv.conf.vpn
  150. case ${script_type} in
  151. (up) uci set dhcp.@dnsmasq[0].resolvfile="/tmp/resolv.conf.vpn" ;;
  152. (down) uci set dhcp.@dnsmasq[0].resolvfile="/tmp/resolv.conf.auto" ;;
  153. esac
  154. /etc/init.d/dnsmasq restart &
  155.  
  156. ==> /etc/openvpn/killswitch.sh <==
  157. #!/bin/sh
  158. if pgrep openvpn
  159. then
  160. uci set firewall.lan_wan.enabled="1"
  161. /etc/init.d/openvpn stop &
  162. else
  163. uci set firewall.lan_wan.enabled="0"
  164. /etc/init.d/openvpn start &
  165. fi
  166. /etc/init.d/firewall restart &
Add Comment
Please, Sign In to add comment