電訊茶室's Archiver

角色 發表於 2018-1-30 22:13

香港用大陆IP看CCTV5和大陆用香港IP看myTV SUPER节目

[i=s] 本帖最後由 角色 於 2018-6-19 08:21 編輯 [/i]

###############################

如果members有兴趣学些RouterOS,可以跟帖讨论,至于器材可以买便宜一点的MikroTik Routers也行

###############################
估计有很多members都会遇到这个情况,就是
1、在大陆要看香港新闻和myTV SUPER节目
2、在香港看大陆的电影和CCTV5

用手机或者电脑都可以做的上面的要求。怎样做?请大家看看下图:

[attach]3893[/attach]

整套思路

CN-to-HK 方向:
1、先建立一条HK-Gateway PPTP VPN link(或者其他VPN tunnel),从大陆PPTP VPN到香港的PPTP VPN Server。
2、大陆的router用policy route把大陆的devices(via wired or wireless)连到香港的VPN Sever, 那么这就完成大陆去香港这一段。

HK-to-CN 方向:
1、因为大陆的router的WAN口的内网IP,所以用上面的方法是不可行的。我们只好又从大陆PPTP过去香港,建立另外一条link,香港要去大陆的Packets就通过这条link到大陆的那边。当然也要通过policy route来进行。

角色 發表於 2018-1-30 22:14

[i=s] 本帖最後由 角色 於 2018-6-22 16:37 編輯 [/i]

在EPC的帖子链接:
[url]https://www.hkepc.com/forum/viewthread.php?fid=12&tid=2424267&extra=page%3D1[/url]
已经给EPC某位版主搬到内部去,下载都看不到了,但是不要紧,主要的内容都在我脑子了。

角色 發表於 2018-1-30 22:14

备用帖子3

角色 發表於 2018-1-30 22:15

备用帖子4

carlchan 發表於 2018-1-31 11:48

support !  :victory:

blizzard2 發表於 2018-1-31 11:58

以前我用兩個asus router 駁 pptp。 然後每邊一個 RPi 行 softether,一個 server,一個 bridge。
電腦手機 set 唔同 ip/gateway 就會由唔同router 出街。

而家用老毛子行SS,好自動。兩個舊router就得。

角色 發表於 2018-1-31 14:49

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44150&ptid=7084]5#[/url] [i]carlchan[/i] [/b]

谢谢支持!

角色 發表於 2018-1-31 14:51

