通过PPTP隧道连接一个远程客户
下面的例子显示了如果通过给定电脑和远程办公网络同一网络IP地址的PPTP加密隧道把一个电脑连接到一个远程办公网络(不需要在EoIP隧道上桥接)
请查询如何设置一个你使用的软件的PPTP客户的手册。
这个例子中的路由器:
- [RemoteOffice]
接口ToInternet 192.168.81.1/24
接口Office 10.150.1.254/24
客户电脑可以通过因特网访问路由器:
在PPTP服务器上设置用户帐号:
[admin@RemoteOffice] ppp secret> add name=ex service=pptp password=lkjrht
local-address=10.150.1.254 remote-address=10.150.1.2
[admin@RemoteOffice] ppp secret> print detail
Flags: X - disabled
0 name="ex" service=pptp caller-id="" password="lkjrht" profile=default
local-address=10.150.1.254 remote-address=10.150.1.2 routes==""
[admin@RemoteOffice] ppp secret>
然后应该在PPTP服务器列表中添加用户:
[admin@RemoteOffice] interface pptp-server> add name=FromLaptop user=ex
[admin@RemoteOffice] interface pptp-server> print
Flags: X - disabled, D - dynamic, R - running
# NAME USER MTU CLIENT-ADDRESS UPTIME ENC...
0 FromLaptop ex
[admin@RemoteOffice] interface pptp-server>
并且启用服务:
[admin@RemoteOffice] interface pptp-server server> set enabled=yes
[admin@RemoteOffice] interface pptp-server server> print
enabled: yes
mtu: 1460
mru: 1460
authentication: mschap2
default-profile: default
[admin@RemoteOffice] interface pptp-server server>
最后,代理ARP必须在'Office'接口上启用:
如果你想从公用IP子网11.11.11.0/24访问本地的2.2.2.0/24,你应该使用目的地址翻译以及源地址翻译特性设置action=netmap。
/ip firewall nat add chain=dstnat dst-address=11.11.11.1-11.11.11.254 \
action=netmap to-addresses=2.2.2.1-2.2.2.254
/ip firewall nat add chain=srcnat src-address=2.2.2.1-2.2.2.254 \
action=netmap to-addresses=11.11.11.1-11.11.11.254