返回列表 發帖

【OpenWRT】—— OpenVPN Server for Tun device

本帖最後由 角色 於 2013-11-24 14:13 編輯

Source : http://wiki.openwrt.org/doc/howto/vpn.server.openvpn.tun

1. Installation of OpenVPN package
  1. opkg update
  2. opkg install openvpn
複製代碼
2. Network configuration

Add a VPN interface to the end of /etc/config/network
  1. config interface 'vpn'
  2.         option proto 'none'
  3.         option ifname 'tun0'
複製代碼
3. Firewall configuration

Add rules to the end of /etc/config/network
  1. config 'rule'
  2.         option 'target' 'ACCEPT'
  3.         option 'dest_port' '1194'
  4.         option 'src' 'wan'
  5.         option 'proto' 'udp'
  6.         option 'family' 'ipv4'

  7. config zone
  8.         option name 'vpn'
  9.         option input 'ACCEPT'
  10.         option forward 'REJECT'
  11.         option output 'ACCEPT'
  12.         option network 'vpn'

  13. config forwarding
  14.         option dest 'lan'
  15.         option src 'vpn'

  16. config forwarding
  17.         option dest 'vpn'
  18.         option src 'lan'
複製代碼
4. Restarting networking and firewall
  1. /etc/init.d/network restart
  2. /etc/init.d/firewall restart
複製代碼

不会把,第一个的option是经常用都会出问题! 真的没有想过。CHing厉害。

TOP

可能是新版 openvpn 的 bug, disable 了 comp-lzo 及 tls-auth 就可以了。

TOP

我都很久没有用OpenWRT,所以都没有办法怎样测试。(现在主要用RouterOS)

TOP

請問在 Barrier Breaker 上設定 Openvpn 是否一樣?
我跟足上面的方法,用'ps' 看,Openvpn 的確在運行,但連線的時候就是無法 negotiate!曾經試過把所有的 firewall 也打開,結果都是一樣。
下面是 client log,是經 lan 連接的,停在最後一行便不再動。

Tue Nov 25 10:45:32 2014 OpenVPN 2.2.2 Win32-MSVC++ [SSL] [LZO2] [PKCS11] built on Dec 15 2011
Tue Nov 25 10:45:32 2014 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Tue Nov 25 10:45:33 2014 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Tue Nov 25 10:45:33 2014 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Nov 25 10:45:33 2014 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Nov 25 10:45:33 2014 LZO compression initialized
Tue Nov 25 10:45:33 2014 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Tue Nov 25 10:45:33 2014 Socket Buffers: R=[8192->8192] S=[8192->8192]
Tue Nov 25 10:45:33 2014 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Tue Nov 25 10:45:33 2014 Local Options hash (VER=V4): '02af3434'
Tue Nov 25 10:45:33 2014 Expected Remote Options hash (VER=V4): '3f08d474'
Tue Nov 25 10:45:33 2014 UDPv4 link local: [undef]
Tue Nov 25 10:45:33 2014 UDPv4 link remote: XXX.XXX.XX.XXX:1194

TOP

返回列表