起動後に奇妙な動作が見えます。インターフェイスは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