有没有办法在命令行上给定当前计算机上本地网络接口的 MAC 地址(例如01:23:45:67:89:ab
),以确定该接口是 WiFi 还是有线?
我正在尝试在 shell 脚本中执行此操作。
有没有办法在命令行上给定当前计算机上本地网络接口的 MAC 地址(例如01:23:45:67:89:ab
),以确定该接口是 WiFi 还是有线?
我正在尝试在 shell 脚本中执行此操作。
作为一名开发人员,我正在尝试在 ubuntu 22 主机(virtualbox)上设置 vm guest 虚拟机,以便能够访问互联网。问题是我没有在同一个私有子网上运行外部路由器,所以我想我还需要在主机上设置“路由器/网关”功能以正确连接两个世界(?)。
为了给您提供一个上下文,我正在尝试迁移我当前的(旧的)设置,如下所示:
(Internet) <--> asus router (static public ip a.b.c.d, gateway + dhcp for internal subnet 192.168.84.1) <--> ubuntu host (192.168.84.107) <--> vm guests (192.168.84.xxx)
当前(旧)主机上的配置是一个简单的网桥(封装物理 eth0),网关设置为 192.168.84.1(华硕路由器),一切正常。
我的新主机位于其他地方(它本身就是一个虚拟机,所以实际上我现在正在做嵌套虚拟化,但我猜它与这个问题无关),拥有自己的公共IP(abc132/25)并使用远程网关 (abc129)。因此,没有路由器 192.168.84.1 将虚拟机(使用 192.168.84.xxx)指向:
(Internet) <--> external router (a.b.c.129) <--> ubuntu host (public IP a.b.c.132/25) <--> vm guests (192.168.84.xxx)
我尝试过的(如果需要,我将编辑问题并提供 netplan、ifconfig、ip 路由和其他转储,但现在我只是问我想做的事情是否可能):
编辑的netplan:从“eth0”接口中删除所有设置,创建封装它的桥“br0”,并将设置放置在那里(地址,名称服务器,路由)。我还将ip 192.168.84.1添加到地址中,所以现在br0有两个ip(原来的公共abc132/25和子网网关的192.168.84.1/24)
将虚拟机设置为使用桥接适配器(并为其分配静态 ip 192.168.84.x)
安装了 isc dhcp 服务器并将其配置为使用路由器 192.168.84.1 管理接口“br0”和子网 192.168.84.0(掩码 255.255.255.0)
当前状态:
From 192.168.84.1: icmp_seq=3 Redirect Host(New nexthop: a.b.c.129)
我假设我缺少将本地 dhcp/路由连接到外部网关的部分,但我已经没有想法(和排列)要在哪里更改。
任何帮助将不胜感激!
谢谢。
我正在尝试使用 OpenConnect VPN 客户端连接到托管自签名 TLS 证书的 VPN 服务器。VPN 中的身份验证位于 Microsoft SSO 后面。
当我尝试连接到 VPN(设置 -> 网络 -> VPN)时,会弹出一个浏览器弹出窗口(进程实际上是 /usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/WebKitWebProcess),我可以在其中登录使用 SSO,但弹出窗口中会出现一条消息“不可接受的 TLS 证书”。
/usr/local/share/ca-certificates/extra/
,运行sudo update-ca-certificates --fresh
。Clearing symlinks in /etc/ssl/certs...
done.
Updating certificates in /etc/ssl/certs...
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
138 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
我手动检查 - 证书确实被附加到/etc/ssl/certs/ca-certificates.crt
openconnect
cli工具中,有一个参数用于传递证书 sha --servercert
。但这是在 cli 中。不确定 openconnect 网络管理器 GUI 是否有类似的东西。操作系统:Ubuntu 23.10
OpenConnect 版本:v9.12-1
. 使用GnuTLS 3.8.1
。
我买了一台带有 wifi 和蓝牙的迷你电脑,但无论我如何尝试,wifi 都没有显示。安装驱动程序后它可以在 Windows 10 上运行,但遗憾的是在 ubuntu 上不行。
Windows 驱动程序: https://ftp.csl-computer.com/pub/drivers/mini-pc/CSL_Narrow_Box/51194_52233_52852/
我尝试了一些方法,例如: WiFi-driver not Found in Mini PC (Ubuntu 18.04) or BCM43455 PCIe Wireless Adapter not recognize
迷你电脑: https://www.amazon.de/-/en/Mini-PC-QuadCore-DDR3-RAM-Bluetooth/dp/B01LT46CVG
但没有成功。我不知道。我想用ubuntu,因为有家庭助手。任何想法?说实话,我不是 Linux 专家,在这方面还很陌生。
编辑:无线日志文件:
########## wireless info START ##########
Report from: 13 Apr 2024 16:04 CEST +0200
Booted last: 13 Apr 2024 00:00 CEST +0200
Script from: 25 Jan 2020 03:34 UTC +0000
##### release ###########################
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
##### kernel ############################
Linux 6.5.0-27-generic #28~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 15 10:51:06 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Parameters: ro, quiet, splash, vt.handoff=7
##### desktop ###########################
Ubuntu
##### lspci #############################
01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
Subsystem: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:0123]
Kernel driver in use: r8169
##### lsusb #############################
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1a2c:2124 China Resource Semico Co., Ltd Keyboard
Bus 001 Device 002: ID 1bcf:08a0 Sunplus Innovation Technology Inc. Gaming mouse [Philips SPK9304]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
##### PCMCIA card info ##################
##### rfkill ############################
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
##### secure boot #######################
This system doesn't support Secure Boot
##### lsmod #############################
wl 6488064 0
mac80211 1720320 0
libarc4 12288 1 mac80211
brcmutil 24576 0
cfg80211 1323008 2 wl,mac80211
wmi 40960 1 video
##### interfaces ########################
##### ifconfig ##########################
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback <MAC address> brd <MAC address>
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether <MAC 'enp1s0' [IF1]> brd <MAC address>
inet 192.168.1.175/24 brd 192.168.1.255 scope global dynamic noprefixroute enp1s0
valid_lft 41280sec preferred_lft 41280sec
inet6 fd0d:3d1f:3198::82c/128 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fd0d:3d1f:3198:0:ac1c:b926:537:1e54/64 scope global temporary dynamic
valid_lft 602881sec preferred_lft 83990sec
inet6 fd0d:3d1f:3198:0:e366:5056:16ca:84ce/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::6fd1:96f8:2d60:10c8/64 scope link noprefixroute
valid_lft forever preferred_lft forever
##### iwconfig ##########################
lo no wireless extensions.
enp1s0 no wireless extensions.
##### route #############################
default via 192.168.1.1 dev enp1s0 proto dhcp metric 100
169.254.0.0/16 dev enp1s0 scope link metric 1000
192.168.1.0/24 dev enp1s0 proto kernel scope link src 192.168.1.175 metric 100
##### resolv.conf #######################
[777 root '/etc/resolv.conf' -> '../run/systemd/resolve/stub-resolv.conf']
nameserver 127.0.0.53
options edns0 trust-ad
search lan
##### network managers ##################
Installed:
NetworkManager
Running:
root 495 1 0 15:32 ? 00:00:01 /usr/sbin/NetworkManager --no-daemon
##### NetworkManager info ###############
GENERAL.DEVICE: enp1s0
GENERAL.TYPE: ethernet
GENERAL.NM-TYPE: NMDeviceEthernet
GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/Devices/2
GENERAL.VENDOR: Realtek Semiconductor Co., Ltd.
GENERAL.PRODUCT: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
GENERAL.DRIVER: r8169
GENERAL.DRIVER-VERSION: 6.5.0-27-generic
GENERAL.FIRMWARE-VERSION: --
GENERAL.HWADDR: <MAC 'enp1s0' [IF1]>
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.REASON: 0 (No reason given)
GENERAL.IP4-CONNECTIVITY: 4 (full)
GENERAL.IP6-CONNECTIVITY: 3 (limited)
GENERAL.UDI: /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/enp1s0
GENERAL.PATH: pci-0000:01:00.0
GENERAL.IP-IFACE: enp1s0
GENERAL.IS-SOFTWARE: no
GENERAL.NM-MANAGED: yes
GENERAL.AUTOCONNECT: yes
GENERAL.FIRMWARE-MISSING: no
GENERAL.NM-PLUGIN-MISSING: no
GENERAL.PHYS-PORT-ID: --
GENERAL.CONNECTION: 1. vezetékes kapcsolat
GENERAL.CON-UUID: 205b93db-b859-333e-bea0-6afef0bedff2
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
GENERAL.METERED: no (guessed)
CAPABILITIES.CARRIER-DETECT: yes
CAPABILITIES.SPEED: 1000 Mb/s
CAPABILITIES.IS-SOFTWARE: no
CAPABILITIES.SRIOV: no
INTERFACE-FLAGS.UP: yes
INTERFACE-FLAGS.LOWER-UP: yes
INTERFACE-FLAGS.CARRIER: yes
INTERFACE-FLAGS.PROMISC: no
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 192.168.1.175/24
IP4.GATEWAY: 192.168.1.1
IP4.ROUTE[1]: dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]: dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.ROUTE[3]: dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 100
IP4.DNS[1]: 192.168.1.1
IP4.DOMAIN[1]: lan
DHCP4.OPTION[1]: broadcast_address = 192.168.1.255
DHCP4.OPTION[2]: dhcp_lease_time = 43200
DHCP4.OPTION[3]: dhcp_server_identifier = 192.168.1.1
DHCP4.OPTION[4]: domain_name = lan
DHCP4.OPTION[5]: domain_name_servers = 192.168.1.1
DHCP4.OPTION[6]: expiry = 1713058358
DHCP4.OPTION[7]: host_name = sanyi-Narrow-Box-4K-4GB
DHCP4.OPTION[8]: ip_address = 192.168.1.175
DHCP4.OPTION[9]: next_server = 192.168.1.1
DHCP4.OPTION[10]: requested_broadcast_address = 1
DHCP4.OPTION[11]: requested_domain_name = 1
DHCP4.OPTION[12]: requested_domain_name_servers = 1
DHCP4.OPTION[13]: requested_domain_search = 1
DHCP4.OPTION[14]: requested_host_name = 1
DHCP4.OPTION[15]: requested_interface_mtu = 1
DHCP4.OPTION[16]: requested_ms_classless_static_routes = 1
DHCP4.OPTION[17]: requested_nis_domain = 1
DHCP4.OPTION[18]: requested_nis_servers = 1
DHCP4.OPTION[19]: requested_ntp_servers = 1
DHCP4.OPTION[20]: requested_rfc3442_classless_static_routes = 1
DHCP4.OPTION[21]: requested_root_path = 1
DHCP4.OPTION[22]: requested_routers = 1
DHCP4.OPTION[23]: requested_static_routes = 1
DHCP4.OPTION[24]: requested_subnet_mask = 1
DHCP4.OPTION[25]: requested_time_offset = 1
DHCP4.OPTION[26]: requested_wpad = 1
DHCP4.OPTION[27]: routers = 192.168.1.1
DHCP4.OPTION[28]: subnet_mask = 255.255.255.0
IP6.ADDRESS[1]: fd0d:3d1f:3198:0:ac1c:b926:537:1e54/64
IP6.ADDRESS[2]: fd0d:3d1f:3198::82c/128
IP6.ADDRESS[3]: fd0d:3d1f:3198:0:e366:5056:16ca:84ce/64
IP6.ADDRESS[4]: fe80::6fd1:96f8:2d60:10c8/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 1024
IP6.ROUTE[2]: dst = fd0d:3d1f:3198::/64, nh = ::, mt = 100
IP6.ROUTE[3]: dst = fd0d:3d1f:3198::/48, nh = fe80::1a34:afff:fe00:2c88, mt = 100
IP6.ROUTE[4]: dst = fd0d:3d1f:3198::82c/128, nh = ::, mt = 100
IP6.DNS[1]: fd0d:3d1f:3198::1
IP6.SEARCHES[1]: lan
DHCP6.OPTION[1]: dhcp6_domain_search = lan
DHCP6.OPTION[2]: dhcp6_name_servers = fd0d:3d1f:3198::1
DHCP6.OPTION[3]: ip6_address = fd0d:3d1f:3198::82c
CONNECTIONS.AVAILABLE-CONNECTION-PATHS: /org/freedesktop/NetworkManager/Settings/1
CONNECTIONS.AVAILABLE-CONNECTIONS[1]: 205b93db-b859-333e-bea0-6afef0bedff2 | 1. vezetékes kapcsolat
##### NetworkManager.state ##############
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
##### NetworkManager config #############
[[/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf]]
[connection]
wifi.powersave = 3
[[/etc/NetworkManager/NetworkManager.conf]]
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
[device]
wifi.scan-rand-mac-address=no
[[/usr/lib/NetworkManager/conf.d/10-dns-resolved.conf]]
[main]
dns=systemd-resolved
[[/usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf]]
[keyfile]
unmanaged-devices=*,except:type:wifi,except:type:gsm,except:type:cdma
[[/usr/lib/NetworkManager/conf.d/20-connectivity-ubuntu.conf]]
[connectivity]
uri=http://connectivity-check.ubuntu.com./
[[/usr/lib/NetworkManager/conf.d/no-mac-addr-change.conf]]
[device-31-mac-addr-change]
match-device=driver:eagle_sdio,driver:wl
wifi.scan-rand-mac-address=no
##### NetworkManager profiles ###########
##### Netplan config ####################
[/etc/netplan/01-network-manager-all.yaml]
network:
version: 2
renderer: NetworkManager
##### iw reg get ########################
'iw' is not installed (package "iw").
##### iwlist channels ###################
lo no frequency information.
enp1s0 no frequency information.
##### iwlist scan #######################
lo Interface doesn't support scanning.
enp1s0 Interface doesn't support scanning.
##### module infos ######################
[wl]
filename: /lib/modules/6.5.0-27-generic/updates/dkms/wl.ko
license: MIXED/Proprietary
depends: cfg80211
retpoline: Y
name: wl
vermagic: 6.5.0-27-generic SMP preempt mod_unload modversions
parm: passivemode:int
parm: wl_txq_thresh:int
parm: oneonly:int
parm: piomode:int
parm: instance_base:int
parm: nompc:int
parm: intf_name:string
[mac80211]
filename: /lib/modules/6.5.0-27-generic/kernel/net/mac80211/mac80211.ko
license: GPL
description: IEEE 802.11 subsystem
depends: cfg80211,libarc4
retpoline: Y
intree: Y
name: mac80211
vermagic: 6.5.0-27-generic SMP preempt mod_unload modversions
parm: minstrel_vht_only:Use only VHT rates when VHT is supported by sta. (bool)
parm: max_nullfunc_tries:Maximum nullfunc tx tries before disconnecting (reason 4). (int)
parm: max_probe_tries:Maximum probe tries before disconnecting (reason 4). (int)
parm: beacon_loss_count:Number of beacon intervals before we decide beacon was lost. (int)
parm: probe_wait_ms:Maximum time(ms) to wait for probe response before disconnecting (reason 4). (int)
parm: ieee80211_default_rc_algo:Default rate control algorithm for mac80211 to use (charp)
[brcmutil]
filename: /lib/modules/6.5.0-27-generic/kernel/drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko
license: Dual BSD/GPL
description: Broadcom 802.11n wireless LAN driver utilities.
depends:
retpoline: Y
intree: Y
name: brcmutil
vermagic: 6.5.0-27-generic SMP preempt mod_unload modversions
[cfg80211]
filename: /lib/modules/6.5.0-27-generic/kernel/net/wireless/cfg80211.ko
description: wireless configuration support
license: GPL
depends:
retpoline: Y
intree: Y
name: cfg80211
vermagic: 6.5.0-27-generic SMP preempt mod_unload modversions
parm: bss_entries_limit:limit to number of scan BSS entries (per wiphy, default 1000) (int)
parm: ieee80211_regdom:IEEE 802.11 regulatory domain code (charp)
parm: cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band (bool)
##### module parameters #################
[mac80211]
beacon_loss_count: 7
ieee80211_default_rc_algo: minstrel_ht
max_nullfunc_tries: 2
max_probe_tries: 5
minstrel_vht_only: Y
probe_wait_ms: 500
[cfg80211]
bss_entries_limit: 1000
cfg80211_disable_40mhz_24ghz: N
ieee80211_regdom: 00
##### /etc/modules ######################
##### modprobe options ##################
[/etc/modprobe.d/amd64-microcode-blacklist.conf]
blacklist microcode
[/etc/modprobe.d/blacklist-ath_pci.conf]
blacklist ath_pci
[/etc/modprobe.d/blacklist-bcm43.conf]
blacklist b43
blacklist b43legacy
blacklist ssb
blacklist bcm43xx
blacklist brcm80211
blacklist brcmfmac
blacklist brcmsmac
blacklist bcma
[/etc/modprobe.d/blacklist.conf]
blacklist evbug
blacklist usbmouse
blacklist usbkbd
blacklist eepro100
blacklist de4x5
blacklist eth1394
blacklist snd_intel8x0m
blacklist snd_aw2
blacklist prism54
blacklist bcm43xx
blacklist garmin_gps
blacklist asus_acpi
blacklist snd_pcsp
blacklist pcspkr
blacklist amd76x_edac
blacklist brcmsmac
blacklist bcma
[/etc/modprobe.d/blacklist-rare-network.conf]
alias net-pf-3 off
alias net-pf-6 off
alias net-pf-9 off
alias net-pf-11 off
alias net-pf-12 off
alias net-pf-19 off
alias net-pf-21 off
alias net-pf-36 off
[/etc/modprobe.d/broadcom-sta-common.conf]
blacklist b43
blacklist b43legacy
blacklist b44
blacklist bcma
blacklist brcm80211
blacklist brcmsmac
blacklist ssb
[/etc/modprobe.d/intel-microcode-blacklist.conf]
blacklist microcode
[/etc/modprobe.d/iwlwifi.conf]
remove iwlwifi \
(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
&& /sbin/modprobe -r mac80211
##### rc.local ##########################
grep: /etc/rc.local: No such file or directory
##### pm-utils ##########################
##### udev rules ########################
##### dmesg #############################
[ 11.926484] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[ 14.010492] r8169 0000:01:00.0 enp1s0: Link is Down
[ 16.649536] r8169 0000:01:00.0 enp1s0: Link is Up - 1Gbps/Full - flow control off
[ 560.702923] wl: loading out-of-tree module taints kernel.
[ 560.702942] wl: module license 'MIXED/Proprietary' taints kernel.
[ 560.702950] wl: module verification failed: signature and/or required key missing - tainting kernel
[ 560.702953] wl: module license taints kernel.
########## wireless info END ############
2024 年 10 月 4 日更新:这不是真正的泄漏。请参阅下面 mpboden 接受的答案。
问题:
我在 Kubuntu Desktop 22.04 上连接到外部 wifi,并希望使用 DNSOverTLS 将 DNS 系统范围配置为 9.9.9.9 (quad9)。然而,在 dnsleaktest.com 上我仍然得到不同的 DNS。
我使用 Firefox 进行测试,并将“DNS over HTTPS”设置为“关闭”。
在https://on.quad9.net上我得到了预期的结果:YES, You ARE using quad9
在 dnsleaktest.com 上,我得到了未执行的结果:
这是我所做的:
在受影响 wifi 的 NetworkManager 中,我禁用了 IPv6 并将 IPv4 设置为“自动”(仅限地址),并放置一个空列表作为 DNS 服务器。终端中的配置结果为:
$ nmcli device
DEVICE TYPE STATE CONNECTION
wlo1 wifi connected TP-LINK_58DE
p2p-dev-wlo1 wifi-p2p disconnected --
lo loopback unmanaged --
$ nmcli device show wlo1
GENERAL.DEVICE: wlo1
GENERAL.TYPE: wifi
GENERAL.HWADDR: xx:xx:xx:xx:xx:xx
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: TP-LINK_58DE
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
IP4.ADDRESS[1]: 192.168.0.112/24
IP4.GATEWAY: 192.168.0.1
IP4.ROUTE[1]: dst = 192.168.0.0/24, nh = 0.0.0.0, mt = 600
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 192.168.0.1, mt = 600
IP4.ROUTE[3]: dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP6.GATEWAY: --
我这样配置了 /etc/systemd/resolved.conf (只有最后几行是相关的,但为了完整性/错误检查,我提供了完整的文件):
$ cat /etc/systemd/resolved.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the resolved.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
#
# See resolved.conf(5) for details.
[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
#DNS=
#FallbackDNS=
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=no
#LLMNR=no
#Cache=no-negative
#CacheFromLocalhost=no
#DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
DNS=9.9.9.9#dns.quad9.net
FallbackDNS=9.9.9.9#dns.quad9.net
Domains=~.
DNSSEC=yes
DNSOverTLS=yes
在sudo systemctl restart systemd-resolved
和之后sudo systemctl restart NetworkManager
,这是生成的配置(整个输出粘贴在此处):
$ resolvectl status
Global
Protocols: -LLMNR -mDNS +DNSOverTLS DNSSEC=yes/supported
resolv.conf mode: foreign
Current DNS Server: 9.9.9.9#dns.quad9.net
DNS Servers: 9.9.9.9#dns.quad9.net
Fallback DNS Servers: 9.9.9.9#dns.quad9.net
DNS Domain: ~.
Link 2 (wlo1)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR -mDNS +DNSOverTLS DNSSEC=yes/supported
在基本测试中它似乎有效:
$ resolvectl query archlinux.com
archlinux.com: 3.64.163.50 -- link: wlo1
-- Information acquired via protocol DNS in 1.1292s.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: yes
-- Data from: cache network
$ dig archlinux.com
; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> archlinux.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60948
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;archlinux.com. IN A
;; ANSWER SECTION:
archlinux.com. 7200 IN A 3.64.163.50
;; Query time: 331 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Sat Apr 06 09:30:08 CEST 2024
;; MSG SIZE rcvd: 58
$ ss -tuna | grep :853
tcp TIME-WAIT 0 0 192.168.0.112:48420 9.9.9.9:853
tcp ESTAB 0 0 192.168.0.112:49032 9.9.9.9:853
剩下的问题是:为什么我在 dnsleaktest.com 上得到不同的 DNS?
我尝试过的一些事情:
sudo resolvectl flush-caches
sudo resolvconf -u
dns=none
的 [main] 部分/etc/NetworkManager/NetworkManager.conf
/etc/NetworkManager/conf.d/90-dns-none.conf
sudo systemctl restart systemd-resolved
sudo systemctl restart NetworkManager
cd /etc/
mv resolv.conf resolv.conf-old
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo dpkg-reconfigure resolvconf
。这导致:$ ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Apr 8 09:10 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.53
还没有什么帮助。你能帮我解决这个问题吗?
我已运行以下命令sudo find / -type f -name "*.network" -not -path "/var/lib/docker/*"
来显示.network
全新 22.04 服务器安装上的所有文件。
除了.network
下面的文件之外,我在系统上看/run/systemd/network/
不到任何其他文件。.network
鉴于此/run
,我可以在来自网络源代码中的硬编码默认值的文件tempfs
中看到的配置在哪里?.network
/run/systemd/network/
我在相对全新安装的 ubuntu 22.04 上遇到了一个令人困惑的问题。今天我注意到我的笔记本电脑上的互联网速度非常慢,但我的手机或公寓中的其他笔记本电脑上的互联网速度却很慢。经过一番调查后,我注意到每当网络连接中断时,我kworker/28:2+events
运行时都会有一个名为“使用 100% CPU”的进程top
。
检查后/var/log/kern.log
,我注意到每次kworker
弹出该进程时都会有一条消息:
... ieee80211 phy0: Hardware restart was requested
每当我尝试建立任何联系时,似乎都会发生这种情况。此外,有点出乎意料的是,每当我在进程处于活动状态sudo
时运行命令时kworker
,该sudo
命令都会挂起,直到kworker
进程完成。
我的理解是,这类问题通常与内核及其中的某种错误有关。我注意到我的软件更新程序有可用的内核更新,所以我显然想尝试获取这些更新,但是......当我尝试这样做时,我遇到了硬件重置问题。
我迫切希望尽快解决这个问题,但我不知道接下来该去哪里。有任何想法吗?
亲爱的 Ubuntu 社区,
我的 Ubuntu 23.10 系统遇到与 WiFi 功能相关的持续问题。虽然 WiFi 连接本身工作正常,但尝试关闭 WiFi 会导致整个系统冻结。任何涉及 sudo 或 NetworkManager 的命令都会导致终端无响应。
在使用journalctl调查系统日志时,我始终遇到以下错误消息:
kernel: iwlwifi 0000:02:00.0: 队列 5 在 fifo 3 上处于活动状态并卡住了 10000 毫秒。SW [6, 7] HW [7, 7] FH TRB=0x080305006
为了解决这个问题,我遵循了 Ubuntu Ask 上建议的解决方案,其中涉及修改 GRUB 配置。我遵循的步骤是:
Opened the GRUB configuration file using the command: sudo nano /etc/default/grub.
Modified the line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to include net.ipv4.tcp_ecn=0.
Saved the changes (Ctrl+o) and exited nano (Ctrl+x).
Updated GRUB using the command: sudo update-grub.
然而,尽管实施了此解决方案,问题仍然存在,并且相同的错误继续发生。
进一步的调查使我找到了另一个可能的解决方案,涉及检查固件文件 iwlwifi-3160-17.ucode 的完整性。但是,我遇到了差异,因为我发现系统上的文件名为 iwlwifi-3160-17.ucode.zst,并且我获得的哈希值 (efa40dcbabe15f74f4763d7534419752) 与预期的哈希值 (fee0d7dddf8437148ab25c4b1a34202c) 不同。
此外,我尝试执行命令 sudo sysctl -w net.ipv4.tcp_ecn=0 作为不同解决方案的一部分,但不幸的是,它没有解决问题。
我注意到,如果我使用命令 sudo systemctl stop NetworkManager 然后 sudo systemctl start NetworkManager 关闭和打开 WiFi,它会工作得很好,不会导致任何系统冻结。
还有一点需要注意的是,当使用可启动 USB 在“尝试 Ubuntu”模式下运行 Ubuntu 而不安装时,我可以正常打开或关闭 WiFi,而不会遇到此问题。我在 Ubuntu 22 中遇到了这个错误,在删除所有数据并安装 Ubuntu 23 后,我遇到了同样的错误。
感谢您的关注和支持。
我正在尝试使用 4G USB 调制解调器和 netplan 将 ubuntu 服务器 22.04 连接到 RaspberryPi 3B+ 上的互联网。
USB 适配器似乎已被识别:
carlo@pi-box:~$ lsusb
Bus 001 Device 008: ID 19d2:0016 ZTE WCDMA Technologies MSM ZTE Mobile Broadband
carlo@pi-box:~$ sudo dmesg | grep usb
[ 423.387073] usb 1-1.3: new high-speed USB device number 10 using dwc2
[ 423.497368] usb 1-1.3: New USB device found, idVendor=19d2, idProduct=0016, bcdDevice=54.24
[ 423.497428] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 423.497452] usb 1-1.3: Product: ZTE Mobile Broadband
[ 423.497474] usb 1-1.3: Manufacturer: ZTE,Incorporated
[ 423.500645] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB0
[ 423.502143] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB1
[ 423.503982] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB2
网络规划配置为:
network:
renderer: NetworkManager
ethernets:
eth0:
dhcp4: true
optional: true
usb0:
dhcp4: true
optional: true
modems:
ttyUSB2:
apn: mobile.vodafone.it
dhcp4: true
auto-config: true
version: 2
使用ifconfig -a
命令我找不到界面。
调制解调器管理器似乎识别了调制解调器:
carlo@pi-box:~$ mmcli -L
/org/freedesktop/ModemManager1/Modem/1 [ZTE CORPORATION] MF833V
carlo@pi-box:~$ mmcli -m 1
--------------------------------
General | path: /org/freedesktop/ModemManager1/Modem/1
| device id: c22dd449a679d1e0ad941d57c707e8fbabaf3ee4
--------------------------------
Hardware | manufacturer: ZTE CORPORATION
| model: MF833V
| firmware revision: BD_CNGENMF833VV1.0.0B08
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: 860493042386496
--------------------------------
System | device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3
| drivers: option
| plugin: zte
| primary port: ttyUSB2
| ports: ttyUSB0 (qcdm), ttyUSB1 (at), ttyUSB2 (at)
--------------------------------
Status | unlock retries: sim-pin (3), sim-puk (10)
| state: registered
| power state: on
| access tech: umts
| signal quality: 41% (recent)
--------------------------------
Modes | supported: allowed: 2g; preferred: none
| allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 2g, 3g, 4g; preferred: none
| current: allowed: any; preferred: none
--------------------------------
IP | supported: ipv4, ipv6, ipv4v6
--------------------------------
3GPP | imei: 860493042386496
| operator id: 22288
| operator name: 0046003 0046003
| registration: home
| packet service state: attached
--------------------------------
3GPP EPS | ue mode of operation: csps-1
--------------------------------
SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/1
网络管理器显示设备和连接:
carlo@pi-box:~$ nmcli
ttyUSB2: disconnected
"ZTE Mobile Broadband"
1 connection available
gsm (option), hw
carlo@pi-box:~$ nmcli c
NAME UUID TYPE DEVICE
netplan-ttyUSB2 5b6fbb52-0291-359e-aa68-b49f69ba9ff2 gsm --
如果我强制连接调制解调器,它似乎成功了:
carlo@pi-box:~$ sudo mmcli -m 1 --simple-connect="apn=apn.fastweb.it"
successfully connected the modem
carlo@pi-box:~$ mmcli -m 1
--------------------------------
General | path: /org/freedesktop/ModemManager1/Modem/1
| device id: c22dd449a679d1e0ad941d57c707e8fbabaf3ee4
--------------------------------
Hardware | manufacturer: ZTE CORPORATION
| model: MF833V
| firmware revision: BD_CNGENMF833VV1.0.0B08
| supported: gsm-umts, lte
| current: gsm-umts, lte
| equipment id: 860493042386496
--------------------------------
System | device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3
| drivers: option
| plugin: zte
| primary port: ttyUSB2
| ports: ttyUSB0 (qcdm), ttyUSB1 (at), ttyUSB2 (at)
--------------------------------
Status | unlock retries: sim-pin (3), sim-puk (10)
| state: connected
| power state: on
| access tech: umts
| signal quality: 38% (recent)
--------------------------------
Modes | supported: allowed: 2g; preferred: none
| allowed: 3g; preferred: none
| allowed: 4g; preferred: none
| allowed: 2g, 3g, 4g; preferred: none
| current: allowed: any; preferred: none
--------------------------------
IP | supported: ipv4, ipv6, ipv4v6
--------------------------------
3GPP | imei: 860493042386496
| operator id: 22288
| operator name: 0046003 0046003
| registration: home
| packet service state: attached
--------------------------------
3GPP EPS | ue mode of operation: csps-1
--------------------------------
SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/1
--------------------------------
Bearer | paths: /org/freedesktop/ModemManager1/Bearer/0
carlo@pi-box:~$ mmcli -b 0
---------------------------------
General | path: /org/freedesktop/ModemManager1/Bearer/0
| type: default
---------------------------------
Status | connected: yes
| suspended: no
| multiplexed: no
| interface: ttyUSB2
| ip timeout: 20
| profile id: 2
---------------------------------
Properties | apn: apn.fastweb.it
| roaming: allowed
---------------------------------
IPv4 configuration | method: ppp
| prefix: 0
---------------------------------
Statistics | start date: 2024-03-05T21:26:00Z
| attempts: 1
但用ifconfig -a
命令我还是找不到相关的接口。
如果我尝试连接,APN 上会发出错误信号:
carlo@pi-box:~$ sudo nmcli c up netplan-ttyUSB2
Error: Connection activation failed: Failed to select the specified APN
Hint: use 'journalctl -xe NM_CONNECTION=5b6fbb52-0291-359e-aa68-b49f69ba9ff2 + NM_DEVICE=ttyUSB2' to get more details.
连接属性为:
carlo@pi-box:~$ sudo nmcli c show netplan-ttyUSB2
connection.id: netplan-ttyUSB2
connection.uuid: 5b6fbb52-0291-359e-aa68-b49f69ba9ff2
connection.stable-id: --
connection.type: gsm
connection.interface-name: ttyUSB2
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.multi-connect: 0 (default)
connection.auth-retries: -1
connection.timestamp: 0
connection.read-only: no
connection.permissions: --
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: default
connection.mdns: -1 (default)
connection.llmnr: -1 (default)
connection.dns-over-tls: -1 (default)
connection.wait-device-timeout: -1
ipv4.method: auto
ipv4.dns: --
ipv4.dns-search: --
ipv4.dns-options: --
ipv4.dns-priority: 0
ipv4.addresses: --
ipv4.gateway: --
ipv4.routes: --
ipv4.route-metric: -1
ipv4.route-table: 0 (unspec)
ipv4.routing-rules: --
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-iaid: --
ipv4.dhcp-timeout: 0 (default)
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.dhcp-hostname-flags: 0x0 (none)
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.required-timeout: -1 (default)
ipv4.dad-timeout: -1 (default)
ipv4.dhcp-vendor-class-identifier: --
ipv4.dhcp-reject-servers: --
ipv6.method: ignore
ipv6.dns: --
ipv6.dns-search: --
ipv6.dns-options: --
ipv6.dns-priority: 0
ipv6.addresses: --
ipv6.gateway: --
ipv6.routes: --
ipv6.route-metric: -1
ipv6.route-table: 0 (unspec)
ipv6.routing-rules: --
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.required-timeout: -1 (default)
ipv6.ip6-privacy: -1 (unknown)
ipv6.addr-gen-mode: eui64
ipv6.ra-timeout: 0 (default)
ipv6.dhcp-duid: --
ipv6.dhcp-iaid: --
ipv6.dhcp-timeout: 0 (default)
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
ipv6.dhcp-hostname-flags: 0x0 (none)
ipv6.token: --
gsm.auto-config: yes
gsm.number: --
gsm.username: --
gsm.password: <hidden>
gsm.password-flags: 0 (none)
gsm.apn: --
gsm.network-id: --
gsm.pin: <hidden>
gsm.pin-flags: 0 (none)
gsm.home-only: no
gsm.device-id: --
gsm.sim-id: --
gsm.sim-operator-id: --
gsm.mtu: auto
proxy.method: none
proxy.browser-only: no
proxy.pac-url: --
proxy.pac-script: --
我究竟做错了什么?有人有此设置的经验吗?
在服务器上,运行 Ubuntu 22.04
sudo netstat -tnlp | grep :4000
tcp 0 0 0.0.0.0:4000 0.0.0.0:* LISTEN 10690/nxd
tcp6 0 0 :::4000 :::* LISTEN 10690/nxd
服务响应 HTTP 请求:
curl localhost:4000
curl: (52) Empty reply from server
ufw 已禁用
sudo ufw status
Status: inactive
从客户端(同一子网)计算机:
nc -zv 192.168.1.111 4000
nc: connect to 192.168.1.111 port 4000 (tcp) failed: No route to host
SSH 已启用
nc -zv 192.168.1.111 22
Connection to 192.168.1.111 22 port [tcp/ssh] succeeded!
平作品:
ping 192.168.1.111
PING 192.168.1.111 (192.168.1.111) 56(84) bytes of data.
64 bytes from 192.168.1.111: icmp_seq=1 ttl=64 time=309 ms