Arch Linux - 连接:网络无法访问

Nov*_*ode 29 networking arch-linux

在五次不成功的 Arch Linux 安装之后,我已经正确安装了两次。第一次,网络运行良好,我什至通过 SSH 安装 Arch Linux。

从安装的系统而不是 live CD 启动后,它无法连接到网络,当我尝试 ping 任何东西时,甚至我的路由器,我都会收到以下消息:

连接:网络不可达

我再次尝试安装 Arch,因为 Internet 上的任何内容似乎都无法解决我的问题。安装后,我遇到了同样的问题。

似乎它无法启动 eth0,因为它超时了。

Nov*_*ode 28

我面临的问题是没有eth0(据我所知)。运行命令ip link,这应该输出您的接口。我没有eth0接口。相反,我有enp1s8.

因为我使用的是静态的,所以我用cd /etc/netctlthen复制了示例配置文件cp examples/ethernet-static my-network。在那之后,我编辑my-networknano my-network,并从改变了接口eth0,以en1s8(或任何你的适配器是ip link)。最后,我启用它在启动时使用该配置文件netctl enable my-network

启用配置文件将确保它在启动时启动,但无需重新启动系统,只需运行netctl start my-network即可立即对其进行初始化。

我能够在官方 Arch Linux 论坛上获得帮助,您可以在那里查看我的主题。


小智 7

Archlinux says, try dhcpcd in case your installer can't connect automatically. This worked on the spot for me AFTER installation. Just type "dhcpcd" as a command, wait a few seconds, and then "ip route" or "ping 8.8.8.8" to check if it works. I even used "watch ip address" to see how fast these inet and inet6 addresses pop up.

Instead of using dhcpcd, I can also connect from zero with:

modprobe e1000e

ip link set dev eth0 up
ip address add 192.168.0.16/24 dev eth0
ip route add 192.168.0.0/24 dev eth0
ip route add default via 192.168.0.1
Run Code Online (Sandbox Code Playgroud)

e1000e is a "Network Driver", says modinfo. By loading this module I get a eth0 link (no, don't look for it in /dev). The "ip" commands activate the link, choose an address and define a local (subnet) and then a default gateway. It took me quite some time to test this out (ip link help, ip address help, ip route help...).

So this is instructive, but "dhcpcd" is faster to type, and probably more robust. And you can stop it cleanly with "dhcpcd -x".

With a working ping and the mirrorlist in /etc/pacman.d/ you have all you need for pacman or pacstrap.

And yes, I saw a kernel message renaming eth0 to enoxxx, so you have to check first with "ip link" what interfaces are already set up by systemd. It happens here:

[    3.052354] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) 94:c6:91:a5:39:b8
[    3.052360] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection
[    3.052445] e1000e 0000:00:1f.6 eth0: MAC: 13, PHY: 12, PBA No: FFFFFF-0FF
[    3.055917] e1000e 0000:00:1f.6 eno1: renamed from eth0
Run Code Online (Sandbox Code Playgroud)

The .16 in my address is just any (free) number, and 192.168.0.1 should always be the gateway. Maybe I was lucky, but it is good news that you can hack around under systemd and inet6. I will try netctl, though.

And right now I have booted with systemd and have dhcpcd started. I got address .15 on "eno1" and three inet6 addresses, but apart from that the result is quite the same as with above "ip"-hack.

3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 94:c6:91:a5:39:b8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.15/24 brd 192.168.0.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 2a05:41c0:12:bf00::2/128 scope global dynamic noprefixroute 
       valid_lft 2559430sec preferred_lft 572230sec
    inet6 2a05:41c0:12:bf00:f51e:97c1:de6f:6f49/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 2591994sec preferred_lft 604794sec
    inet6 fe80::47cf:a2e4:af0b:b7cd/64 scope link 
       valid_lft forever preferred_lft forever 


 default via 192.168.0.1 dev eno1 proto dhcp src 192.168.0.15 metric 203 
 192.168.0.0/24 dev eno1 proto dhcp scope link src 192.168.0.15 metric 203 
Run Code Online (Sandbox Code Playgroud)


Dav*_*man 5

网络不可达意味着您没有到网络的路由。如果您甚至无法 ping 本地路由器,要么您没有 IP 地址,要么您的网络接口已关闭。

netctl是 Arch 中管理网络接口的标准工具。如果您还没有设置(或其他东西),您将没有任何网络。甚至没有DHCP。