您的位置:首页 > 其它

ceph集群绑定多网卡

2017-01-10 00:00 381 查看
环境:ubuntu16.04 LTS 四个万兆光纤网口,搭建ceph集群,ceph集群网绑定两个网卡,ceph公共网绑定两个网卡,绑定模式mode=4,交换机用华为万兆S6720

一、配置服务端网口配置文件

1、安装ifenslave

apt-get install ifenslave-2.6

2、网口配置文件如下

# The primary network interface
auto enP2p1s0f1
iface enP2p1s0f1 inet manual
bond-master bond0
iface enP2p1s0f2 inet manual
bond-master bond0
auto enP2p1s0f3
iface enP2p1s0f3 inet manual
bond-master bond1
auto enP2p1s0f4
iface enP2p1s0f4 inet manual
bond-master bond1
auto bond0
iface bond0 inet static
address 10.33.0.40
netmask 255.255.0.0
network 10.33.0.0
broadcast 10.33.255.255
gateway 10.33.0.254
dns-nameservers 172.16.2.1
bond-mode 4
bond-miimon 100
bond-lacp-rate 1
bond-slaves enP2p1s0f1 enP2p1s0f2
auto bond1
iface bond1 inet static
address 192.168.3.40
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
bond-mode 4
bond-miimon 100
bond-lacp-rate 1
bond-slaves enP2p1s0f3 enP2p1s0f4

3、重启网络

systemctl restart networking

4、查看网络状态
用ip addr可以看到bond0和bond1也slave网卡有相同的mac地址。

5、查看绑定网卡状态

cat /proc/net/bonding/bond0

cat /proc/net/bonding/bond1

如果配置正确的话在输出内容中可以看到网卡是up状态。

参考 https://help.ubuntu.com/community/UbuntuBonding
二、交换机配置

1、交换机需要使能lacp功能,并配置trunk,其中一个端口配置如下:

interface Eth-Trunk1
port link-type access
port default vlan 330
mode lacp
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  网卡绑定