作者: 张无忌 時間: 2025-1-14 21:25 標題: 香港MikroTik加WireGuard接大陆IP建立CN-Gateway
本帖最後由 张无忌 於 2025-1-21 18:32 編輯
香港人家里用电脑,iPad,Android,iPhone等等用普通router就可以,不需要安装买回就可以直接用。如果有些功能需要用大陆IP,才能正常使用。
需要大陆IP有如下:
1、 大陆打影器
2、 大陆扫垃圾的机器人
3、 大陆的插头
4、 大陆的CCTV5,CCTV5+,CCTV16
5、 大陆电影,爱奇艺
6、 大陆淘宝有得时候需要你又大陆IP才能正常下单
现在可以用MikroTik的router,安装(改firmware)后LAN ports + Wi-Fi port都是大陆的IP,而设备不要安装VPN,接入大陆的IP,即是CN-Gateway,就虚拟地在大陆生活一样!!
作者: 张无忌 時間: 2025-1-14 21:26
本帖最後由 张无忌 於 2025-1-17 19:26 編輯
在香港要上大陆网,有好有大陆公网IP,有朋友公网IP和router有WireGuard,就可以Table 1上网到深圳。如果私网就不行,如果没有你要向阿里云等要买的VPS,然后安装RouterOS,就可以有WireGuard的server,就有下面的参数,你在可以用PC Windows 10,通过WireGuard连深圳上大陆网。
Line 13: abc.xyz.org must be set to real hostname FQDN.
Table 1: PC Windows 10 WireGuard configuration
- ########################################
- #PC HK-->CN WireGuard Configuration
- ########################################
- [Interface]
- PrivateKey = yJQDHxkppPLTPx+2A54y4AWpcVpO0QLxIYoEsvRq6V0=
- Address = 10.2.88.3/32
- DNS = 223.5.5.5,119.29.29.29
- [Peer]
- PublicKey = vtWvAu10T0fVSfJ+X94gmnUPbUP6XTVXEBWtQF5YyHg=
- PresharedKey = QD4Z19XNa4bZ67789jeG3FWjOZuEk76sEwmLNzi7c38=
- AllowedIPs = 0.0.0.0/0
- Endpoint = abc.xyz.org:27051
- PersistentKeepalive = 25
作者: 张无忌 時間: 2025-1-14 21:26
本帖最後由 张无忌 於 2025-1-17 19:39 編輯
下面Table 2只要更改MikroTik router的参数:
1. "admin"的password=Admin-Password
2. 2G SSID=CN-2G, 5G SSID=CN-5G
3. Country="hong kong"
4. WiFi "SSID"=WiFi-Password
你又可以自己亲自手改,不需要理会Table 2。
Table 2: MikroTik initial configuration
- #/system reset-configuration
- #/system reboot
- /password old-password="" new-password=Admin-Password confirm-new-password=Admin-Password
- /interface wireless security-profiles
- set number=0 name=default authentication-types=wpa-psk,wpa2-psk mode=dynamic-keys \
- wpa2-pre-shared-key=WiFi-Password wpa-pre-shared-key=WiFi-Password
- /interface wireless set wlan1 ssid=CN-2G country="hong kong" security-profile=default
- /interface wireless set wlan2 ssid=CN-5G country="hong kong" security-profile=default
- /system reboot
作者: 张无忌 時間: 2025-1-14 21:27
本帖最後由 张无忌 於 2025-1-16 10:28 編輯
Line 21: abc.xyz.org must be set to real hostname FQDN.
Table 3: MikroTik router configuration
- #################################################
- # Step One: Wireguard Tunnel Setup
- #################################################
- #################################################
- # On HK MikroTik
- /interface wireguard
- add listen-port=13231 mtu=1420 name=wg-cn private-key=\
- "yJQDHxkppPLTPx+2A54y4AWpcVpO0QLxIYoEsvRq6V0=" \
- comment="WG CN"
- # Assign address to the router on the new interface.
- /ip address
- add address=10.2.88.3/32 comment="Wireguard" interface=wg-cn \
- network=10.2.88.0
- # Set up CN peer
- /interface wireguard peers
- add name=cn allowed-address=0.0.0.0/0 comment="cn" \
- endpoint-address=abc.xyz.org endpoint-port=27051 \
- interface=wg-cn public-key=\
- "vtWvAu10T0fVSfJ+X94gmnUPbUP6XTVXEBWtQF5YyHg=" \
- preshared-key="QD4Z19XNa4bZ67789jeG3FWjOZuEk76sEwmLNzi7c38="
- #################################################
- # Step Two: Routing the Traffic
- #################################################
- ###############################################
- # On HK 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-cn routing-table=wg-vpn
- /ip firewall nat \
- add chain=srcnat out-interface=wg-cn action=masquerade
- ### Open MSDOS window input "curl http://myip.dnsomatic.com" to display CN IP address ###
- #################################################
- # Step Three: DNS
- #################################################
- # On China MikroTik
- /ip dns
- set allow-remote-requests=yes servers=223.5.5.5,119.29.29.29
- /ip dhcp-server network
- set 0 dns-server=223.5.5.5,119.29.29.29
- #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
作者: 张无忌 時間: 2025-1-18 23:13
如果香港有房子,而安装宽频Internet,但是大部分是private IP,那怎么办?如果是public IP就简单,现在private IP!
可能在大陆家里先用WireGuard连香港,然后香港电脑连大陆(通过前面WireGuard),但是具体怎么弄?
作者: 张无忌 時間: 2025-1-18 23:13
备用
