電訊茶室's Archiver

yiucsw 發表於 2018-3-4 13:25

將中國的Ether5/Wlan2 搬到香港 BCP over SSTP

[i=s] 本帖最後由 yiucsw 於 2022-3-9 01:31 編輯 [/i]

[font=Times New Roman][size=2]從之前 gfx86674 [url]http://www.telecom-cafe.com/forum/viewthread.php?tid=7087&extra=page%3D1[/url] 加描述再簡化。選BCR的原因是簡單容易設定,容易排錯。
其實做法是用一條L2網線將中國家的Mikrotik Ether5搬到香港。

香港區設定。
-       在香港區設定SSTP/L2TP server, MRRU=1600
-       將香港區的Default bridge 加到 PPP profile (BCP-profile)
-       Add route 192.168.CN.0/24 gateway 192.168.82.8 (主要是在香港家能login中國的Mikrotik)

中國區設定
-        加新的BCP Bridge, 將BCP Bridge 加到 PPP profile (BCP)
-       將Ether5, BCP-Bridge port. (從香港DHCP 直接派IP)
-       設定Ether5 的 IP 地址是 192.168.82.8/24    (主要是將香港網路IP地址延到中國Router 內)  

[size=1]** 不用Admin-MAC, 香港區已有,中國區是用Ether5 MAC.
** IP ARP,中國區沒有插電視箱到Ether5, and 沒有ARP。
** ARP = enable. Proxy-ARP 会loop IP assignment。
** 不要加IP address 到SSTP(加了香港DHCP 派不了IP到中國)
[/size][/font][/size]

yiucsw 發表於 2018-3-4 13:42

[i=s] 本帖最後由 yiucsw 於 2022-3-9 01:33 編輯 [/i]

[font=Times New Roman][size=2]香港區設定:
SSTP profile
1)/ppp profile add name=bcp-bridge bridge=bridge
2)/ppp secret add profile=bcp-bridge name=cnbcpxx password=xxxxxx
3)/interface sstp-server add name=sstp-in1 user=cnbcpxx (其實這個不用都沒有問題)
4)/interface sstp-server server set enabled=yes mrru=1600
5)/ip firewall filter add chain=input protocol=tcp dst-port=443 action=accept place-before=0 comment="Allow SSTP"

6)/ip route add check-gateway=ping distance=3 dst-address=192.168.cn1.0/24 gateway=\
    192.168.hk1.hkleg

(user cnbcpxx 可能一個user 用在多個中國Mikrotik) 沒有dynamic Route. 要手工加ip address到Ether5。[/size][/font]

yiucsw 發表於 2018-3-4 14:15

[i=s] 本帖最後由 yiucsw 於 2018-3-4 14:51 編輯 [/i]

[font=Times New Roman][size=2]中國區設定:
/interface bridge add name=bcp  (default protocol-mode=rstp)
/interface bridge port { set [find interface=ether5] bridge=bcp }
/ip address add address=192.168.hk?.hkleg/24 interface=ether5
/ppp profile add name=bcp bridge=bcp   (setup BCR)
/interface sstp-client add prof=bcp mrru=1600 user=cnbcpxx password=xxx connect=hkisp.ddns.net dis=no
將WLAN1 連到BCP bridge..[/size][/font]

角色 發表於 2018-3-4 14:27

设定后,效果怎样?用BCP有什么好处呢?

(我没有用什么BCP,而是普通一条PPP把两边连起来,通过PBR)就做到,两面LAN和WiFi用对面IP上网。

yiucsw 發表於 2018-3-4 15:19

[i=s] 本帖最後由 yiucsw 於 2018-3-6 14:17 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44669&ptid=7145]4#[/url] [i]角色[/i] [/b]

維護簡單/設定簡單.
L2 route-在SSTP基礎上加Bridge 便能有L2 routing... 不用理IP routing..

角色 發表於 2018-3-4 15:24

VOWIFI?什么WiFi?

你的意思,你香港和大陆都各有两个点吗?

我的只是大陆和香港各一个点。

passby 發表於 2018-3-4 16:02

有無做 speedtest results 作參考?

角色 發表於 2018-3-4 16:04

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44672&ptid=7145]7#[/url] [i]passby[/i] [/b]

我的PBR,网络正常的时候上下载有20Mbps。(大陆用中国移动(就是以前的铁通))

yiucsw 發表於 2018-3-4 16:11

[i=s] 本帖最後由 yiucsw 於 2022-3-9 01:35 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44671&ptid=7145]6#[/url] [i]角色[/i] [/b]

VOWIFI 是APPLE 手機用,WI-FI連到香港運營商 (CSL。。)通話。香港鈴聲

