本帖最後由 张无忌 於 2026-8-29 07:33 編輯

MikroTik RB951G-2HnD
Server: GL-MT3600BE
Client: Windows client or MikroTik RB951G-2HnD

Configuration 注意 network only. Wi-Fi 要靠自己 default settings。

Windows WireGuard client settings for GL-MT3600BE,Line 03=10.1.0.2/24
  1. [Interface]
  2. PrivateKey = 8N8uKPLa0H+pyL8lHxMoySqSq60wieDpCvhiKOlQhG0=
  3. Address = 10.1.0.2/24, fd00:9262:bc00:b88c::2/64
  4. DNS = 10.1.0.1, fd00:9262:bc00:b88c::1, 64.6.64.6
  5. MTU = 1420

  6. [Peer]
  7. PublicKey = rHT/pRV/ovJr7tVgRQQ2vaQA3WkcLo4C1gnV1Xd9YhM=
  8. PresharedKey = qAnHo8uMf5CrgqFP0XzyFHsG1EZW8+BWG8I3GW/rPUQ=
  9. AllowedIPs = 0.0.0.0/0, ::/0
  10. Endpoint = xyz.abc.com:51820
  11. PersistentKeepalive = 25
複製代碼
..

MikroTik RB951G-2HnD,Line 12=10.1.0.2/24
  1. #################################################
  2. # Step one
  3. #################################################
  4. /interface wireguard
  5. add listen-port=13231 mtu=1420 name=wg-hk private-key=\
  6. "8N8uKPLa0H+pyL8lHxMoySqSq60wieDpCvhiKOlQhG0=" \
  7. comment="WG HK"

  8. #######################
  9. # Assign address to the router on the new interface.
  10. /ip address
  11. add address=10.1.0.2/24 comment="Wireguard" interface=wg-hk \
  12.     network=10.1.0.0

  13. #/ip firewall filter
  14. #add action=accept chain=input comment="Wireguard" dst-port=13231 \
  15. #   protocol=udp

  16. # Set up HK peer
  17. /interface wireguard peers      
  18. add name=hk allowed-address=0.0.0.0/0 comment="hk" \
  19.     endpoint-address=abc.xyz.com endpoint-port=51820 \
  20.     interface=wg-hk public-key=\
  21.     "rHT/pRV/ovJr7tVgRQQ2vaQA3WkcLo4C1gnV1Xd9YhM=" \
  22.     preshared-key="qAnHo8uMf5CrgqFP0XzyFHsG1EZW8+BWG8I3GW/rPUQ=" \
  23.     persistent-keepalive=25

  24. #################################################
  25. # Step Two
  26. #################################################
  27. # On China MikroTik
  28. /routing table
  29. add comment="For use by local clients" disabled=no fib name=wg-vpn

  30. /routing rule
  31. add action=lookup-only-in-table \
  32.     comment="Local clients should use (only) Wireguard routing table" \
  33.     disabled=no interface=bridge src-address=192.168.88.0/24 table=wg-vpn

  34. /ip route
  35. add dst-address=0.0.0.0/0 gateway=wg-hk routing-table=wg-vpn

  36. /ip firewall nat \
  37. add chain=srcnat out-interface=wg-hk action=masquerade

  38. ### Open MSDOS  window input "curl http://myip.dnsomatic.com" to display HK IP address ###

  39. #################################################
  40. # Step Three
  41. #################################################
  42. /ip dns
  43. set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8

  44. /ip dhcp-server network
  45. set 0 dns-server=1.1.1.1,8.8.8.8

  46. #must reboot once
  47. # /system reboot

  48. #################################################
  49. # Step Four
  50. #################################################
  51. /ip firewall mangle
  52.   add action=change-mss chain=forward new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn
  53.   add action=change-mss chain=output new-mss=clamp-to-pmtu passthrough=no protocol=tcp tcp-flags=syn

  54. /system reboot
複製代碼
..


References:
[1] Mainland China VPN Hong Kong via MikroTik and WireGuard
[2] https://dimitrije.website/posts/ ... -and-wireguard.html

TOP

本帖最後由 张无忌 於 2026-8-29 07:32 編輯

MikroTik hAP ac lite
Server: GL-MT3600BE
Client: Windows client or MikroTik hAP ac lite

