Board logo

標題: 【OpenWRT】—— OpenVPN Server and Client (准备篇) [打印本頁]

作者: 角色    時間: 2013-11-18 00:37     標題: 【OpenWRT】—— OpenVPN Server and Client (准备篇)

本帖最後由 角色 於 2013-11-25 01:35 編輯

还没有建立OpenVPN,先来做点资料搜集。

References:
http://wiki.openwrt.org/doc/howto/vpn.overview
http://wiki.openwrt.org/inbox/vpn.howto
http://www.imped.net/oss/misc/openvpn-2.0-howto-edit.html
http://wiki.wirelesstoronto.ca/openvpn_stuff
http://p3f.gmxhome.de/OpenWRT/Configure-OpenVPN.html

Very good example to illustrate the client device traffic was redirected to the Server's gateway to Internet.
http://farlee.info/archives/burs ... fig-vpn-centos.html
http://wuklass.pixnet.net/blog/post/35347947

References for OpenVPN Server

Using Certs and Keys
http://www.frogiswrong.com/blog/ ... -little-more-detail
http://www.joeho.org/wordpress/?p=3849
http://unix.stackexchange.com/questions/16412/openvpn-on-openwrt
http://ostanin.org/blog/2012/09/ ... sites-with-openwrt/
http://lgallardo.com/en/2011/09/08/configurar-openvpn-en-openwrt/
http://fooprotected.wordpress.co ... nd-openwrt-openvpn/

Using Static Key
http://wiki.openwrt.org/doc/howto/vpn.server.openvpn.tun
http://wiki.openwrt.org/doc/howto/vpn.server.openvpn.tap
https://blog.ipredator.se/howto/ ... vpn-on-openwrt.html
http://openvpn.net/index.php/ope ... key-mini-howto.html
http://martybugs.net/wireless/openwrt/openvpn.cgi
http://coderazzi.net/howto/openwrt/tl841n/openvpn-bridge.htm

References for OpenVPN Client
http://wiki.openwrt.org/doc/howto/vpn.client.openvpn.tun
作者: 角色    時間: 2013-11-18 20:15

本帖最後由 角色 於 2013-11-24 00:41 編輯

Based on [1], we installed
  1. opkg update
  2. opkg install openvpn openvpn-easy-rsa
複製代碼
【1】http://wiki.openwrt.org/inbox/vpn.howto
作者: 角色    時間: 2013-11-18 20:17

备用帖子。
作者: 角色    時間: 2013-12-7 18:38

本帖最後由 角色 於 2013-12-7 18:44 編輯

终于可以把OpenVPN安装在OpenWRT里了!

1. 安装openvpn package,不用安装它的GUI package

2. 做好OpenVPN选用的port number and type,我用standard,就1194 UDP port

3. 跟根据官网做certs,最重要的common name,这个是非常重要!详细看官网怎样generate certificates, keys, pems

4. On OpenWRT, using vi editor to create a file with a name "vpn.conf" which contains
  1. port    1194
  2. proto   udp
  3. dev-type     tun
  4. dev vpn-user

  5. ca      ca.crt
  6. cert    server.crt
  7. key     server.key
  8. dh      dh1024.pem

  9. # enable compression
  10. comp-lzo

  11. # allow several users to connect with the same certificate
  12. duplicate-cn

  13. server  10.30.0.0 255.255.255.0
  14. client-to-client

  15. keepalive 10 120

  16. push    "dhcp-option DOMAIN jl.selfip.org"
  17. push    "dhcp-option DNS 8.8.8.8"
  18. push    "redirect-gateway def1"

  19. persist-key
  20. persist-tun

  21. user nobody
  22. group nogroup

  23. #log vpn.log
  24. verb 3
複製代碼
4b. Using the following script to run openvpn with the server configuration file vpn.conf
  1. openvpn --config vpn.conf
複製代碼
5. 安装Windows on PC 的Openvpn,最好选用 2.2版本。
  1. remote jl.selfip.org
  2. port 1194
  3. proto udp
  4. dev tun

  5. comp-lzo

  6. client

  7. resolv-retry infinite
  8. nobind
  9. persist-key
  10. persist-tun
  11. ns-cert-type server

  12. verb 3

  13. ca      ca.crt
  14. cert    client1.crt
  15. key     client1.key


  16. ping 10
  17. ping-restart 60
複製代碼

作者: 角色    時間: 2013-12-7 18:48

上面是把OpenVPN最重要的step说出,等有时间,再把整个程序写出来,那么大家member可以跟着做。

系统连接好后,Client的PC的packets会通过HK Server的gateway走。
作者: pusey    時間: 2014-1-14 12:12

windows版本的2.3也是可以的,我一直在用,但如果要在windows下制作证书,那就还是2.2的比较好,反正我折腾2.3,搞了很久都没有成功,但换成2.2,一下就ok了,另外,最好是在XP或是win7下搞。
作者: 角色    時間: 2014-1-14 20:06

所以我也不用2.3,转回用2.2




歡迎光臨 電訊茶室 (http://www.telecom-cafe.com/forum/) Powered by Discuz! 7.2