ifconfig 和 ip link show 显示不同的接口

ifconfig 和 ip link show 显示不同的接口

eno2我在 Debian Stretch 上错误地配置了一个接口,现在我将其删除了/etc/network/interfaces,现在是这样:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eno1
iface eno1 inet dhcp

# IPv6 interface
iface eno1 inet6 static
    address ****:****:****::1
    netmask 48

因此,该ifconfig命令显示这些接口:

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:63:12:47:a0  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet ***.***.***.***  netmask 255.255.255.0  broadcast ***.***.***.***
        inet6 ****:****:****::*  prefixlen 48  scopeid 0x0<global>
        inet6 fe80::ec4:7aff:fe0e:c7ee  prefixlen 64  scopeid 0x20<link>
        ether **:**:**:**:**:**  txqueuelen 1000  (Ethernet)
        RX packets 1430101  bytes 213249567 (203.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3066573  bytes 4160098195 (3.8 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xdf120000-df13ffff  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 950165  bytes 317274829 (302.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 950165  bytes 317274829 (302.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

但是如果它不再存在,也会ip link show显示界面:eno2

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether **:**:**:**:**:** brd ff:ff:ff:ff:ff:ff
3: eno2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether **:**:**:**:**:** brd ff:ff:ff:ff:ff:ff
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether **:**:**:**:**:** brd ff:ff:ff:ff:ff:ff

我尝试使用删除未配置的接口ip link delete eno2,但它返回错误RTNETLINK answers: Operation not supported

我怎样才能eno2从中删除接口ip link show


更新:ispconfig -a命令实际上显示了 eno2 接口,但是这个网卡在系统中物理上并不存在,这就是我想要删除它的原因。


更新2:命令输出lspci

00:00.0 Host bridge: Intel Corporation Atom processor C2000 SoC Transaction Router (rev 02)
    Flags: bus master, fast devsel, latency 0

00:01.0 PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 1 (rev 02) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 24
    Memory at df180000 (64-bit, non-prefetchable) [size=128K]
    Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
    Capabilities: [40] Express Root Port (Slot+), MSI 00
    Capabilities: [80] Power Management version 3
    Capabilities: [88] Subsystem: Super Micro Computer Inc Atom processor C2000 PCIe Root Port 1
    Capabilities: [90] MSI: Enable+ Count=1/1 Maskable+ 64bit-
    Capabilities: [100] Advanced Error Reporting
    Kernel driver in use: pcieport
    Kernel modules: shpchp

00:02.0 PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 2 (rev 02) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 25
    Memory at df160000 (64-bit, non-prefetchable) [size=128K]
    Bus: primary=00, secondary=02, subordinate=03, sec-latency=0
    I/O behind bridge: 0000d000-0000dfff
    Memory behind bridge: de000000-df0fffff
    Capabilities: [40] Express Root Port (Slot+), MSI 00
    Capabilities: [80] Power Management version 3
    Capabilities: [88] Subsystem: Super Micro Computer Inc Atom processor C2000 PCIe Root Port 2
    Capabilities: [90] MSI: Enable+ Count=1/1 Maskable+ 64bit-
    Capabilities: [100] Advanced Error Reporting
    Kernel driver in use: pcieport
    Kernel modules: shpchp

00:03.0 PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 3 (rev 02) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0, IRQ 26
    Memory at df140000 (64-bit, non-prefetchable) [size=128K]
    Bus: primary=00, secondary=04, subordinate=04, sec-latency=0
    Capabilities: [40] Express Root Port (Slot+), MSI 00
    Capabilities: [80] Power Management version 3
    Capabilities: [88] Subsystem: Super Micro Computer Inc Atom processor C2000 PCIe Root Port 3
    Capabilities: [90] MSI: Enable+ Count=1/1 Maskable+ 64bit-
    Capabilities: [100] Advanced Error Reporting
    Kernel driver in use: pcieport
    Kernel modules: shpchp

00:0e.0 Host bridge: Intel Corporation Atom processor C2000 RAS (rev 02)
    Subsystem: Super Micro Computer Inc Atom processor C2000 RAS
    Flags: fast devsel
    Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00

00:0f.0 IOMMU: Intel Corporation Atom processor C2000 RCEC (rev 02)
    Subsystem: Super Micro Computer Inc Atom processor C2000 RCEC
    Flags: bus master, fast devsel, latency 0, IRQ 11
    Capabilities: [40] Express Root Complex Event Collector, MSI 00
    Capabilities: [80] Power Management version 3
    Capabilities: [90] MSI: Enable- Count=1/1 Maskable+ 64bit-
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [150] Root Complex Event Collector <?>

00:13.0 System peripheral: Intel Corporation Atom processor C2000 SMBus 2.0 (rev 02)
    Subsystem: Super Micro Computer Inc Atom processor C2000 SMBus 2.0
    Flags: bus master, fast devsel, latency 0, IRQ 27
    Memory at df1ab000 (64-bit, non-prefetchable) [size=1K]
    Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00
    Capabilities: [80] Power Management version 3
    Capabilities: [8c] MSI: Enable+ Count=1/1 Maskable+ 64bit+
    Capabilities: [100] Advanced Error Reporting
    Kernel driver in use: ismt_smbus
    Kernel modules: i2c_ismt

00:14.0 Ethernet controller: Intel Corporation Ethernet Connection I354 (rev 03)
    Subsystem: Super Micro Computer Inc Ethernet Connection I354
    Flags: bus master, fast devsel, latency 0, IRQ 20
    Memory at df120000 (64-bit, non-prefetchable) [size=128K]
    I/O ports at e060 [size=32]
    Memory at df1a4000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [40] Power Management version 3
    Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+
    Capabilities: [70] MSI-X: Enable+ Count=10 Masked-
    Capabilities: [a0] Express Root Complex Integrated Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [140] Device Serial Number 0c-c4-7a-ff-ff-0e-c7-ee
    Capabilities: [1a0] Transaction Processing Hints
    Capabilities: [1d0] Access Control Services
    Kernel driver in use: igb
    Kernel modules: igb

00:14.1 Ethernet controller: Intel Corporation Ethernet Connection I354 (rev 03)
    Subsystem: Super Micro Computer Inc Ethernet Connection I354
    Flags: bus master, fast devsel, latency 0, IRQ 21
    Memory at df100000 (64-bit, non-prefetchable) [size=128K]
    I/O ports at e040 [size=32]
    Memory at df1a0000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [40] Power Management version 3
    Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+
    Capabilities: [70] MSI-X: Enable+ Count=10 Masked-
    Capabilities: [a0] Express Root Complex Integrated Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [140] Device Serial Number 0c-c4-7a-ff-ff-0e-c7-ee
    Capabilities: [1a0] Transaction Processing Hints
    Capabilities: [1d0] Access Control Services
    Kernel driver in use: igb
    Kernel modules: igb

00:16.0 USB controller: Intel Corporation Atom processor C2000 USB Enhanced Host Controller (rev 02) (prog-if 20 [EHCI])
    Subsystem: Super Micro Computer Inc Atom processor C2000 USB Enhanced Host Controller
    Flags: bus master, medium devsel, latency 0, IRQ 23
    Memory at df1aa000 (32-bit, non-prefetchable) [size=1K]
    Capabilities: [50] Power Management version 3
    Capabilities: [58] Debug port: BAR=1 offset=00a0
    Capabilities: [98] PCI Advanced Features
    Kernel driver in use: ehci-pci
    Kernel modules: ehci_pci

00:18.0 SATA controller: Intel Corporation Atom processor C2000 AHCI SATA3 Controller (rev 02) (prog-if 01 [AHCI 1.0])
    Subsystem: Super Micro Computer Inc Atom processor C2000 AHCI SATA3 Controller
    Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 28
    I/O ports at e0b0 [size=8]
    I/O ports at e0a0 [size=4]
    I/O ports at e090 [size=8]
    I/O ports at e080 [size=4]
    I/O ports at e020 [size=32]
    Memory at df1a9000 (32-bit, non-prefetchable) [size=2K]
    Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
    Capabilities: [70] Power Management version 3
    Capabilities: [a8] SATA HBA v1.0
    Kernel driver in use: ahci
    Kernel modules: ahci

00:1f.0 ISA bridge: Intel Corporation Atom processor C2000 PCU (rev 02)
    Subsystem: Super Micro Computer Inc Atom processor C2000 PCU
    Flags: bus master, medium devsel, latency 0
    Capabilities: [e0] Vendor Specific Information: Len=0c <?>
    Kernel driver in use: lpc_ich
    Kernel modules: lpc_ich

00:1f.3 SMBus: Intel Corporation Atom processor C2000 PCU SMBus (rev 02)
    Subsystem: Super Micro Computer Inc Atom processor C2000 PCU SMBus
    Flags: medium devsel, IRQ 18
    Memory at df1a8000 (32-bit, non-prefetchable) [size=32]
    I/O ports at e000 [size=32]
    Kernel driver in use: i801_smbus
    Kernel modules: i2c_i801

02:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge (rev 03) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=02, secondary=03, subordinate=03, sec-latency=32
    I/O behind bridge: 0000d000-0000dfff
    Memory behind bridge: de000000-df0fffff
    Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [78] Power Management version 3
    Capabilities: [80] Express PCI-Express to PCI/PCI-X Bridge, MSI 00
    Capabilities: [a4] Subsystem: Super Micro Computer Inc AST1150 PCI-to-PCI Bridge
    Capabilities: [100] Virtual Channel
    Kernel modules: shpchp

03:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 30) (prog-if 00 [VGA controller])
    Subsystem: Super Micro Computer Inc ASPEED Graphics Family
    Flags: bus master, medium devsel, latency 0, IRQ 17
    Memory at de000000 (32-bit, non-prefetchable) [size=16M]
    Memory at df000000 (32-bit, non-prefetchable) [size=128K]
    I/O ports at d000 [size=128]
    [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
    Capabilities: [40] Power Management version 3
    Capabilities: [50] MSI: Enable- Count=1/4 Maskable- 64bit+
    Kernel driver in use: ast
    Kernel modules: ast

答案1

你搞错了:硬件网络接口不是定义在 中/etc/network/interfaces。它们被内核检测到,然后可用。如果您没有将它们放入 中/etc/network/interfaces,它们将保持未使用状态并处于“关闭”状态。

ifconfig默认情况下,将仅显示处于“启动”状态的接口。如果要查看所有接口,请使用ifconfig -a。然后您将看到eno2,它当前处于关闭状态。

要删除eno2,您需要从系统中物理删除它。

您的专用服务器配有双端口 NIC。这在 中很明显lspci。由于它是双端口 NIC,因此您无法移除第二个端口。

“Avoton”(C2000)系列的所有 Atom 处理器都至少有 2 个内置以太网 MAC。

相关内容