连接:网络不可访问/无路由

连接:网络不可访问/无路由

我已经安装了 CentOS 7 并向其中添加了 i3wm。

在 KDE Plasma 中,互联网通过 Wi-Fi 运行良好。

然而在 i3 中ifconfig看起来像这样:

enp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
    ether XX:XX:XX:XX:XX  txqueuelen 1000  (Ethernet)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 44  bytes 4968 (4.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 44  bytes 4968 (4.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp2s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether XX:XX:XX:XX:XX txqueuelen 1000  (Ethernet)
        RX packets 4906  bytes 3196764 (3.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3781  bytes 617329 (602.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

登录 i3 时没有发生什么事情。

编辑:根据 Andreas Rogge 的建议,我查看了 NetworkManager 的service NetworkManager status输出

NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2017-07-11 15:17:34 CEST; 20h ago
     Docs: man:NetworkManager(8)
 Main PID: 845 (NetworkManager)
   CGroup: /system.slice/NetworkManager.service
           └─845 /usr/sbin/NetworkManager --no-daemon

Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <info>  [1499854149.2106] device (wlp2s0): state change: config -> need-auth (reason 'none') [50 60 0]
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <warn>  [1499854149.2133] device (wlp2s0): No agents were available for this request.
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <info>  [1499854149.2133] device (wlp2s0): state change: need-auth -> failed (reason 'no-secrets') [60 120 7]
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <info>  [1499854149.2135] manager: NetworkManager state is now DISCONNECTED
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <warn>  [1499854149.2138] device (wlp2s0): Activation: failed for connection 'xxx-wlan'
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <info>  [1499854149.2142] device (wlp2s0): state change: failed -> disconnected (reason 'none') [120 30 0]
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <info>  [1499854149.2226] device (wlp2s0): set-hw-addr: set MAC address to 9A:18:23:6A:34:7E (scanning)
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <warn>  [1499854149.3080] firewall: [0x7f8b88fe7e90,remove:"wlp2s0"]: complete: request failed (UNKNOWN_INTERFACE: 'wlp2s0' is not in any zone)
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <info>  [1499854149.3080] device (wlp2s0): supplicant interface state: disconnected -> disabled
Jul 12 12:09:09 localhost.localdomain NetworkManager[845]: <info>  [1499854149.3283] device (wlp2s0): supplicant interface state: disabled -> disconnected

答案1

我猜你缺少 NetworkManager。通常(至少在 Gnome 中)有一个 NetworkManager 小程序和一个与 NetworkManager 相关的用户实例,它们会从你的密钥环中提取 WiFi 的身份验证密钥并建立 Wifi 连接。

我猜 i3 没有那个组件,所以你需要通过其他方式启动你的 Wifi。

答案2

寻找安装指南

注意它有Setup network部分关联

此链接解释了如何查看你的计算机是否已断开连接

nmcli d

然后输入 gui

nmtui

以 root 身份设置 wifi 密码并为所有用户激活。

网络脚本可以在以下位置找到

/etc/sysconfig/network-scripts/ifcfg-...

我想nmtui会添加MODE=Managed

相关内容