I probably know the cause and the problem, but I can’t solve it. The original network interface device name is enp3s0
, and there is a setting of networking.interfaces.enp3s0.useDHCP = true
at the same time. But after replacing the mainboard, this device cannot be seen in ifconfig
, and there is an additional device called enp5s0
. Even if I manually set the ip/netmask/broadcast of this network interface, the Internet still cannot be accessed, but the internal network is available (for example, to access the router). I can’t find out the problem further, it has kept me out of work for several hours.
Note that because there is no network, I cannot successfully execute the sudo nixos-rebuild switch
command after modifying configuration.nix
.
This is what it looks like after I manually up and set the new enp5s0
interface:
➜ ~ ifconfig
enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.108 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::3e7c:3fff:febb:4b6b prefixlen 64 scopeid 0x20<link>
ether 3c:7c:3f:bb:4b:6b txqueuelen 1000 (Ethernet)
RX packets 25165 bytes 5386454 (5.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 25369 bytes 2814915 (2.6 MiB)
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 1000 (Local Loopback)
RX packets 100605 bytes 8992674 (8.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 100605 bytes 8992674 (8.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
➜ ~
Due to the absence of the previous network interface, several related services failed during systemd startup, resulting in an increase in the overall system startup time.
If replacing the motherboard (or network interface card device) may cause such a result, shouldn’t the network interface name be written in configuration.nix
?