简介
出差的用户可通过 PPTP VPN 连入公司局域网并访问公司相关服务器资源。
网络拓扑图及说明
- 外网 IP 地址为 112.X.X.X/X,网关为 112.X.X.X,DNS 为 210.22.84.3
- eth0 用于连接 Internet 外网,eth2 设定为 192.168.2.1/24
- 服务器的 IP 地址为 192.168.2.100/24
操作步骤
- 参考 http://bbs.ubnt.com.cn/forum.php?mod=viewthread&tid=13664&extra=page%3D1 进行路由器基础配置
- 将一台电脑连接到TS8 端口 3 上,正常可获得 192.168.2.X/24 的 IP 地址,使用 Putty 去 ssh 访问路由器 LAN 管理 IP 地址 192.168.2.1
- 输入路由器管理员账号和密码并进入配置模式
- 通过命令行配置 PPTP VPN
- 配置 PPTP 账号采用路由器本地账号验证
set vpn pptp remote-access authentication mode local set vpn pptp remote-access authentication local-users username ubnt password ubnt
- 配置 PPTP 客户端 IP 地址池
set vpn pptp remote-access client-ip-pool start 10.0.0.10 set vpn pptp remote-access client-ip-pool stop 10.0.0.100
- 配置 PPTP 客户端 DNS
set vpn pptp remote-access dns-servers server-1 8.8.8.8
- 配置 PPTP 监听地址
set vpn pptp remote-access outside-address X.X.X.X
- PPTP 配置指令如下
set vpn pptp remote-access authentication mode local set vpn pptp remote-access authentication local-users username ubnt password ubnt set vpn pptp remote-access client-ip-pool start 10.0.0.10 set vpn pptp remote-access client-ip-pool stop 10.0.0.100 set vpn pptp remote-access dns-servers server-1 8.8.8.8 set vpn pptp remote-access outside-address X.X.X.X
- 配置 PPTP 账号采用路由器本地账号验证
- 若WAN 口使用 ADSL PPPOE 接入,且 EdgeRouter 配置 DDNS OK,需调整PPTP相关配置
- 配置 PPTP 地址池为 192.168.2.210-192.168.2.220 (LAN 的 DHCP 地址池为 192.168.2.10-192.168.2.200)
set vpn pptp remote-access client-ip-pool start 192.168.2.210 set vpn pptp remote-access client-ip-pool stop 192.168.2.220
- 配置 PPTP 的 DNS 服务器为 LAN 接口 IP 地址
set vpn pptp remote-access dns-servers server-1 192.168.2.1
- 配置PPTP监听
set service dns forwarding options "listen-address=192.168.2.1"
- 配置 PPTP 地址池为 192.168.2.210-192.168.2.220 (LAN 的 DHCP 地址池为 192.168.2.10-192.168.2.200)
- 可按需求配置 Firewall 配置 rule 允许 PPTP(TCP 1723)和 GRE(协议 47)
- windows 客户端进行 PPTP VPN 配置
- 新建一个 PPTP VPN 连接
- 输入 PPTP 账号密码 ubnt/ubnt
- PPTP 连接成功可访问 192.168.2.100 服务器
- 新建一个 PPTP VPN 连接
备注
- PPTP 配置 Radius server 进行帐号验证
configure set vpn pptp remote-access authentication mode radius set vpn pptp remote-access authentication radius-server 10.1.0.121 key testing123
- 按如下指令配置监听 DHCP 接入方式的 WAN 口
set vpn pptp remote-access dhcp-interface eth0
- 可按需求配置 MTU
set vpn pptp remote-access mtu 1024