分享

EdgeRouter PPtP Server访问本地DNS服务 | @sskaje

 xxqa的新文艺 2019-08-16

UBNT EdgeRouter 自带了PPTP Server,典型的配置方法是

1
2
3
4
5
6
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:

1
2
3
4
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’,解决。
全部命令如下

1
2
3
4
5
6
7
8
9
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
EdgeRouter PPtP Server访问本地DNS服务 by @sskaje: https:///2016/02/edgerouter-pptp-server-dns-service/

Incoming search terms:

Link to this post!

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多