yiucsw 發表於 2018-3-4 16:14

[i=s] 本帖最後由 yiucsw 於 2018-3-6 14:18 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44672&ptid=7145]7#[/url] [i]passby[/i] [/b]

BCP 比EOIP快。看看如何測試bandwidth.

我记得移动宽带upload/download 不是一个速度。
20M download, upload 是2M?

passby 發表於 2018-3-4 18:45

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44675&ptid=7145]10#[/url] [i]yiucsw[/i] [/b]


    那是在香港經bcp連大陸做的speed test?

gfx86674 發表於 2018-3-5 12:38

[i=s] 本帖最後由 gfx86674 於 2018-3-5 12:51 編輯 [/i]

sstp-tunnel建立bcp如[u]yiucsw[/u]兄說是可行的,小弟也證實了:
Server:
[img]https://i.imgur.com/HtNz85t.png[/img]

Client:
[img]https://i.imgur.com/fhMnLrW.png[/img]

一般VPN連線:
Server會顯示DR(Dynamic|Running) ; Client則顯示R(Running)

BCP狀態時,因為VPN橋接了其它接口:
Server會顯示DRS(Dynamic|Running|Slave) ; Client則顯示RS(Running|Slave)

yiucsw 發表於 2018-3-5 18:10

[i=s] 本帖最後由 yiucsw 於 2018-3-5 22:42 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44687&ptid=7145]12#[/url] [i]gfx86674[/i] [/b]

谢谢你的支持,看看你的配置。
SSTP 好像有assign IP address. (可能是VPN pool)
ip 192.168.0.246 gateway 192.168.0.240
建新Bridge BCP-Bridge
定 IP address 到Bridge
192.168.0.255/28 192.168.0.224
DHCP 192.168.1.0 range

Client
建新Bridge BCP-Bridge
定 IP address 到Bridge
192.168.0.238/28  192.168.0.224
DHCP 是 192.168.83.0 和 192.168.11.0

有几个问题请教:
1)SSTP 加了IP address, DHCP 的要求是不能過 BCP/SSTP/EoIP.?以后要加Static IP 到ETHER5,DHCP 到如何處理WLAN?
[url]https://forum.mikrotik.com/viewtopic.php?t=108731[/url]
2)我覺得BCP-Bridge 是獨立的有點像VLAN,如何 將"Default Bridge" Route 到 BCP-bridge?

yiucsw 發表於 2018-3-5 23:11

[i=s] 本帖最後由 yiucsw 於 2022-3-9 01:37 編輯 [/i]

Deleted, other approach

gfx86674 發表於 2018-3-6 00:49

[i=s] 本帖最後由 gfx86674 於 2018-3-6 01:13 編輯 [/i]

[quote]中國境內:雙線路/Failover, 原本以為要加Static Route, 加PBRroute,,,..
想了一下好像是不用的。
我的做 ...
[size=2][color=#999999]yiucsw 發表於 2018-3-5 23:11[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44693&ptid=7145][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]
用sstp做bcp ,反正sstp-client一定會取得sstp的虛擬地址,不如在HK /ppp secret將虛擬地址固定
(local-address=172.16.0.0 /remote-address=172.16.0.1)

HK (192.168.5.0/24):
/ppp secret
[attach]4076[/attach]
[color=Pink]dst-address/gateway/distance之間用"空格"區隔[/color]

CN (192.168.1.0/24):
/ip route
[attach]4077[/attach]
這樣192.168.cn.0/24就與192.168.hk.0/24連接了

yiucsw 發表於 2018-3-6 04:16

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44694&ptid=7145]15#[/url] [i]gfx86674[/i] [/b]
想問問如何知道Traffic 是通過BCP 還是 IP layer 3 routing?
可能IP 是Route 進不到BCP bridge. (沒有set SSTP IP 地址時)

gfx86674 發表於 2018-3-6 08:11

[quote]回復  gfx86674
想問問如何知道Traffic 是通過BCP 還是 IP layer 3 routing?
可能IP 是Route 進不到BCP br ...
[size=2][color=#999999]yiucsw 發表於 2018-3-6 04:16[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44695&ptid=7145][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]
traffic是layer3 routing,用的是sstp-tunnel的地址;只有裝置使用ethernet時才會是layer2。

用您熟悉的在interface設192.168.cn.x或192.168.hk.x也行,但一樣是layer3 routing。

yiucsw 發表於 2018-3-7 01:49

[i=s] 本帖最後由 yiucsw 於 2018-3-7 02:41 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44678&ptid=7145]11#[/url] [i]passby[/i] [/b]
通過BCP
網路是中國移動50M,HKBN300M,到香港HGC     
speedtest - 3Mbits upload/download. latency 25ms.
[attach]4079[/attach]

