Ubuntu 20.04 LTS 无法访问,尽管它已连接到网络

Ubuntu 20.04 LTS 无法访问,尽管它已连接到网络

请原谅我的问题,我在一台旧笔记本电脑上安装了 Ubuntu Server 20.04 LTS,将其用作家庭服务器进行测试和其他学习。它运行良好,只是几天前开始出现故障,虽然我可以在路由器配置上看到它已连接,并且我可以从路由器 ping 它,但是,当我尝试从我的电脑 ping 它时,它没有响应。这种情况偶尔会发生,过一段时间它就会恢复在线。

一些可能有助于提供支持的信息。

从路由器 Ping 操作:

no source interface or ip specified, using default route
PING 192.168.1.24 (192.168.1.24): 64 data bytes
72 bytes from 192.168.1.24: seq=0 ttl=64 time=5.636 ms
72 bytes from 192.168.1.24: seq=1 ttl=64 time=4.070 ms
72 bytes from 192.168.1.24: seq=2 ttl=64 time=10.023 ms
72 bytes from 192.168.1.24: seq=3 ttl=64 time=4.129 ms

--- 192.168.1.24 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 4.070/5.964/10.023 ms

从 PC 执行 ping 操作:

PING 192.168.1.24 (192.168.1.24): 56 data bytes
Request timeout for icmp_seq 0
ping: sendto: No route to host
Request timeout for icmp_seq 1
ping: sendto: Host is down
Request timeout for icmp_seq 2
ping: sendto: Host is down
Request timeout for icmp_seq 3
ping: sendto: Host is down
Request timeout for icmp_seq 4
ping: sendto: Host is down
Request timeout for icmp_seq 5
ping: sendto: Host is down
Request timeout for icmp_seq 6
^C
--- 192.168.1.24 ping statistics ---
8 packets transmitted, 0 packets received, 100.0% packet loss

=======================================================

猫/etc/netplan/*.yaml

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp0s25:
      dhcp4: true
  version: 2
  wifis:
        wlo1:
            optional: true
            access-points:
                "SSIDName":
                    password: "password"
            dhcp4: true

sudo lshw -C 网络

  *-network                 
       description: Ethernet interface
       product: 82577LM Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 19
       bus info: pci@0000:00:19.0
       logical name: enp0s25
       version: 05
       serial: 68:b5:99:f9:b9:87
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.12-3 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:29 memory:d7400000-d741ffff memory:d742a000-d742afff ioport:6020(size=32)
  *-network
       description: Wireless interface
       product: Centrino Advanced-N 6200
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:44:00.0
       logical name: wlo1
       version: 35
       serial: 58:94:6b:b1:46:f0
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=5.4.0-31-generic firmware=9.221.4.1 build 25532 ip=192.168.1.24 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:33 memory:d3200000-d3201fff

ping -c 5 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=53 time=53.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=53 time=51.9 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=53 time=54.5 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=53 time=52.9 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=53 time=54.8 ms

--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 51.944/53.608/54.825/1.057 ms

主机 www.ebay.com

www.ebay.com is an alias for slot9428.ebay.com.edgekey.net.
slot9428.ebay.com.edgekey.net is an alias for e9428.b.akamaiedge.net.
e9428.b.akamaiedge.net has address 23.34.85.161

猫/等/网络/接口

auto wlo1
iface wlo1 inet dhcp
wpa-conf /etc/wpa_supplicant.conf

network={
        ssid="SSIDName"
        psk="password"
        scan_ssid=1

}

答案1

您同时使用 NetworkManager 和 networkd 配置。

尝试这个:

将您的设置/etc/network/interfaces为此...

auto lo
iface lo inet loopback

将您的设置/etc/netplan/*.yaml为此...保持间距,缩进,并且无制表符,完全相同......

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s25:
      dhcp4: true
      optional: true
  wifis:
    wlo1:
      dhcp4: true
      access-points:
        "SSIDName":
          password: "password"
          band: 2.4GHz
          channel: 6

然后做...

sudo netplan --debug generate

sudo netplan apply

reboot

相关内容