[quote]以前我用兩個asus router 駁 pptp。 然後每邊一個 RPi 行 softether,一個 server,一個 bridge。
電腦手機 ...
[size=2][color=#999999]blizzard2 發表於 2018-1-31 11:58[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44151&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]

现在用了MikroTik的Routers和MikroTik的AP,很多东西都自动化。

我也有用SS,用v2ray。因为我出这个帖子,两边的人有不同的需要。

角色 發表於 2018-2-1 10:40

如果哪里Ching有兴趣,我会在这里慢慢跟你讲解,但是要跟帖讨论。

角色 發表於 2018-2-1 14:31

不知道members哪个方向要求多一点?

1、大陆去香港?
2、还有香港去大陆呢?

passby 發表於 2018-2-1 14:52

香港去大陆. 不過大陸冇地方或朋友setup vpn!

角色 發表於 2018-2-1 15:20

[quote]香港去大陆. 不過大陸冇地方或朋友setup vpn!
[size=2][color=#999999]passby 發表於 2018-2-1 14:52[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44156&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]

这个是一个难题。但是听过有members在阿里云那里租用一些服务器,然后在那里安装CHR Routeros。

而现在我这个方案,我的亲友不一定VPN到大陆来,VPN到香港的Server,系统自动把traffic转到大陆去,效果也不错,能看到大陆CCTV5和电视剧。

角色 發表於 2018-2-10 00:35

[quote]以前我用兩個asus router 駁 pptp。 然後每邊一個 RPi 行 softether,一個 server,一個 bridge。
電腦手機 ...
[size=2][color=#999999]blizzard2 發表於 2018-1-31 11:58[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44151&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]

因为你两边都有Raspberry Pi,想做什么都可以。现在我都喜欢mod机,现在都不这样做了,主要都是用RouterOS为多。

gfx86674 發表於 2018-2-10 13:29

[i=s] 本帖最後由 gfx86674 於 2018-2-20 15:01 編輯 [/i]

假設:
ISP1與ISP2都有提供Public地址供遠端連接,並啟用cloud供VPN橋接
[color=Red]CN:192.168.100.254/24 / xxx1234.sn.mynetname.net[/color]
[color=Blue]HK:192.168.200.254/24 / xxx5678.sn.mynetname.net[/color]

[color=Red]CN:
ether6-8:直接翻牆至Hong Kong
192.168.100.0/24連接CN外的地址,透過policy routing改由ISP2連接

192.168.100.201-192.168.100.250有連外國需求,
綁HK_DNS-Server,免除被DNS被污染風險.[/color]

[color=Blue]HK:
ether6-8:直接翻牆至China
192.168.200.0/24連接是CN地址,透過policy routing改由ISP1連接
[/color]
[color=Green]192.168.100.0/24 <=> 192.168.200.0/24 電腦群組彼此可互連[/color][code]#CN:
/ip cloud
set ddns-enabled=yes

/interface eoip
add allow-fast-path=no mac-address=02:F1:04:27:75:96 name=eoip-tunnel1 ipsec-secret=aaa tunnel-id=123 local-address=xxx1234.sn.mynetname.net remote-address=xxx5678.sn.mynetname.net

/interface bridge
add name=bridge1 vlan-filtering=no

/interface bridge port
add bridge=bridge1 interface=eoip-tunnel1
add bridge=bridge1 interface=sfp1 pvid=100
add bridge=bridge1 interface=ether2 pvid=100
add bridge=bridge1 interface=ether3 pvid=100
add bridge=bridge1 interface=ether4 pvid=100
add bridge=bridge1 interface=ether5 pvid=100
add bridge=bridge1 interface=ether6 pvid=200
add bridge=bridge1 interface=ether7 pvid=200
add bridge=bridge1 interface=ether8 pvid=200

/interface bridge vlan
add bridge=bridge1 tagged=eoip-tunnel1 untagged=sfp1,ether2,ether3,ether4,ether5 vlan-ids=100
add bridge=bridge1 tagged=eoip-tunnel1,bridge1 untagged=ether6,ether7,ether8 vlan-ids=200

/interface vlan
add interface=bridge1 name=vlan200 vlan-id=200

/ip address
add address=192.168.100.254/24 interface=sfp1 network=192.168.100.0
add address=192.168.200.1/24 interface=vlan200

/interface bridge set bridge1 vlan-filtering=yes

/ip firewall nat
set [find action="masquerade"] out-interface=ether1 dst-address=!192.168.200.0/24 !src-address
add action=dst-nat chain=dstnat dst-port=53 protocol=udp src-address=192.168.100.201-192.168.100.250 to-addresses=192.168.200.254

/ip firewall mangle
add action=accept chain=prerouting dst-address=192.168.200.0/24
add action=mark-routing chain=prerouting dst-address-type=!local dst-address-list=!cn new-routing-mark=vpn passthrough=no src-address=192.168.100.0/24

/ip route
add distance=1 gateway=192.168.200.254 routing-mark=vpn[/code][code]#HK:
/ip cloud
set ddns-enabled=yes

/ip dns
set allow-remote-requests=yes

/interface eoip
add allow-fast-path=no mac-address=02:F1:04:27:76:95 name=eoip-tunnel1 ipsec-secret=aaa tunnel-id=123 local-address=xxx5678.sn.mynetname.net remote-address=xxx1234.sn.mynetname.net

/interface bridge
add name=bridge1 vlan-filtering=no

/interface bridge port
add bridge=bridge1 interface=eoip-tunnel1
add bridge=bridge1 interface=sfp1 pvid=200
add bridge=bridge1 interface=ether2 pvid=200
add bridge=bridge1 interface=ether3 pvid=200
add bridge=bridge1 interface=ether4 pvid=200
add bridge=bridge1 interface=ether5 pvid=200
add bridge=bridge1 interface=ether6 pvid=100
add bridge=bridge1 interface=ether7 pvid=100
add bridge=bridge1 interface=ether8 pvid=100

/interface bridge vlan
add bridge=bridge1 tagged=eoip-tunnel1 untagged=sfp1,ether2,ether3,ether4,ether5 vlan-ids=200
add bridge=bridge1 tagged=eoip-tunnel1 untagged=ether6,ether7,ether8 vlan-ids=100

/ip address
add address=192.168.200.254/24 interface=sfp1 network=192.168.200.0

/interface bridge set bridge1 vlan-filtering=yes

/ip firewall nat
set [find action="masquerade"] out-interface=ether1 dst-address=!192.168.100.0/24 !src-address

/ip firewall mangle
add action=mark-routing chain=prerouting dst-address-list=cn new-routing-mark=vpn passthrough=no src-address=192.168.200.0/24

/ip route
add distance=1 gateway=192.168.200.1 dst-address=192.168.100.0/24
add distance=1 gateway=192.168.200.1 routing-mark=vpn
[/code]

角色 發表於 2018-2-10 14:26

谢谢CHing的Scripts.

有下面的问题:
“192.168.100.201-192.168.100.250有連外國需求,綁HK_DNS-Server,免除被DNS被污染風險.”

不知道大陆是否会把你的要去DNS Server IP转到她自己的,然后特别给你给resolve hostnames?

passby 發表於 2018-2-10 16:46

但是現在深圳的isp大多都不給Public address的。我想應該IP cloud也不工作呢!有其他方法嗎?

gfx86674 發表於 2018-2-10 17:14

[quote]谢谢CHing的Scripts.

有下面的问题:
“192.168.100.201-192.168.100.250有連外國需求,綁HK_DNS-Server,免 ...
[size=2][color=#999999]角色 發表於 2018-2-10 14:26[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44183&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]不會,是在內網裡進行 gfw管不到...

會污染的都是經isp,被isp被感染 .

gfx86674 發表於 2018-2-10 17:18

[quote]但是現在深圳的isp大多都不給Public address的。我想應該IP cloud也不工作呢!有其他方法嗎? ...
[size=2][color=#999999]passby 發表於 2018-2-10 16:46[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44185&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]
找一個可單向連接的vpn ,vpn連線後都會有local-address與remote-address.
把local-address與remote-address複製到eoip-tunnel ,即能建立layer2隧道.

角色 發表於 2018-2-10 17:20

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

谢谢CHing的解析。

我开始明白,就是解开hostname的时候是通过PPP tunnel。而不是通过Tunnel以内。

passby 發表於 2018-2-10 17:36

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


謝謝你的答覆!
就用你提供的例子。如果只有HK router的ip cloud ddns。那我應該怎樣做?

gfx86674 發表於 2018-2-10 18:24

[i=s] 本帖最後由 gfx86674 於 2018-2-10 18:27 編輯 [/i]

[quote]回復  gfx86674
謝謝你的答覆!
就用你提供的例子。如果只有HK router的ip cloud ddns。那我應該怎樣做? ...
[size=2][color=#999999]passby 發表於 2018-2-10 17:36[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44193&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]
與18樓的答覆相同,您讓CN透過SSTP撥號HK cloud的地址.
連線成功不管是SSTP-Client或SSTP-Server都會顯示local-address或remote-address.

把SSTP-Client顯示的local-address與remote-address輸入CN Router的eoip-tunnel;
把SSTP-Server顯示的local-address與remote-address輸入HK Router的eoip-tunnel

[color=Pink]RouterOS可穿越GFW的PPP-Tunnel大概只剩SSTP ,PPTP/L2TP/OVPN大概都穿不過.
IPSec的Road Warrior設置較麻煩些,但值得一試.[/color]

passby 發表於 2018-2-10 18:35

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


    例如我HK做VPN Server, CN做VPN client。當連接接後,我在HK的interface裏看到的callid就是CN的address?

passby 發表於 2018-2-10 18:44

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


    local-address與remote-address都是Private ip address也可以?

gfx86674 發表於 2018-2-10 18:47

[i=s] 本帖最後由 gfx86674 於 2018-2-10 18:50 編輯 [/i]

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44196&ptid=7084]23#[/url] [i]passby[/i] [/b]
可以,在sstp-tunnel內再建立eoip-tunnel
選項ipsec要關閉(勾ipsec會強逼用public-address).

carlchan 發表於 2018-2-10 21:27

[quote]回復  passby
可以,在sstp-tunnel內再建立eoip-tunnel
選項ipsec要關閉(勾ipsec會強逼用public-address). ...
[size=2][color=#999999]gfx86674 發表於 2018-2-10 18:47[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44197&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]


    勁 ching 出現!都想試試

gfx86674 發表於 2018-2-10 23:27

[i=s] 本帖最後由 gfx86674 於 2018-2-10 23:52 編輯 [/i]

[quote]回復  gfx86674
    例如我HK做VPN Server, CN做VPN client。當連接接後,我在HK的interface裏看到的cal ...
[size=2][color=#999999]passby 發表於 2018-2-10 18:35[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44195&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]
不要再質疑,我幫朋友設置:住家對公司使用l2tp-tunnel ,再用Private ip建置eoip-tunnel
從ros v5.x就已經開始這麼做了.
l2tp-client(Home)
[img]https://i.imgur.com/pHPMY5L.png[/img]
l2tp-server(Office)
[img]https://i.imgur.com/0hLZC1h.png[/img]
[color=Red]註:
使用eoip-tunnel記得開啟Keepalive ,否則Running並不是代表連線,而只是啟用而已.
唯有啟用Keepalive ,Running才代表eoip-tunnel兩端真的已連接上.[/color]

passby 發表於 2018-2-11 08:10

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


    多謝你的指導!

yiucsw 發表於 2018-2-19 00:59

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44182&ptid=7084]14#[/url] [i]gfx86674[/i] [/b]
我是分開兩個Bridge. 只用一個Ether5 在中國連到香港。改用VLAN有什麼好處?沒有用過VLAN。
看到還有Mangle/Route Tab VPN. 不是通過EOIP 以將兩地連結?你是在Bridge block DHCP request?
看到網上說EOIP over SSTP 加VLAN 太不effective? 其實可不可以VLAN over SSTP?

yiucsw 發表於 2018-2-19 01:56

再看你的例子,VLAN能雙向。我用兩個Bridge 是單向的。 能否做一個VLAN over EOIP over SSTP例子? 中國的Ether5 是 直接連香港,香港的Ether5 直接連香港?可以將Wlan2 同eoip 連在一起?

我發現在香港PC用Telnet/SSH/winbox通過SSTP(VPN) 是不能連到中國的 Mikrotik。在香港的Mikrotik 內,tools-> telnet 是沒有問題,在PC上是不成的。嘗試加Route 不成功,有什麼問題?在香港PC上ping/tracert SSTP中國端IP也不成。

gfx86674 發表於 2018-2-20 00:52

[i=s] 本帖最後由 gfx86674 於 2018-2-20 14:37 編輯 [/i]

[quote]再看你的例子,VLAN能雙向。我用兩個Bridge 是單向的。 能否做一個VLAN over EOIP over SSTP例子? 中國的Et ...
[size=2][color=#999999]yiucsw 發表於 2018-2-19 01:56[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44369&ptid=7084][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]
sstp連線用的是互聯網協議位址,屬layer3
與ethernet和eoip-tunnel的layer2是兩回事...您不能在ip mode(layer3)做更高位階(如:layer2)的行為

您說的sstp+eoip表現不佳,或許更正確的形容是sstp不好,而非eoip.
sstp經網友測試似乎有20M的瓶頸,沒法再達更高的數據
——————————————————————————————————————
RouterOS v6.41後bridge添加vlan新功能,才賣弄新技巧把vlan放入主題裡;
若是不用vlan,就如您所說的用2個bridge也不是不可,或許更容易配置.

範例:
只有HK提供Public地址供遠端連接,所以HK為sstp-server ,CN為sstp-client
[color=Red]CN:192.168.100.254/24 / private-address:10.200.0.53[/color]
[color=Blue]HK:192.168.200.254/24 / public-address:123.123.123.123[/color]

[color=Red]CN:
ether5:直接翻牆至Hong Kong
192.168.100.0/24連接CN外的地址,透過policy routing改由ISP2連接

192.168.100.201-192.168.100.250有連外國需求,
綁HK_DNS-Server,免除被DNS被污染風險.[/color]

[color=Blue]HK:
ether5:直接翻牆至China
192.168.200.0/24連接是CN地址,透過policy routing改由ISP1連接[/color]
[color=Green]192.168.100.0/24 <=> 192.168.200.0/24 電腦群組彼此可互連[/color][code]#CN:

/interface sstp-client
add authentication=pap certificate=cert connect-to=123.123.123.123:443 name=sstp-out1 password=123 user=123 verify-server-address-from-certificate=no

/interface eoip
add allow-fast-path=no name=eoip-hk tunnel-id=200 local-address=172.16.0.1 remote-address=172.16.0.0
add allow-fast-path=no name=eoip-cn tunnel-id=100 local-address=172.16.0.1 remote-address=172.16.0.0

/interface bridge
add name=bridge-local
add name=bridge-remote

/interface bridge port
add bridge=bridge-local interface=eoip-cn
add bridge=bridge-local interface=ether2
add bridge=bridge-local interface=ether3
add bridge=bridge-local interface=ether4
add bridge=bridge-remote interface=eoip-hk
add bridge=bridge-remote interface=ether5

/ip address
add address=10.200.0.53/24 interface=ether1 network=10.200.0.0
add address=192.168.100.254/24 interface=bridge-local network=192.168.100.0

/ip route
add distance=2 dst-address=192.168.200.0/24 gateway=172.16.0.0
add distance=3 gateway=172.16.0.0 routing-mark=vpn
add distance=5 gateway=ether1

/ip firewall nat
set [find action="masquerade"] out-interface=ether1 dst-address=!192.168.200.0/24
add action=dst-nat chain=dstnat dst-port=53 protocol=udp src-address=192.168.100.201-192.168.100.250 to-addresses=192.168.200.254

/ip firewall mangle
add action=accept chain=prerouting dst-address=192.168.200.0/24
add action=mark-routing chain=prerouting dst-address-type=!local dst-address-list=!cn new-routing-mark=vpn passthrough=no src-address=192.168.100.0/24[/code][code]#HK:

/interface sstp-server server
set authentication=pap certificate=cert default-profile=default enabled=yes port=443

/ppp secret
add local-address=172.16.0.0 remote-address=172.16.0.1 name=123 password=123 routes="192.168.100.0/24 172.16.0.1 2" service=sstp

/interface eoip
add allow-fast-path=no name=eoip-cn tunnel-id=100 local-address=172.16.0.0 remote-address=172.16.0.1
add allow-fast-path=no name=eoip-hk tunnel-id=200 local-address=172.16.0.0 remote-address=172.16.0.1

/interface bridge
add name=bridge-local
add name=bridge-remote

/interface bridge port
add bridge=bridge-local interface=eoip-hk
add bridge=bridge-local interface=ether2
add bridge=bridge-local interface=ether3
add bridge=bridge-local interface=ether4
add bridge=bridge-remote interface=eoip-cn
add bridge=bridge-remote interface=ether5

/ip address
add address=123.123.123.123/24 interface=ether1 network=123.123.123.0
add address=192.168.200.254/24 interface=bridge-local network=192.168.200.0

/ip route
add distance=3 gateway=172.16.0.1 routing-mark=vpn
add distance=5 gateway=ether1

/ip firewall nat
set [find action="masquerade"] out-interface=ether1 dst-address=!192.168.100.0/24

/ip firewall mangle
add action=mark-routing chain=prerouting dst-address-list=cn new-routing-mark=vpn passthrough=no src-address=192.168.200.0/24
[/code]

頁: [1] 2

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