ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 5755|回复: 0

[交流] BCP桥接(基于PPTP隧道)

[复制链接]
发表于 2013-11-1 10:14:09 | 显示全部楼层 |阅读模式

马上注册成为ROSABC会员,随时发帖回复。

您需要 登录 才可以下载或查看,没有账号?会员注册

x
RouterOS支持BCP(Bridge Control Protocol),即在PPP、PPTP、L2TP和PPPoE接口上的桥接。BCP运行桥接以太网数据通过PPP连接。BCP allows to bridge Ethernet packets through the PPP link. BCP建立后独立于PPP隧道,将不会与任何PPPIP地址接口有关系,桥接和路由能发生在同一独立的时间。BCP能用于替代EoIP+VPN隧道或者基于无线的WDS连接。
BCP (Bridge Control Protocol)需要在两边同时启用才能工作(PPP服务器和PPP客户端)。MikroTik RouterOS可以应用于其他的PPP设备,要求这个设备支持标准的BCP协议。
配置事例
我们需要相互连接2个远程办公室,并让他们在一个以太网内工作。我们要求使用加密(encryption)保护2个办公室直接的数据交换。
如下图,我有2个办公室,办公室1设置为PPTP服务器,办公室2 设置为PPTP客户端。下面通过winboxCLI介绍配置:
图片2.png
BCP配置(CLI)
Office1配置
首先我们需要建立一个桥接口,并确保桥接将一直有MAC地址存在。原因很简单,当BCP被使用PPP桥接port中,不会有任何MAC地址生成。
/interface bridge add name=bridge_local protocol-mode=rstp
/interface bridge port add bridge=bridge_local interface=ether1_local
/interface bridge set bridge_local admin-mac=xx:xx:xx:xx:xx:xx        
其中xx:xx:xx:xx:xx:xx是ether1_localMAC地址
现在我们能分配本地和公网地址到相应的接口上:
/ip address add address=192.168.88.1/24 interface=bridge_local
/ip address add address=1.1.1.1/24 interface=ether2_public
在这个事例中,仅使用PPP做桥接,PPP profilesecret的配置非常简单-仅分配用户名和密码,并指定profilebridge选项。PPP桥接不需要任何IP地址,但正常的PPP是必需的,所以要指定localremote 地址在服务器上。
/ppp profile add name=ppp_bridging bridge=bridge_local use-encryption=yes
/ppp secret add profile=ppp_bridging name=ppp1 password=ppp1
当桥接的PPP隧道需要通过二层(MAC)数据包头部信息,由于默认的接口MTUPPTP1460)不能满足这个的通讯,所以为确保适用运用环境,建议不用考虑MTU值,通过在服务器的MRRU选项设置更高的值。
MRRU允许启用支持单连接协商的多重链路,奋力数据包到多个通道,因此增加MTUMRU(支持65535字节)
/interface pptp-server server set enabled=yes mrru=1600
Office2配置
首先我们需要建立桥,并确定桥将有MAC地址存在,原因如上提到。
/interface bridge add name=bridge_local protocol-mode=rstp
/interface bridge port add bridge=bridge_local interface=ether1_local
/interface bridge set bridge_local admin-mac=xx:xx:xx:xx:xx:xx        
其中xx:xx:xx:xx:xx:xx是ether1_localMAC地址。
现在我们能分配本地和公网地址到相应的接口上:
/ip address add address=192.168.88.254/24 interface=bridge_local
/ip address add address=2.2.2.2/24 interface=ether2_public
配置PPP Profile,回应在服务器端的配置
/ppp profile add name=ppp_bridging bridge=bridge_local use-encryption=yes
创建一个pptp-client接口,不要忘记配置MRRU选项,确保二层帧能通过PPP隧道。
/interface pptp-client add profile=ppp_bridging mrru=1600 connect-to=1.1.1.1 user=ppp1 password=ppp1 disabled=no
BCP winbox配置
Office1配置
Bridge配置
bridge 中添加一个桥,并设置rstp
图片3.png
port中,添加桥接的接口,我们添加ether1port用于连接内网:
图片4.png
设置静态的MAC-address:
图片5.png
分配IP addresses,
图片6.png
创建PPP profile,并设置bridge参数,
图片7.png
添加PPP客户端
图片8.png
启用PPTP-server,
图片9.png
Office2配置
客户端路由器配置相同,只是你需要配置并启用PPTP客户端。
添加PPTP client,
图片10.png


您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2025-8-5 19:39 , Processed in 0.210979 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表