Advertisement
Guest User

Конфиг openvpn клиента для DD-WRT

a guest
Nov 6th, 2017
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. CLIENT_CONFIG='##### Role #####
  4. tls-client
  5. pull
  6.  
  7. ##### System #####
  8. daemon
  9.  
  10. dev-type tun
  11. dev tun0
  12.  
  13. persist-key
  14. persist-tun
  15.  
  16. ##### Networking #####
  17. nobind
  18.  
  19. resolv-retry infinite
  20.  
  21. proto tcp-client
  22.  
  23. remote ТУТ_IP_СЕРВЕРА 1194
  24.  
  25. inactive 0
  26. ping 5
  27. ping-restart 30
  28.  
  29. comp-lzo adaptive
  30.  
  31. route 192.168.1.0 255.255.255.0 192.168.2.1
  32.  
  33. ##### Cryptography #####
  34. ca ca.crt
  35. cert client.crt
  36. key client.key
  37. tls-auth ta.key 1
  38.  
  39. auth SHA256
  40. cipher AES-256-CBC
  41. tls-cipher TLS-RSA-WITH-RC4-128-MD5
  42.  
  43. reneg-sec 3600
  44.  
  45.  
  46. ##### Logging #####
  47. log /var/log/openvpn.log
  48. verb 1
  49. status-version 3
  50. '
  51.  
  52. #### CERT ####
  53. CA_CRT='-----BEGIN CERTIFICATE-----
  54. MIIDRDCCAiygAwIBAgIJAJ2/SE4qkYvEMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV...
  55. -----END CERTIFICATE-----'
  56.  
  57. CLIENT_CRT='-----BEGIN CERTIFICATE-----
  58. MIIDUDCCAjigAwIBAgIQKou8oLGqUyUNPp4EYLjiXzANBgkqhkiG9w0BAQsFADAb...
  59. -----END CERTIFICATE-----'
  60.  
  61. CLIENT_KEY='-----BEGIN PRIVATE KEY-----
  62. MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDJGm/tCsvGtPae...
  63. -----END PRIVATE KEY-----'
  64.  
  65. TLS_KEY='-----BEGIN OpenVPN Static key V1-----
  66. e36abdfc3bc08aa42a626fa917f24c6b...
  67. -----END OpenVPN Static key V1-----'
  68.  
  69. if [ "$OPVPNENABLE" != 0 ]
  70. then
  71. nvram set openvpncl_enable=0
  72. nvram commit
  73. fi
  74.  
  75. sleep 5
  76.  
  77. mkdir /tmp/openvpn; cd /tmp/openvpn
  78.  
  79. echo "$CA_CRT" > ca.crt
  80. echo "$CLIENT_CRT" > client.crt
  81. echo "$CLIENT_KEY" > client.key
  82. echo "$TLS_KEY" > ta.key
  83. echo "$CLIENT_CONFIG" > openvpn.conf
  84.  
  85. chmod 644 ca.crt client.crt
  86. chmod 600 client.key
  87. chmod 644 ta.key
  88. chmod 644 openvpn.conf
  89.  
  90. sleep 5
  91.  
  92. killall openvpn
  93. openvpn --config /tmp/openvpn/openvpn.conf&
  94.  
  95. ifconfig | grep tun
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement