Router-to-Router安全隧道实例 以下是一个使用因特网上的加密PPTP隧道连接两个企业网的例子: 在这个例子中有两个路由器:
接口LocalHomeOffice 10.150.2.254/24 接口ToInternet 192.168.80.1/24
接口ToInternet 192.168.81.1/24 接口 LocalRemoteOffice 10.150.1.254/24 每个路由器连接到一个不同的ISP。任何一个路由器可以通过因特网访问其他的路由器。 在Preforma PPTP服务器,用户必须对客户设置: [admin@HomeOffice] ppp secret> add name=ex service=pptp password=lkjrht local-address=10.0.103.1 remote-address=10.0.103.2 [admin@HomeOffice] ppp secret> print detail Flags: X - disabled 0 name="ex" service=pptp caller-id="" password="lkjrht" profile=default local-address=10.0.103.1 remote-address=10.0.103.2 routes=="" [admin@HomeOffice] ppp secret> 然后应该在PPTP服务器列表中添加用户: [admin@HomeOffice] interface pptp-server> add user=ex [admin@HomeOffice] interface pptp-server> print Flags: X - disabled, D - dynamic, R - running # NAME USER MTU CLIENT-ADDRESS UPTIME ENC... 0 pptp-in1 ex [admin@HomeOffice] interface pptp-server> 最后,启用服务器: [admin@RemoteOffice] interface pptp-client> add connect-to=192.168.80.1 user=ex \ \... password=lkjrht disabled=no [admin@RemoteOffice] interface pptp-client> print Flags: X - disabled, R - running 0 R name="pptp-out1" mtu=1460 mru=1460 connect-to=192.168.80.1 user="ex" password="lkjrht" profile=default add-default-route=no [admin@RemoteOffice] interface pptp-client> 这样,一个PPTP隧道就在路由器之间创建好了。这个隧道就像在IP地址为10.0.103.1及10.0.103.2的路由器之间的以太网点对点连接。它使得在第三网络部分上的路由器之间能够直接通信。 为了在PPTP隧道上路由本地企业网你需要添加以下路由: [admin@HomeOffice] > ip route add dst-address 10.150.1.0/24 gateway 10.0.103.2 [admin@RemoteOffice] > ip route add dst-address 10.150.2.0/24 gateway 10.0.103.1 在PPTP服务器上它或者可以通过使用用户配置的routes参数完成: [admin@HomeOffice] ppp secret> print detail Flags: X - disabled 0 name="ex" service=pptp caller-id="" password="lkjrht" profile=default local-address=10.0.103.1 remote-address=10.0.103.2 routes=="" [admin@HomeOffice] ppp secret> set 0 routes="10.150.1.0/24 10.0.103.2 1" [admin@HomeOffice] ppp secret> print detail Flags: X - disabled 0 name="ex" service=pptp caller-id="" password="lkjrht" profile=default local-address=10.0.103.1 remote-address=10.0.103.2 routes="10.150.1.0/24 10.0.103.2 1" [admin@HomeOffice] ppp secret> 测试PPTP隧道连接: [admin@RemoteOffice]> /ping 10.0.103.1 10.0.103.1 pong: ttl=255 time=3 ms 10.0.103.1 pong: ttl=255 time=3 ms 10.0.103.1 pong: ttl=255 time=3 ms ping interrupted 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 3/3.0/3 ms 测试通过PPTP隧道到LocalHomeOffice接口的连接:
要在这个安全隧道上桥接一个LAN,请参考EoIP部分手册的例子。要想对该隧道上的流量设置最大速度,请查询Queues部分。 |
MikroTik RouterOS应用事例讲解(九)
最新推荐文章于 2023-12-11 22:32:49 发布