vowifi 沒有問題。
不通過BCP
speedtest - 52.6Mbits download/6.42Mbits. latency 14ms.
[attach]4078[/attach]

passby 發表於 2018-3-7 07:28

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44697&ptid=7145]18#[/url] [i]yiucsw[/i] [/b]

多謝資料!

yiucsw 發表於 2018-3-7 11:41

[i=s] 本帖最後由 yiucsw 於 2022-3-9 01:41 編輯 [/i]

在Bridge 哪裡,ARP 是不能Set Proxy-arp, 只能set Enable. (同BCP 的文章不同的地方)

以下是文章:
[url]https://forum.mikrotik.com/viewtopic.php?f=7&t=96472&p=619402#p619402[/url]

alti 發表於 2018-3-26 16:01

用SSTP 的話
設定Force AES 會不會比較易斷?

還是用預設的RC4是最好的?

carlchan 發表於 2018-6-26 17:11

:handshake    Let me try try ...

角色 發表於 2018-6-26 17:19

现在大陆block VPN到香港非常厉害,用传统的VPN根本随时出事,连香港的IP都block死。

gfx86674 發表於 2018-7-1 12:06

SSTP-BCP:
[attach]4150[/attach]
client:可以對192.168.32.1(RouterA)與192.168.32.114(PC)試ping
server:可以對192.168.32.126(RouterB)試ping

BCP建立後 ,Server與Client端在/ip arp都會有相同mac-address紀錄

yiucsw 發表於 2018-7-1 12:44

[i=s] 本帖最後由 yiucsw 於 2018-7-1 13:13 編輯 [/i]

可以說明一下嗎?
RouteB 是192.168.32.126,還有沒有其他IP 地址?
DHCP 的設定? 只有一個DHCP,還是兩個DHCP? 如何分離?
中國PC 對中國網站不翻牆,如何設定?
能有詳細的說明嗎?

gfx86674 發表於 2018-7-1 17:17

[i=s] 本帖最後由 gfx86674 於 2018-7-1 17:49 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=45104&ptid=7145]25#[/url] [i]yiucsw[/i] [/b]
RouterA(vpn-server)只有一個bridge-lan(name=bridge) ,網域是192.168.32.0/25
[img]https://i.imgur.com/8oJdrbN.png[/img]
[img]https://i.imgur.com/IrYeEbG.png[/img]
[color=Pink]<sstp-bcp>只有當vpn用戶端連線成功時,才會自動加入bridge[/color]

RouterB(vpn-client)有兩個bridge ,
分別內部的bridge-lan(網域192.168.88.0/25),與bridge-bcp(橋接sstp-bcp與eth5)
[img]https://i.imgur.com/M7VvU1u.png[/img]
[img]https://i.imgur.com/bgtWfpq.png[/img]
[color=Pink]sstp-bcp只當vpn連線成功時,才會自動加入bridge-bcp[/color]

[size=4]RouterA(sstp-server)設置:[/size]
/interface sstp-s  server
[img]https://i.imgur.com/UiHh9V0.png[/img]

/ppp profile新增:
[img]https://i.imgur.com/4eCLdZc.png[/img]

/ppp secret新增:
[img]https://i.imgur.com/FDn804K.png[/img]

[size=4]RouterB(sstp-client)設置:[/size]
/ppp profile新增:
[img]https://i.imgur.com/3SGFaUN.png[/img]

/interface sstp-c 新增:
[img]https://i.imgur.com/5kQBRYs.png[/img]
[img]https://i.imgur.com/TWO2cd6.png[/img]

/ip address 將bridge-bcp加入RouterA的網域:
[img]https://i.imgur.com/MVI9MrU.png[/img]
[color=Pink]將bridge-bcp定義ip為192.168.32.126/25[/color]
[color=Blue]#即使bridge-bcp沒定義192.168.32.126/25也不影響BCP連線
#但設置可方便RouterB管理者用ping驗證,是否與RouterA連接上.[/color]

以上完成BCP的步驟, 只要RouterB的eth5接上裝置,
就會橋接至RouterA ,與RouterA的裝置處在相同的網段,相同的網路環境.
-----------------------------------
以上....若RouterB在中國 ,RouterB的eth2-eth4的裝置可否借BCP翻牆?

可以的,但您要讓RouterA(香港)先知道有192.168.88.0/25這個網段
在RouterA(香港) /ip route新增:
[img]https://i.imgur.com/xmYsH39.png[/img]
這樣RouterA就知道了192.168.88.0/25是與192.168.32.126有關聯的

