![如何在 arch 中永久设置网络接口(wifi/以太网)的名称](https://linux22.com/image/659/%E5%A6%82%E4%BD%95%E5%9C%A8%20arch%20%E4%B8%AD%E6%B0%B8%E4%B9%85%E8%AE%BE%E7%BD%AE%E7%BD%91%E7%BB%9C%E6%8E%A5%E5%8F%A3%EF%BC%88wifi%2F%E4%BB%A5%E5%A4%AA%E7%BD%91%EF%BC%89%E7%9A%84%E5%90%8D%E7%A7%B0.png)
似乎每次重新启动名称都会颠倒不同的网卡(wifi/以太网)......
答案1
使用udev
。在 Gentoo 和许多其他发行版中,它是自动完成的,但如果您想要快速的解决方案,您可能需要以此为基础:
# This file was automatically generated by the /lib64/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x10f5 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<MAC_ADDRESS>", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x4236 (iwlagn)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<MAC_ADDRESS>", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
您更改过任何udev
配置吗?