这似乎是network-manager-openconect-gnome
Ubuntu 18.04+中的一个新问题
我安装sudo apt install network-manager-openconnect-gnome
以获得 gnome 与 opeconnect 和Cisco AnyConnect 兼容 VPN (openconnect)的集成
顺便说一句(这实际上可能是相关的),我这样做是为了获取*.local
要解决的地址:
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
根据 systemd 文档dns
先搬进mdns4_minimal
去/etc/nsswitch.conf
如果我通过 gnome 网络管理器使用 openconnect 连接到 VPN,VPN 地址(工作站点)无法解析。常规站点继续按预期工作。
如果我在命令行上使用 openconnect 连接到 VPN sudo openconnect vpn.mycompany.com
,VPN 地址(工作站点)会解析。常规站点继续按预期工作。
我想我会检查一下这些 VPN 连接方法之间是否有任何区别/etc/resolv.conf
,果然,有一个:
命令行上的openconnect(工作):
#@VPNC_GENERATED@ -- this file is generated by vpnc
# and will be overwritten by vpnc
# as long as the above mark is intact
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 10.10.10.10
nameserver 10.10.10.11
search broadband mycompany.com
openconnect gnome 集成(不工作):
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 192.168.1.1
nameserver 10.10.10.10
nameserver 10.10.10.11
search broadband mycompany.com
如果我删除(或注释掉) nameserver 192.168.1.1
,这是工作文件和不工作文件之间的内容差异......一切都按预期工作。我可以解析公司内部的地址,并且常规站点按预期工作。
Fedora 不会发生这种情况。一切都是开箱即用的。我不确定为什么该network-manager-openconnect-gnome
软件包的工作方式不同,或者是否有一种方法可以使其在没有任何一个的情况下工作
- 手动编辑文件。
openconnect
从命令行 使用该工具并保持终端打开运行该命令。