我的服务器上有数据接口:eno5、eno6、ens3f0 和 ens3f1。我需要使用 VLAN ID 101 和绑定名称 data0 的这四个接口创建端口绑定。
更多信息:
- RHEL 7.6
- 检查接口名称。(我已经拔掉了电缆,一个接口坏了)
- 我很可能会为此设置使用模式 4。(不是网络人..)
- UUID 已经在配置文件中。我什么都没改变。
编辑:更多信息:
- 没有虚拟化。我们在这里谈论的是物理机器。
- 交换机配置已全部设置。
- 这是一个全新的、最小化的安装。是否有任何必要的软件包、内核模块或系统配置?
第一次尝试:在这个 RHEL 文档中做了所有的事情:https ://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-configuring_a_vlan_over_a_bond
除了这个文件有两个接口,但我有四个。我用自己的值更改了接口和键名。而且当然; IP、网关和子网也是我自己的。
结果: systemctl restart network 没问题。但是接口甚至不能ping它自己的网关......
关于这个尝试:
- 模式选择在文档上完全相同
第二次尝试:完全完成了本文档中的所有内容:http: //villasyslog.net/rhel-bonding-and-vlan-tagging/
再一次,我有四个接口,所以改变了值。
结果: systemctl restart network 失败。我的债券没有得到 IPv4 地址。相反,它显示了我的一些愚蠢的 IPv6 东西。
关于这个尝试:
- 没有 /etc/modprobe.d/bonding.conf 文件。
第一次尝试时,我在 /etc/sysconfig/network-scripts/ifcfg-* 下有四个接口的文件和一个绑定配置文件(总共 5 个)。
第二份文件建议更多文件。四个接口,一个用于绑定,一个用于 VLAN 标记。不幸的是,我没有第一个配置文件,但我有第二个。他们来了:
ifcfg-数据0
DEVICE=data0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
BONDING_MODULE_OPTS="mode=4 miimon=100"
BONDING_SLAVE0=ens3f1
BONDING_SLAVE1=ens3f0
BONDING_SLAVE2=eno6
BONDING_SLAVE3=eno5
VLAN=yes
IPV6INIT=no
ifcfg-data0.101
DEVICE=data0.101
BOOTPROTO=none
ONBOOT=yes
IPADDR=host IP
NETMASK=netmask
GATEWAY=gateway
NETWORK=first IP of network
BROADCAST=broadcast IP
USERCTL=no
BONDING_MODULE_OPTS="mode=4 miimon=100"
BONDING_SLAVE0="ens3f1"
BONDING_SLAVE1="ens3f0"
BONDING_SLAVE2="eno6"
BONDING_SLAVE3="eno5"
VLAN=yes
IPV6INIT=no
其他四个接口:
TYPE=Ethernet
BOOTPROTO=none
UUID=device uuid
DEVICE=eno5
ONBOOT=yes
MASTER=data0
SLAVE=yes
NM_CONTROLLED=no
TYPE=Ethernet
BOOTPROTO=none
UUID=device uuid
DEVICE=eno6
ONBOOT=yes
MASTER=data0
SLAVE=yes
NM_CONTROLLED=no
TYPE=Ethernet
BOOTPROTO=none
UUID=device uuid
DEVICE=ens3f0
ONBOOT=yes
MASTER=data0
SLAVE=yes
NM_CONTROLLED=no
TYPE=Ethernet
BOOTPROTO=none
UUID=device uuid
DEVICE=ens3f1
ONBOOT=yes
MASTER=data0
SLAVE=yes
NM_CONTROLLED=no
/proc/net/绑定请求:
我在 /proc/net/bonding 下看到两个文件。其中之一是bond0,我不知道那是什么:
债券0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: load balancing (round-robin)
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
数据
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: ens3f1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: (MAC is here)
Slave queue ID: 0
Slave Interface: ens3f0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: (MAC is here)
Slave queue ID: 0
Slave Interface: eno6
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: (MAC is here)
Slave queue ID: 0
Slave Interface: eno5
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: (MAC is here)
Slave queue ID: 0
systemctl 重启网络:
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
systemctl 状态网络:
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-02-28 13:48:49 +03; 32s ago
Docs: man:systemd-sysv-generator(8)
Process: 37887 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
Feb 28 13:48:49 (host name here) network[37887]: RTNETLINK answers: File exists
Feb 28 13:48:49 (host name here) network[37887]: RTNETLINK answers: File exists
Feb 28 13:48:49 (host name here) network[37887]: RTNETLINK answers: File exists
Feb 28 13:48:49 (host name here) network[37887]: RTNETLINK answers: File exists
Feb 28 13:48:49 (host name here) network[37887]: RTNETLINK answers: File exists
Feb 28 13:48:49 (host name here) network[37887]: RTNETLINK answers: File exists
Feb 28 13:48:49 (host name here) systemd[1]: network.service: control process exited, code=exited status=1
Feb 28 13:48:49 (host name here) systemd[1]: Failed to start LSB: Bring up/down networking.
Feb 28 13:48:49 (host name here) systemd[1]: Unit network.service entered failed state.
Feb 28 13:48:49 (host name here) systemd[1]: network.service failed.
起初,NetworkManager 正在运行。我已禁用它,但 systemctl restart network 仍然失败。systemctl status NetworkManager 的输出:
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2020-02-28 13:46:58 +03; 2min 13s ago
Docs: man:NetworkManager(8)
Main PID: 35612 (code=exited, status=0/SUCCESS)
Feb 27 16:26:51 (host name here) NetworkManager[35612]: <info> [1582810011.3824] agent-manager: req[0x56187f15d3c0, :1.936/nmcli-connect/0]: agent registered
Feb 27 16:26:51 (host name here) NetworkManager[35612]: <info> [1582810011.3830] audit: op="connection-activate" uuid="09bce14a-449a-3065-8d1b-d4bcde243bd8" name="Vlan data0.744" result="fail" reason="Failed to find a compatible device for this connection"
Feb 28 13:46:58 (host name here) systemd[1]: Stopping Network Manager...
Feb 28 13:46:58 (host name here) NetworkManager[35612]: <info> [1582886818.8800] caught SIGTERM, shutting down normally.
Feb 28 13:46:58 (host name here) NetworkManager[35612]: <info> [1582886818.8846] device (ens3f0): released from master device data.744
Feb 28 13:46:58 (host name here) NetworkManager[35612]: <info> [1582886818.8851] device (ens3f1): released from master device data.744
Feb 28 13:46:58 (host name here) NetworkManager[35612]: <info> [1582886818.8856] device (eno5): released from master device data.744
Feb 28 13:46:58 (host name here) NetworkManager[35612]: <info> [1582886818.8860] device (eno6): released from master device data.744
Feb 28 13:46:58 (host name here) NetworkManager[35612]: <info> [1582886818.8890] exiting (success)
Feb 28 13:46:58 (host name here) systemd[1]: Stopped Network Manager.