UBNT EdgeRouter 自带了PPTP Server,典型的配置方法是
|
set vpn pptp remote-access authentication local-users username sskaje password PASSWORD set vpn pptp remote-access authentication mode local set vpn pptp remote-access client-ip-pool start 192.168.100.210 set vpn pptp remote-access client-ip-pool stop 192.168.100.219 set vpn pptp remote-access dns-servers server-1 8.8.8.8 set vpn pptp remote-access mtu 1492 |
官方参考guide: https://help./hc/en-us/articles/205220840-EdgeMAX-PPTP-VPN-with-local-users-RADIUS
这个案例里,我的路由eth0是LAN口,eth0的IP是 192.168.100.1,这个配置下我的pptp客户端能正常访问到我的内网的机器。
但是如果我需要把DNS设成 192.168.100.1,DNS请求就会一直没响应。
路由端抓 UDP 53 的包,可以看到pptp客户端发出的dns请求,但是没有回包。
看了眼/etc/dnsmasq.conf:
|
log-facility=/var/log/dnsmasq.log interface=eth0 interface=eth2 cache-size=10000 |
man dnsmasq
-i, –interface=
Listen only on the specified interface(s). Dnsmasq automatically adds the loopback (local) interface to the list of interfaces to use when the –interface option is used. If no –interface or –listen-address options
are given dnsmasq listens on all available interfaces except any given in –except-interface options. IP alias interfaces (eg “eth1:0”) cannot be used with –interface or –except-interface options, use –listen-
address instead. A simple wildcard, consisting of a trailing ‘*’, can be used in –interface and –except-interface options.
尝试了加一个 interface=pptp*,无效。
顺手先把dnsmasq的请求隔离到一个新的网段 192.168.101.0/24,服务端的local-ip设成 192.168.101.1,推送dns 192.168.101.1,再设置options ‘listen-address=192.168.101.1’,解决。
全部命令如下
|
set vpn pptp remote-access authentication local-users username sskaje password PASSWORD set vpn pptp remote-access authentication mode local set vpn pptp remote-access client-ip-pool start 192.168.101.210 set vpn pptp remote-access client-ip-pool stop 192.168.101.219 set vpn pptp remote-access dns-servers server-1 192.168.101.1 set vpn pptp remote-access local-ip 192.168.101.1 set vpn pptp remote-access mtu 1492 set service dns forwarding options listen-address=192.168.13.1 |
Incoming search terms:
|