再來是RouterB(中國)的翻牆設置,首先您要將CN的ip的清單匯入RouterB...
步驟可參考[url=http://www.telecom-cafe.com/forum/viewthread.php?tid=7047&extra=page%3D2]http://www.telecom-cafe.com/forum/viewthread.php?tid=7047&extra=page%3D2[/url]
[img]https://i.imgur.com/hImRMyE.png[/img]

在RouterB(中國)的/ip firewall mangle新增:
[img]https://i.imgur.com/91wI7wD.png[/img]
[img]https://i.imgur.com/dISGAQT.png[/img]
[img]https://i.imgur.com/NAGytVe.png[/img]
[img]https://i.imgur.com/fVM4COe.png[/img]
這樣翻牆設置就完成了,不需像一般policy route再設置Route與NAT

yiucsw 發表於 2018-8-6 18:07

[i=s] 本帖最後由 yiucsw 於 2018-8-6 20:01 編輯 [/i]

/ip address 將bridge-bcp加入RouterA的網域
是在 RouteB Bridge assign Route A的 IP address =192.168.32.126/25.
为什么是 /25?

gfx86674 發表於 2018-8-6 20:00

[i=s] 本帖最後由 gfx86674 於 2018-8-6 23:58 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=45228&ptid=7145]27#[/url] [i]yiucsw[/i] [/b]
[size=2]sstp連線一定會有local/remote-address ,兩邊都是...

橋接interface是sstp附加的,
也就是不管有沒有開bcp橋接interface,一點也不會改變原來sstp舊有的路由能力.

我可以使用sstp的(192.168.0.246/192.168.0.240)橋接192.168.88.0/25與192.168.32.0/25 ,

不過我想說既然用bcp將本地橋接到遠端了,
那我可將本地bridge-bcp定義個地址192.168.32.126 ,這樣本地的router就和遠端是同網段了.
192.168.32.0/25與192.168.88.0/25即父與子路由關係,不必經192.168.0.246/192.168.0.240仲介.

不是說192.168.0.246/192.168.0.240仲介不好,我只是提個樣版給您參考,這也是個方法!!

另外192.168.32.0/25 為何用是25 ,非24?
這是遮罩表式法:
/24 (subnet:255.255.255.0)=> 192.168.32.0-192.168.32.255
/25 (subnet:255.255.255.128)=> 192.168.32.0-192.168.32.127

所以
192.168.32.0/25(192.168.32.0-192.168.32.127)+ 192.168.32.128/25 (192.168.32.128-192.168.32.255)
=192.168.32.0/24 (192.168.32.0-192.168.32.255)

也因家裡的電腦沒這麼多,為了方便管理所以故意將遮罩切小.
/25 (subnet:255.255.255.128)=> 192.168.32.0-192.168.32.127
/26 (subnet:255.255.255.192)=> 192.168.32.0-192.168.32.63
/27 (subnet:255.255.255.224)=> 192.168.32.0-192.168.32.31
/28 (subnet:255.255.255.240)=> 192.168.32.0-192.168.32.15
/29 (subnet:255.255.255.248)=> 192.168.32.0-192.168.32.7
/30 (subnet:255.255.255.252)=> 192.168.32.0-192.168.32.3
/31 (subnet:255.255.255.254)=> 192.168.32.0-192.168.32.1
/32 (subnet:255.255.255.255)=> 192.168.32.0

您或許會問為何不用pool來控制dhcp-server配發ip的範圍?

您應該知道vpn的網段要與lan網段要分開,路由表才不會衝突.
vpn用戶端才能連結server端的伺服器(否則就要開proxy-arp偽裝成router地址)

但我希望lan-pool與vpn-pool都在192.168.32.0/24 ,我該怎麼做?
答案是lan用192.168.32.0/25 ,vpn用192.168.32.128/25 ,

即將192.168.32.0/24切割成兩個網段不就解決了嘛.希望這有幫到您{:4_93:}
[/size]

yiucsw 發表於 2018-8-6 20:36

[i=s] 本帖最後由 yiucsw 於 2022-3-11 18:03 編輯 [/i]

謝謝! 用你的方法更快建立BCP。
已setup ocserv, 不用BCP 很久。
最近要setup local VPN HK-HK.  再看你的文章,每看一次都能学习新的技术。

yiucsw 發表於 2018-8-11 11:29

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=45108&ptid=7145]26#[/url] [i]gfx86674[/i] [/b]

現在中國的網站會看看是不是本地的網路。例如京東。所有要VPN 到中國。

想問 相反方向如何處理?
RouteA 的 WLAN1/Ether5 VPN 到 中國。

頁: [1] 2

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.