[已解決]求救,Mikrotik 連不上OpenVPN

我的是 mikrotik map2n

要去中國

所以一定要設定好VPN client可以連回台灣

參考了很多網路上的教學

但一直弄不好

看Log也沒寫什麼東西

我的OpenVPN server是用CentOS 6.5架設的

依照

http://blog.sumostyle.net/2010/02/ovpn-server/
https://geekpeek.net/openvpn-server-on-centos/

這兩篇架設的

有開啟使用者驗證

然後Mikrotik的 VPN Client 我是參考

http://wiki.mikrotik.com/wiki/OpenVPN#RouterOS_3
https://support.hidemyass.com/hc/en-us/articles/204558497-Mikrotik-Client-Setup

這兩篇做設定

但連在Interface介面看,都是連不上的狀態

[已解決]求救,Mikrotik 連不上OpenVPN

但我確定可以用Mac連上VPN

不知道哪邊出錯了嗎?
2015-09-24 19:01 發佈
文章關鍵字 OpenVPN Mikrotik
你能貼一下你的OVPN Server跟Client的設定指令嗎?

要包含OVPN的設定跟Server/Client端使用的Profile

可以拍圖 也可以在Terminal用指令印出來

/interface ovpn-server server print
/interface ovpn-client print
/ppp profile print
我的server是用CentOS 6.5架設的

設定如下:

port 443
proto tcp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key # This file should be kept secret
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0 # This file is secret
user nobody
group nobody
persist-key
persist-tun
status /var/log/openvpn-status.log
log openvpn.log
log-append openvpn.log
verb 3
plugin /usr/lib64/openvpn/plugins/openvpn-plugin-auth-pam.so login
client-cert-not-required
username-as-common-name


我的Mikrotik 是 OpenVPN Client

設定如下:

[admin@MikroTik] > /interface ovpn-client print
Flags: X - disabled, R - running
0 name="ovpn-iphpo" mac-address=02:F0:EA:33:6F:C9 max-mtu=1500 connect-to=xxx.xxx.xxx.xxx port=443
mode=ip user="vpnuser" password="xxxxxx" profile=default certificate=cert_2 auth=sha1
cipher=aes256 add-default-route=no

ip與password有隱藏,其餘不變

ppp profile print 結果如下


[admin@MikroTik] > ppp profile print
Flags: * - default
0 * name="default" use-mpls=default use-compression=default use-vj-compression=default
use-encryption=default only-one=default change-tcp-mss=yes address-list=""

1 * name="default-encryption" use-mpls=default use-compression=default use-vj-compression=default
use-encryption=yes only-one=default change-tcp-mss=yes address-list=""


ps. CentOS架設的OpenVPN server確定可以在Mac上用tunnelblick正常連線
剛剛看我server上的log

每次連線都出現以下的error message...

Thu Sep 24 16:28:07 2015 TCP connection established with [AF_INET]220.134.43.89:48476
Thu Sep 24 16:28:07 2015 220.134.43.89:48476 TLS: Initial packet from [AF_INET]220.134.43.89:48476, sid=b5c43613 4a723acc
Thu Sep 24 16:28:07 2015 220.134.43.89:48476 TLS Error: cannot locate HMAC in incoming packet from [AF_INET]220.134.43.89:48476
Thu Sep 24 16:28:07 2015 220.134.43.89:48476 Fatal TLS error (check_tls_errors_co), restarting
Thu Sep 24 16:28:07 2015 220.134.43.89:48476 SIGUSR1[soft,tls-error] received, client-instance restarting

剛Google

是因為我啟用了 tls-auth

If a tls-auth key is used on the server then every client must also have the key.

所以我client也要用這個key

所以我是要在Mikrotic的哪邊新增這個key呢
後來查到

原來 RouterOS 不支援 TLS-auth!!!!

http://wiki.mikrotik.com/wiki/Manual:Interface/OVPN

Currently unsupported OVPN feature:

UDP mode
LZO compression
TLS authentication
authentication without username/password

前兩個都可以增加速度的功能卻不支援

好慘...

後來改掉我Server設定就成功連線了~~

herb123456 wrote:
後來查到原來 RouterOS...(恕刪)

嗯 忘了說RouterOS目前還沒有辦法支援UDP跟LZO

另外 LZO在瀏覽網頁時很OK 但如果是要下載或是看影片之類的 建議是關掉
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?