MikroTik RouterOS应用事例讲解(九)

PPTP应用实例

Router-to-Router安全隧道实例

以下是一个使用因特网上的加密PPTP隧道连接两个企业网的例子:

      

在这个例子中有两个路由器:

  • [HomeOffice]

接口LocalHomeOffice 10.150.2.254/24

接口ToInternet 192.168.80.1/24

  • [RemoteOffice]

接口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.110.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部分。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值