我已经在 Pop!_OS 上安装strongswan-starter
以连接到我的工作场所。
我首先在 Ubuntu 上安装了它(一切都运行良好),但决定切换到 Pop!_OS 21.10。
当我连接到 Pop!_OS 上的 VPN 时,我可以 ping 远程网络,但 DNS 不起作用。当我查看时,/etc/resolv.conf
我可以看到 DNS 名称服务器尚未设置,所以这显然是 DNS 不起作用的原因。
在 Ubuntu 上我必须resolvconf
手动安装,然后重新启动strongswan-starter
,然后我才能看到名称服务器/etc/resolv.conf
。
在 Pop_OS! 上resolvconf
本机安装。重新启动resolvconf.service
没有帮助。
有人知道如何让它工作吗?
编辑:
日志内容如下(/var/log/syslog
):
Apr 19 16:34:12 pop-os systemd[1]: Started strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf.
Apr 19 16:34:12 pop-os ipsec[2925]: Starting strongSwan 5.9.1 IPsec [starter]...
Apr 19 16:34:12 pop-os charon: 00[DMN] Starting IKE charon daemon (strongSwan 5.9.1, Linux 5.16.15-76051615-generic, x86_64)
Apr 19 16:34:12 pop-os charon: 00[CFG] loading ca certificates from '/etc/ipsec.d/cacerts'
Apr 19 16:34:12 pop-os charon: 00[CFG] loading aa certificates from '/etc/ipsec.d/aacerts'
Apr 19 16:34:12 pop-os charon: 00[CFG] loading ocsp signer certificates from '/etc/ipsec.d/ocspcerts'
Apr 19 16:34:12 pop-os charon: 00[CFG] loading attribute certificates from '/etc/ipsec.d/acerts'
Apr 19 16:34:12 pop-os charon: 00[CFG] loading crls from '/etc/ipsec.d/crls'
Apr 19 16:34:12 pop-os charon: 00[CFG] loading secrets from '/etc/ipsec.secrets'
Apr 19 16:34:12 pop-os charon: 00[CFG] loaded ECDSA private key from '/etc/ipsec.d/private/user.key'
Apr 19 16:34:12 pop-os charon: 00[CFG] loaded 0 RADIUS server configurations
Apr 19 16:34:12 pop-os charon: 00[CFG] HA config misses local/remote address
Apr 19 16:34:12 pop-os charon: 00[LIB] loaded plugins: charon aesni aes rc2 sha2 sha1 md5 mgf1 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp agent xcbc hmac gcm drbg attr kernel-netlink resolve socket-default connmark farp stroke updown eap-identity eap-aka eap-md5 eap-gtc eap-mschapv2 eap-dynamic eap-radius eap-tls eap-ttls eap-peap eap-tnc xauth-generic xauth-eap xauth-pam tnc-tnccs dhcp lookip error-notify certexpire led addrblock unity counters
Apr 19 16:34:12 pop-os charon: 00[LIB] dropped capabilities, running as uid 0, gid 0
Apr 19 16:34:12 pop-os charon: 00[JOB] spawning 16 worker threads
Apr 19 16:34:12 pop-os ipsec[2925]: charon (2928) started after 20 ms
Apr 19 16:34:12 pop-os charon: 04[CFG] received stroke: add connection 'roadw'
Apr 19 16:34:12 pop-os charon: 04[CFG] loaded certificate "CN=user" from 'user.crt'
Apr 19 16:34:12 pop-os charon: 04[CFG] loaded certificate "CN=rw.vpn.company.ch" from 'rw.vpn.company.ch.cert.pem'
Apr 19 16:34:12 pop-os charon: 04[CFG] added configuration 'roadw'
Apr 19 16:34:12 pop-os charon: 06[CFG] received stroke: route 'roadw'
Apr 19 16:34:12 pop-os ipsec[2925]: 'roadw' routed
Apr 19 16:34:20 pop-os gnome-shell[1540]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
Apr 19 16:34:20 pop-os gnome-shell[1540]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
Apr 19 16:34:20 pop-os gnome-shell[1540]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
Apr 19 16:34:20 pop-os gnome-shell[1540]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345503cde0 Gjs_pop-cosmic_system76_com_applications_CosmicAppDisplay.cosmic-app-display:insensitive] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345609a8b0 StViewport:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345503cde0 Gjs_pop-cosmic_system76_com_applications_CosmicAppDisplay.cosmic-app-display:insensitive] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345609a8b0 StViewport:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345068dc40 Gjs_pop-cosmic_system76_com_applications_CosmicFolderButton.app-well-app cosmic-base-folder-button ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345503cde0 Gjs_pop-cosmic_system76_com_applications_CosmicAppDisplay.cosmic-app-display:insensitive] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345609a8b0 StViewport:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345068dc40 Gjs_pop-cosmic_system76_com_applications_CosmicFolderButton.app-well-app cosmic-base-folder-button ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x5634503bc420 Gjs_ui_iconGrid_BaseIcon.overview-icon overview-icon-with-label:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345503cde0 Gjs_pop-cosmic_system76_com_applications_CosmicAppDisplay.cosmic-app-display:insensitive] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345609a8b0 StViewport:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345068dc40 Gjs_pop-cosmic_system76_com_applications_CosmicFolderButton.app-well-app cosmic-base-folder-button ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x5634503bc420 Gjs_ui_iconGrid_BaseIcon.overview-icon overview-icon-with-label:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x563451883710 StBoxLayout:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345503cde0 Gjs_pop-cosmic_system76_com_applications_CosmicAppDisplay.cosmic-app-display:insensitive] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345609a8b0 StViewport:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x56345068dc40 Gjs_pop-cosmic_system76_com_applications_CosmicFolderButton.app-well-app cosmic-base-folder-button ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x5634503bc420 Gjs_ui_iconGrid_BaseIcon.overview-icon overview-icon-with-label:insensitive ("Library Home")] which is not in the stage.
Apr 19 16:34:20 pop-os gnome-shell[1540]: st_widget_get_theme_node called on the widget [0x563451883710 StBoxLayout:insensitive ("Library Home")] which is not in the stage.
...
我假设相关的日志条目是这些,因为这些是第一个失败的(并且它们不会出现在运行具有相同 VPN 配置的另一个运行 Ubuntu 的系统上):
Apr 19 16:34:20 pop-os gnome-shell[1540]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
Apr 19 16:34:20 pop-os gnome-shell[1540]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
Apr 19 16:34:20 pop-os gnome-shell[1540]: cr_parser_new_from_buf: assertion 'a_buf && a_len' failed
Apr 19 16:34:20 pop-os gnome-shell[1540]: cr_declaration_parse_list_from_buf: assertion 'parser' failed
答案1
在@ecdsa 的指点下我终于弄明白了:)
在读取日志之前,我必须用 初始化 strongSwan ipsec up roadw
。
然后日志/var/log/syslog
显示以下条目:
Apr 19 22:27:08 pop-os charon: 16[IKE] installing DNS server X.X.X.X via resolvconf
Apr 19 22:27:08 pop-os charon: 16[IKE] resolvconf: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf
我能够根据以下方法修复符号链接此主题在 AskUbuntu 上:
sudo rm /etc/resolv.conf
sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf
sudo resolvconf -u
最后,使用以下命令初始化 strongSwan:
sudo ipsec up roadw
问题现已解决,/etc/resolv.conf
显示正确的名称服务器和 DNS 正在运行。
编辑:
我已经检查了全新安装,显然 Pop!_OS 默认/etc/resolv.conf
有一个符号链接:
../run/systemd/resolve/stub-resolv.conf
并不是:
../run/resolvconf/resolv.conf