本帖最後由 张无忌 於 2026-3-24 14:32 編輯
GL-MT3600BE
GL-MT3600BE WireGuard settings,Line 03=10.1.0.2/24- [Interface]
- PrivateKey = 8N8uKPLa0H+pyL8lHxMoySqSq60wieDpCvhiKOlQhG0=
- Address = 10.1.0.2/24, fd00:9262:bc00:b88c::2/64
- DNS = 10.1.0.1, fd00:9262:bc00:b88c::1, 64.6.64.6
- MTU = 1420
- [Peer]
- PublicKey = rHT/pRV/ovJr7tVgRQQ2vaQA3WkcLo4C1gnV1Xd9YhM=
- PresharedKey = qAnHo8uMf5CrgqFP0XzyFHsG1EZW8+BWG8I3GW/rPUQ=
- AllowedIPs = 0.0.0.0/0, ::/0
- Endpoint = xyz.abc.com:51820
- PersistentKeepalive = 25
複製代碼 ..
MikroTik RB951G-2HnD,Line 12=10.1.0.2/24- #################################################
- # Step one
- #################################################
- /interface wireguard
- add listen-port=13231 mtu=1420 name=wg-hk private-key=\
- "8N8uKPLa0H+pyL8lHxMoySqSq60wieDpCvhiKOlQhG0=" \
- comment="WG HK"
- #######################
- # Assign address to the router on the new interface.
- /ip address
- add address=10.1.0.2/24 comment="Wireguard" interface=wg-hk \
- network=10.1.0.0
- #/ip firewall filter
- #add action=accept chain=input comment="Wireguard" dst-port=13231 \
- # protocol=udp
- # Set up HK peer
- /interface wireguard peers
- add name=hk allowed-address=0.0.0.0/0 comment="hk" \
- endpoint-address=abc.xyz.com endpoint-port=51820 \
- interface=wg-hk public-key=\
- "rHT/pRV/ovJr7tVgRQQ2vaQA3WkcLo4C1gnV1Xd9YhM=" \
- preshared-key="qAnHo8uMf5CrgqFP0XzyFHsG1EZW8+BWG8I3GW/rPUQ=" \
- persistent-keepalive=25
- #################################################
- # Step Two
- #################################################
- # On China MikroTik
- /routing table
- add comment="For use by local clients" disabled=no fib name=wg-vpn
- /routing rule
- add action=lookup-only-in-table \
- comment="Local clients should use (only) Wireguard routing table" \
- disabled=no interface=bridge src-address=192.168.88.0/24 table=wg-vpn
- /ip route
- add dst-address=0.0.0.0/0 gateway=wg-hk routing-table=wg-vpn
- /ip firewall nat \
- add chain=srcnat out-interface=wg-hk action=masquerade
- ### Open MSDOS window input "curl http://myip.dnsomatic.com" to display HK IP address ###
- #################################################
- # Step Three
- #################################################
- /ip dns
- set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8
- /ip dhcp-server network
- set 0 dns-server=1.1.1.1,8.8.8.8
- #must reboot once
- # /system reboot
- #################################################
- # Step Four
- #################################################
- /ip firewall mangle
- add action=change-mss chain=forward new-mss=clamp-to-pmtu passthrough=yes protocol=tcp tcp-flags=syn
- add action=change-mss chain=output new-mss=clamp-to-pmtu passthrough=no protocol=tcp tcp-flags=syn
- /system reboot
複製代碼 ..
References:
[1] Mainland China VPN Hong Kong via MikroTik and WireGuard
[2] https://dimitrije.website/posts/ ... -and-wireguard.html |