CentOS 7 组队桥接网络仅适用于单个 NIC

CentOS 7 组队桥接网络仅适用于单个 NIC

几天来我一直在尝试将我的服务器网卡组合起来,然后桥接以在虚拟化盒(KVM)上使用。我已经设法将其连接到网络上,并且至少可以 ping google,但是,它仅在我插入第二个网卡(eno2)时才有效。如果我仅在第一个 NIC (eno1) 中使用电缆,则本地网络上的路由器看不到服务器。

我查看了文档和无数的论坛。我发现让我“最接近”的最佳资源是这个网站:https://myredhatcertification.com/2015/04/09/software-bridge-on-top-of-the-teaming-device/。不确定我做错了什么。顺便说一句,我的 KVM 虚拟机没有使用任何一个 NIC 的网络。但是,当我在主机上建立网络并可靠后,可以查看这一点。

我已停止并禁用 NetworkManager(但仍已安装)。

以下是相关输出和文件(如果您想查看更多,请询问)

ip as 这是网线插入eno2时的情况

[root@server1 ~]# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master team0 state DOWN qlen 1000
    link/ether 0c:c4:7a:ca:3b:6e brd ff:ff:ff:ff:ff:ff
    inet6 fe80::ec4:7aff:feca:3b6e/64 scope link
       valid_lft forever preferred_lft forever
3: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master team0 state UP qlen 1000
    link/ether 0c:c4:7a:ca:3b:6e brd ff:ff:ff:ff:ff:ff
    inet6 fe80::ec4:7aff:feca:3b6e/64 scope link
       valid_lft forever preferred_lft forever
4: eno3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 0c:c4:7a:ca:58:06 brd ff:ff:ff:ff:ff:ff
5: eno4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 0c:c4:7a:ca:58:07 brd ff:ff:ff:ff:ff:ff
6: team0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master brteam0 state UP
    link/ether 0c:c4:7a:ca:3b:6e brd ff:ff:ff:ff:ff:ff
    inet6 fe80::ec4:7aff:feca:3b6e/64 scope link
       valid_lft forever preferred_lft forever
7: brteam0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 0c:c4:7a:ca:3b:6e brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.150/24 brd 192.168.0.255 scope global brteam0
       valid_lft forever preferred_lft forever
    inet6 fe80::ec4:7aff:feca:3b6e/64 scope link
       valid_lft forever preferred_lft forever

brctl显示

[root@server1 ~]# brctl show
bridge name bridge id   STP enabled interfaces
brteam0   8000.0cc47aca3b6e no    team0

/etc/sysconfig/network-scripts/ifcfg-brteam0

DEVICE=brteam0
ONBOOT=yes
TYPE=Bridge
IPADDR0=192.168.0.150
PREFIX0=24
GATEWAY0=192.168.0.1

/etc/sysconfig/network-scripts/ifcfg-team0

DEVICE=brteam0
ONBOOT=yes
TYPE=Bridge
IPADDR0=192.168.0.150
PREFIX0=24
GATEWAY0=192.168.0.1
[root@server1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-team0
DEVICE=team0
TEAM_CONFIG="{\"runner\":{\"name\":\"loadbalance\"}}"
DEVICETYPE=Team
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=team0
UUID=1ddbb7ce-4a40-43b3-8394-7629bc9074a9
ONBOOT=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
BRIDGE=brteam0

/etc/sysconfig/network-scripts/ifcfg-team0-port1

BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=team0-port1
UUID=310074ca-cf54-43b9-b7e4-8d25b74274af
DEVICE=eno1
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort

/etc/sysconfig/network-scripts/ifcfg-team0-port2

BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=team0-port2
UUID=ad6972fa-94df-4c1c-9241-5315c823f4b9
DEVICE=eno2
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort

如果有人发现错误或者我错过了关键步骤,请告诉我。感谢所有帮助。

相关内容