poloshiao 写了:
把下面指令 複製 貼進終端機 執行
2-1. sudo cat /etc/udev/rules.d/70-persistent-net.rules
2-2. sudo lspci -knn
2-3. sudo lshw -numeric -class network
2-4. sudo cat /etc/network/interfaces
2-5. sudo ifconfig -a
2-6. sudo cat /etc/udev/rules.d/80-net-name-slot.rules
把結果直接 選取/複製/貼上來
/etc/udev/rules.d/ 中只有README
==========================================================================================================
sudo lspci -knn
00:00.0 Host bridge [0600]: Intel Corporation 3rd Gen Core processor DRAM Controller [8086:0154] (rev 09)
Subsystem: Intel Corporation 3rd Gen Core processor DRAM Controller [8086:0154]
Kernel driver in use: ivb_uncore
00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09)
Subsystem: Intel Corporation Device [8086:2010]
Kernel driver in use: i915
00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)
Subsystem: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31]
Kernel driver in use: xhci_hcd
00:16.0 Communication controller [0780]: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 [8086:1e3a] (rev 04)
Subsystem: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 [8086:1e3a]
Kernel driver in use: mei_me
00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)
Subsystem: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d]
Kernel driver in use: ehci-pci
00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)
Subsystem: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20]
Kernel driver in use: snd_hda_intel
00:1c.0 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 [8086:1e10] (rev c4)
Kernel driver in use: pcieport
00:1c.1 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 [8086:1e12] (rev c4)
Kernel driver in use: pcieport
00:1c.2 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 [8086:1e14] (rev c4)
Kernel driver in use: pcieport
00:1c.3 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 [8086:1e16] (rev c4)
Kernel driver in use: pcieport
00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)
Subsystem: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:1e26]
Kernel driver in use: ehci-pci
00:1f.0 ISA bridge [0601]: Intel Corporation HM77 Express Chipset LPC Controller [8086:1e57] (rev 04)
Subsystem: Intel Corporation HM77 Express Chipset LPC Controller [8086:1e57]
Kernel driver in use: lpc_ich
00:1f.2 IDE interface [0101]: Intel Corporation 7 Series Chipset Family 4-port SATA Controller [IDE mode] [8086:1e01] (rev 04)
Subsystem: Intel Corporation 7 Series Chipset Family 4-port SATA Controller [IDE mode] [8086:1e01]
Kernel driver in use: ata_piix
00:1f.3 SMBus [0c05]: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller [8086:1e22] (rev 04)
Subsystem: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller [8086:1e22]
00:1f.5 IDE interface [0101]: Intel Corporation 7 Series Chipset Family 2-port SATA Controller [IDE mode] [8086:1e09] (rev 04)
Subsystem: Intel Corporation 7 Series Chipset Family 2-port SATA Controller [IDE mode] [8086:1e09]
Kernel driver in use: ata_piix
02:00.0 Non-VGA unclassified device [0000]: Techwell Inc. Device [1797:6864] (rev 01)
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 06)
Subsystem: Realtek Semiconductor Co., Ltd. Device [10ec:0123]
Kernel driver in use: r8169
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 06)
Subsystem: Realtek Semiconductor Co., Ltd. Device [10ec:0123]
Kernel driver in use: r8169
==========================================================================================================
sudo lshw -numeric -class net
*-network DISABLED
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10EC:8168]
vendor: Realtek Semiconductor Co., Ltd. [10EC]
physical id: 0
bus info: pci@0000:03:00.0
logical name: p2p1
version: 06
serial: 00:e0:4c:62:9a:df
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:25 ioport:e000(size=256) memory:f0104000-f0104fff memory:f0100000-f0103fff
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10EC:8168]
vendor: Realtek Semiconductor Co., Ltd. [10EC]
physical id: 0
bus info: pci@0000:04:00.0
logical name: p3p1
version: 06
serial: 00:e0:4c:62:9a:e0
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=192.168.1.129 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
resources: irq:26 ioport:d000(size=256) memory:f0004000-f0004fff memory:f0000000-f0003fff
==========================================================================================================
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.100.201
netmask 255.255.255.0
gateway 192.168.100.1
auto eth1
iface eth1 inet static
address 192.168.1.129
netmask 255.255.255.0
gateway 192.168.1.1
这里的interfaces是我写死的,我希望这个硬件出厂时的ip是固定的。就是因为这个需求,我才要希望每个设备初试的网卡名是一样的。
========================================================================================================
ifconfig -a
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:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1528 (1.5 KB) TX bytes:1528 (1.5 KB)
p2p1 Link encap:Ethernet HWaddr 00:e0:4c:62:9a:df
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)
p3p1 Link encap:Ethernet HWaddr 00:e0:4c:62:9a:e0
inet addr:192.168.1.129 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4cff:fe62:9ae0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2966 errors:0 dropped:6 overruns:0 frame:0
TX packets:240 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:239898 (239.8 KB) TX bytes:44811 (44.8 KB)