本帖最後由 张无忌 於 2026-3-24 14:32 編輯

GL-MT3600BE

GL-MT3600BE WireGuard settings,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-3-24 14:31 編輯

hAP ac lite

hAP ac lite WireGuard 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