我有一个简单的Ubuntu测试床,我遇到了一个非常不寻常的问题。由于某种原因,似乎我的IP地址在没有用户任何干预的情况下在交错之间发生变化,我无法解释它。
下面是我得到的:一台带有Ubuntu18.10Server的机器(宇宙?)通过DHCP静态保留映射到IP 172.16.222.63的1GB接口和静态分配IP 172.16.222.64 (使用ifconfig)的10 1GB接口。此服务器为空白,仅在安装过程中选择OpenSSH。
它是附加到一个惠普Pro弧线2900-48G开关,这是工厂的默认。没有配置或正在运行的VLAN,所有开关端口都是默认的。1GB接口和10 1GB接口作为测试盒附加到此开关上。
从测试盒中,我开始在一个终端窗口中单击172.16.222.63 (1G),在另一个终端窗口中开始单击172.16.222.64 (10G)。只有1G接口响应。
如果我断开1G接口,10G接口就开始运行。如果我重新连接1G接口,10G接口将停止pinging。
我检查了iptable,没有规则,一切都设置为默认允许。Arp表显示了我的测试框的MAC和默认网关。
上周五,我在中询问了这个问题,尽管症状略有不同。当两个接口都被连接时,两个接口都会进行ping。如果1G接口断开,10G接口将保持可点击,但几分钟后,1G IP地址将开始响应10G接口!重新连接1G接口和断开10G接口将导致两个IP移动到1G接口。
在和我的同事讨论过之后,大家的普遍共识似乎是,网络计划正在引发问题。还有其他人看过这个吗?有什么办法可以解决这个问题,以便IP地址“待在”被分配到的接口上吗?
这样做的全部原因是我将在1G和10G接口上进行一些性能测试,并且我需要能够向这两个接口发送数据。有了它当前的状态,我无法保证通过IP地址将数据发送到正确的接口。
谢谢!
编辑:根据要求:
Netplan yaml文件:
root@ubuntu:~# cat /etc/netplan/*.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp5s0f0:
dhcp4: yeslshw输出
root@ubuntu:~# lshw -C network
*-network
description: Ethernet interface
product: MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s]
vendor: Mellanox Technologies
physical id: 0
bus info: pci@0000:03:00.0
logical name: enp3s0
version: b0
serial: 00:02:c9:56:1c:88
size: 10Gbit/s
capacity: 10Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm vpd msix pciexpress bus_master cap_list ethernet physical fibre 10000bt-fd
configuration: autonegotiation=off broadcast=yes driver=mlx4_en driverversion=4.0-0 duplex=full firmware=2.9.1000 ip=172.16.222.64 latency=0 link=yes multicast=yes port=fibre speed=10Gbit/s
resources: irq:16 memory:b9a00000-b9afffff memory:b8800000-b8ffffff
*-network DISABLED
description: Ethernet interface
product: MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s]
vendor: Mellanox Technologies
physical id: 0
bus info: pci@0000:04:00.0
logical name: enp4s0
version: b0
serial: 00:02:c9:54:00:a2
capacity: 10Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm vpd msix pciexpress bus_master cap_list ethernet physical fibre 10000bt-fd
configuration: autonegotiation=off broadcast=yes driver=mlx4_en driverversion=4.0-0 firmware=2.9.1000 latency=0 link=no multicast=yes port=fibre
resources: irq:17 memory:b9900000-b99fffff memory:b8000000-b87fffff
*-network:0
description: Ethernet interface
product: 80003ES2LAN Gigabit Ethernet Controller (Copper)
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:05:00.0
logical name: enp5s0f0
version: 01
serial: 00:15:17:45:f3:08
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=1.0-0 latency=0 link=no multicast=yes port=twisted pair
resources: irq:24 memory:b9820000-b983ffff memory:b9400000-b97fffff ioport:2020(size=32)
*-network:1 DISABLED
description: Ethernet interface
product: 80003ES2LAN Gigabit Ethernet Controller (Copper)
vendor: Intel Corporation
physical id: 0.1
bus info: pci@0000:05:00.1
logical name: enp5s0f1
version: 01
serial: 00:15:17:45:f3:09
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=1.0-0 latency=0 link=no multicast=yes port=twisted pair
resources: irq:25 memory:b9800000-b981ffff memory:b9000000-b93fffff ioport:2000(size=32)Ifconfig输出:
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.222.64 netmask 255.255.255.0 broadcast 172.16.222.255
inet6 fe80::202:c9ff:fe56:1c88 prefixlen 64 scopeid 0x20<link>
ether 00:02:c9:56:1c:88 txqueuelen 1000 (Ethernet)
RX packets 1446 bytes 134815 (134.8 KB)
RX errors 2 dropped 0 overruns 0 frame 2
TX packets 1169 bytes 121183 (121.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp5s0f0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet6 fe80::215:17ff:fe45:f308 prefixlen 64 scopeid 0x20<link>
ether 00:15:17:45:f3:08 txqueuelen 1000 (Ethernet)
RX packets 875 bytes 87240 (87.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 421 bytes 48304 (48.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 18 memory 0xb9820000-b9840000
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 3312 bytes 235824 (235.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3312 bytes 235824 (235.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0发布于 2019-03-19 19:04:39
尝试更像这个骨架.yaml文件..。确保没有制表符或额外的空格..。有些地址可能需要调整..。
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses: 172.16.222.64/24
gateway4: 172.16.222.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
enp4s0:
dhcp4: no
dhcp6: no
enp5s0f0:
addresses: 172.16.222.63/24
gateway4: 172.16.222.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
enp5s0f1:
dhcp4: no
dhcp6: nosudo netplan --debug generate #生成配置文件
sudo netplan apply #激活新配置
reboot #可能是可选的..。重新启动计算机
https://askubuntu.com/questions/1126694
复制相似问题