永久清理 CentOS 中的网络接口

永久清理 CentOS 中的网络接口

我有一台运行 CentOS 的虚拟机,它只连接了一个虚拟适配器。

在此输入图像描述

但是,如果您查看详细信息,您会看到以下内容:

在此输入图像描述

我只想要/需要 10.1.xx 地址。其他人从哪里来?它们可以安全地移除吗? 如果是这样,怎么办?

这是一个 ifconfig:

br-0804aae03e53: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.19.0.1  netmask 255.255.0.0  broadcast 172.19.255.255
        inet6 fe80::42:b6ff:fe4e:a3b1  prefixlen 64  scopeid 0x20<link>
        ether 02:42:b6:4e:a3:b1  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 16  bytes 1312 (1.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:10ff:fec8:4c88  prefixlen 64  scopeid 0x20<link>
        ether 02:42:10:c8:4c:88  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 656 (656.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.1.1.112  netmask 255.255.0.0  broadcast 10.1.255.255
        inet6 fe80::7a35:f4e4:8726:909a  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:65:8d:af  txqueuelen 1000  (Ethernet)
        RX packets 32094  bytes 2243477 (2.1 MiB)
        RX errors 0  dropped 245  overruns 0  frame 0
        TX packets 493  bytes 79107 (77.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  memory 0xfd3a0000-fd3c0000

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 498  bytes 41767 (40.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 498  bytes 41767 (40.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth117d12a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::24bd:2fff:feac:fd9d  prefixlen 64  scopeid 0x20<link>
        ether 26:bd:2f:ac:fd:9d  txqueuelen 0  (Ethernet)
        RX packets 54  bytes 3996 (3.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 22  bytes 1472 (1.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth514d3ac: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::2431:c2ff:fea2:b8df  prefixlen 64  scopeid 0x20<link>
        ether 26:31:c2:a2:b8:df  txqueuelen 0  (Ethernet)
        RX packets 120  bytes 13715 (13.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 112  bytes 15542 (15.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth869d99f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::8c54:eeff:fe2a:c8dd  prefixlen 64  scopeid 0x20<link>
        ether 8e:54:ee:2a:c8:dd  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 16  bytes 1312 (1.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethebc687e: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::f413:feff:fe5f:4f1  prefixlen 64  scopeid 0x20<link>
        ether f6:13:fe:5f:04:f1  txqueuelen 0  (Ethernet)
        RX packets 79  bytes 12873 (12.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 112  bytes 12937 (12.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:76:7e:39  txqueuelen 1000  (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

答案1

其他 IP 地址对应于虚拟机内部的网桥,大概是为虚拟机内部的容器和其他虚拟机提供网络连接。要“删除”这些 IP 地址,您必须删除相应的网桥,但如果有虚拟机内有用的容器和虚拟机,并且您需要访问它们,但您不应该这样做。

或者,您也可以尝试将所有虚拟机内部网络重新配置为专用,IE不要使用连接到 NIC 的网桥,并对需要退出 VM 的所有内容使用 NAT。

相关内容