電訊茶室's Archiver

gfx86674 發表於 2018-2-9 12:45

利用OVPN建立Layer2隧道

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

ROS提供隧道bridge功能,
可以與OVPN的ethernet模式進行Layer2隧道連接,類似於Eoip-Tunnel
[img]https://i.imgur.com/Gi0lwoC.png[/img][code]Office1 配置:
#建立bridge1 ,並橋接與之的端口(ether2)
/interface bridge add name=bridge1 protocol-mode=rstp
/interface bridge port add bridge=bridge1 interface=ether2

#建立屬於ethernet mode的profile(ovpn-bridging) 與帳密
/ppp profile add name=ovpn-bridging bridge=bridge1 use-encryption=yes
/ppp secret add profile=ovpn-bridging name=123 password=123 local-address=172.16.0.0 remote-address=172.16.0.1

/interface ovpn-server server
set auth=sha1 certificate=cert1 port=1194 cipher=blowfish128 default-profile=default mode=ethernet enabled=yes netmask=24
#啟用ovpn-server,並將mode切換至ethernet[/code][code]Office2 配置:
/interface bridge add name=bridge1 protocol-mode=rstp
/interface bridge port add bridge=bridge1 interface=ether2
#與ovpn-server雷同

/ppp profile add name=ovpn-bridging bridge=bridge1 use-encryption=yes
#profile與ovpn-server雷同,方可回應橋接

/interface ovpn-client
add auth=sha1 certificate=cert1 port=1194 connect-to=123.123.123.123 name=ovpn-out1 mode=ethernet profile=ovpn-bridging user=123 password=123
#對Office1(123.123.123.123)進行ovpn撥號,mode切換至ethernet[/code]設置完成後,當client與server連接,
在bridge的port裡可以看到123帳號的連接在bridge port被自動添加
[img]https://i.imgur.com/wCKvYHT.png[/img]

角色 發表於 2018-2-9 15:18

Ching,你图片的“Internet”是用一个Router来模拟出来吗?

因为我正计划建立RouterOS实验室,想请教你一些意见。例如要注意些问题?买什么设备等等。

gfx86674 發表於 2018-2-9 15:29

[quote]Ching,你图片的“Internet”是用一个Router来模拟出来吗?

因为我正计划建立RouterOS实验室,想请教你一些 ...
[size=2][color=#999999]角色 發表於 2018-2-9 15:18[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44173&ptid=7088][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]internet即穿越網際網路進行橋接 ,若改在私網內橋接也是行的通的.

carw318 發表於 2018-2-10 17:06

謝謝 gfx86674 師兄 :)

頁: [1]

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