返回列表 發帖

routeros openvpn 問題

我setup 了openvpn
手機可以正常成功連接

用電腦可以連接到
但traffic 都不會經VPN gateway出去...手機就沒有這個問題

route print

client config
  1. client
  2. # this is a layer 3 (IP) VPN
  3. dev tun
  4. #dev tap

  5. # Mikrotik only supports TCP at the moment
  6. proto tcp

  7. # put your VPN Server's routable (WAN or Internet-accessible) IP address here
  8. remote XXXXXX.XXX.net 443

  9. resolv-retry infinite
  10. nobind

  11. # Mikrotik does not support link compression at the moment
  12. #comp-lzo

  13. persist-key
  14. persist-tun
  15. #mute-replay-warnings


  16. remote-cert-tls server


  17. #cipher BF-CBC
  18. #cipher AES-128-CBC
  19. #cipher AES-192-CBC
  20. cipher AES-256-CBC

  21. #auth MD5
  22. auth SHA1

  23. # Mikrotik's PPP server requires username/password authentication
  24. # at the moment and it uses this in conjunction with both client and
  25. # server-side x.509v3 certificate authentication
  26. auth-user-pass

  27. # domain name for home LAN
  28. #dhcp-option DOMAIN mydomain.tld

  29. # DNS server (replace with your own)
  30. #dhcp-option DNS 192.168.2.1


  31. # SMB WINS name server if you have one
  32. #dhcp-option WINS 10.0.0.1

  33. # route to multiple networks
  34. #push "route 10.0.0.0 255.0.0.0"
  35. #push "route 192.168.0.0 255.255.0.0"
  36. redirect-gateway def1


  37. #redirect-gateway def1
  38. #redirect-gateway def1
  39. #route 0.0.0.0 0.0.0.0 192.168.2.1
  40. #route 10.0.0.0 255.255.255.0


  41. # Mikrotik accepts a CA cert
  42. <ca>
  43. -----BEGIN CERTIFICATE-----
  44. XXXXXXXXXXXXXXXX
  45. -----END CERTIFICATE-----
  46. </ca>

  47. # Mikrotik expects a VPN Client Certificate
  48. <cert>
  49. -----BEGIN CERTIFICATE-----
  50. XXXXXXXXXXXXXXX
  51. -----END CERTIFICATE-----
  52. </cert>

  53. # OpenVPN Client needs the VPN Client Private Key to decrypt
  54. # info sent by the server during the SSL/TLS handshake
  55. <key>
  56. -----BEGIN RSA PRIVATE KEY-----
  57. XXXXXXXXXXXXXXXX
  58. -----END RSA PRIVATE KEY-----
  59. </key>

  60. # OpenVPN client debug log verbosity
  61. verb 6
複製代碼
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

有沒有高手有相同情況

TOP

本帖最後由 tomleehk 於 2018-6-24 16:46 編輯

我唔識RouterOS, 亦無玩OpenVPN多年
睇吓以下有無用

https://www1.thesolarsystems.net/?p=456
一般採用push redirect-gateway或push redirect-gateway local def1就可以指定把所有流量導入vpn接口,但有時候採用無線網路或其他網路會更改WAN時無效,所以可以加入route指令強迫將default gateway轉入。


文中192.168.89.1要根據你OpenVPN virtual LAN segment 修收

TOP

返回列表