Configuration 主要 network only. Wi-Fi 要靠自己 default settings。

Windows WireGuard client settings,Line 03=10.3.0.5/32
  1. [Interface]
  2. PrivateKey = uLxOU/qK69xmEiryFoqZ2Z9IaeoDb6E2p9fn4R7CcUU=
  3. Address = 10.3.0.5/32
  4. DNS = 1.1.1.1, 8.8.8.8

  5. [Peer]
  6. PublicKey = 1WhizDkvtctaL6Ob/HNOPxvgwgHELlBRlQL/rEwTMGs=
  7. PresharedKey = qAnHo8uMf5CrgqFP0XzyFHsG1EZW8+BWG8I3GW/rPUQ=
  8. AllowedIPs = 0.0.0.0/0
  9. Endpoint = xyz.abc.com:19991
  10. PersistentKeepalive = 25
複製代碼
..

MikroTik RB951G-2HnD,Line 12=10.3.0.5/32
  1. #################################################
  2. # Step one
  3. #################################################
  4. /interface wireguard
  5. add listen-port=13231 mtu=1420 name=wg-hk private-key=\
  6. "uLxOU/qK69xmEiryFoqZ2Z9IaeoDb6E2p9fn4R7CcUU=" \
  7. comment="WG HK"

  8. #######################
  9. # Assign address to the router on the new interface.
  10. /ip address
  11. add address=10.3.0.5/32 comment="Wireguard" interface=wg-hk \
  12.     network=10.3.0.0

  13. #/ip firewall filter
  14. #add action=accept chain=input comment="Wireguard" dst-port=13231 \
  15. #   protocol=udp

  16. # Set up HK peer
  17. /interface wireguard peers      
  18. add name=hk allowed-address=0.0.0.0/0 comment="hk" \
  19.     endpoint-address=abc.xyz.com endpoint-port=19991 \
  20.     interface=wg-hk public-key=\
  21.     "1WhizDkvtctaL6Ob/HNOPxvgwgHELlBRlQL/rEwTMGs=" \
  22.     preshared-key="qAnHo8uMf5CrgqFP0XzyFHsG1EZW8+BWG8I3GW/rPUQ=" \
  23.     persistent-keepalive=25

  24. #################################################
  25. # Step Two
  26. #################################################
  27. # On China MikroTik
  28. /routing table
  29. add comment="For use by local clients" disabled=no fib name=wg-vpn

  30. /routing rule
  31. add action=lookup-only-in-table \
  32.     comment="Local clients should use (only) Wireguard routing table" \
  33.     disabled=no interface=bridge src-address=192.168.88.0/24 table=wg-vpn

  34. /ip route
  35. add dst-address=0.0.0.0/0 gateway=wg-hk routing-table=wg-vpn

  36. /ip firewall nat \
  37. add chain=srcnat out-interface=wg-hk action=masquerade

  38. ### Open MSDOS  window input "curl http://myip.dnsomatic.com" to display HK IP address ###

  39. #################################################
  40. # Step Three
  41. #################################################
  42. /ip dns
  43. set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8

  44. /ip dhcp-server network
  45. set 0 dns-server=1.1.1.1,8.8.8.8

  46. #must reboot once
  47. # /system reboot

  48. #################################################
  49. # Step Four
  50. #################################################
  51. /ip firewall mangle
  52.   add action=change-mss chain=forward new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn
  53.   add action=change-mss chain=output new-mss=clamp-to-pmtu passthrough=no protocol=tcp tcp-flags=syn

  54. /system reboot
複製代碼
..


References:
[1] Mainland China VPN Hong Kong via MikroTik and WireGuard
[2] https://dimitrije.website/posts/ ... -and-wireguard.html

TOP

在大陆我用 hAP ax lite 连香港的 hAP ac3 Wireguard server 连接,然后把 hAP ax lite config 变成香港的 LAN and Wi-Fi,那么在大陆就有一个香港网络。

但是以前因为我从华东连香港不知道怎么回事,导致到网络不通,所以没有用到,现在已经好了,现在(@2026-08-19)已经正常,可以测试香港往大陆测试。

我现在在大陆用 Wi-Fi SSID 去控制 HK-2G and CN-2G;用香港网络选 HK-2G,用大陆网络就用 CN-2G,非常方便。

TOP