부팅 후 이상한 동작이 보입니다. 인터페이스는 enp2s0, enp1s0으로 표시되고 모듈을 제거하고 다시 로드하면 eth0, eth1이 표시됩니다. 내 스크립트는 이름에 따라 다르므로 enp2s0, enp1s0을 다시 가져와야 합니다. 인터페이스 이름을 변경하는 데 도움을 주실 수 있나요?
부팅 후:
root@panther2:~# lsmod | grep r8169
r8169 81920 0
root@panther2:~# ifconfig
enp1s0 Link encap:Ethernet HWaddr 3C:E1:A1:3F:21:3F
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
enp2s0 Link encap:Ethernet HWaddr 3C:E1:A1:3F:F8:17
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::3ee1:a1ff:fe3f:f817/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:219 errors:0 dropped:0 overruns:0 frame:0
TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21142 (20.6 KiB) TX bytes:24150 (23.5 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:92 errors:0 dropped:0 overruns:0 frame:0
TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4692 (4.5 KiB) TX bytes:4692 (4.5 KiB)
모듈 제거/로드: rmmod r8169; modprobe r8169
root@panther2:~# ifconfig
eth0 Link encap:Ethernet HWaddr 3C:E1:A1:3F:21:3F
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth1 Link encap:Ethernet HWaddr 3C:E1:A1:3F:F8:17
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::3ee1:a1ff:fe3f:f817/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:145 errors:0 dropped:0 overruns:0 frame:0
TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15675 (15.3 KiB) TX bytes:13552 (13.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:144 errors:0 dropped:0 overruns:0 frame:0
TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7344 (7.1 KiB) TX bytes:7344 (7.1 KiB)
답변1
ip link set eth0 down
ip link set eth0 name enp1s0
ip link set enp1s0 up
ip link set eth1 down
ip link set eth1 name enp2s0
ip link set enp2s0 up