用户:Mattx86/qwn:重命名网络接口

来自 Alpine Linux

假设我有一个名为 eth3 的接口,我想将其重命名为 neweth3

首先指定

auto neweth3 iface neweth3 inet static

接着是 addressnetmaskgateway 等,然后添加这行

pre-up nameif -s neweth3 00:11:22:33:44:55

这会将接口名称设置为 neweth3,其中接口的 MAC 地址为 00:11:22:33:44:55

这是一个完整的例子

auto neweth3 iface neweth3 inet static address 10.100.100.1 netmask 255.255.255.0 network 10.100.100.0 broadcast 10.100.100.255 pre-up nameif -s neweth3 00:11:22:33:44:55