網絡管理(十一)

在CentOS7實現bond
(1)創建bond配置文件
[root@centos7/etc/sysconfig/network-scripts]#nmcli connection add con-name bond0 type bond ifname bond0 mode active-backup
這裏寫圖片描述
(2)綁定網卡

[root@centos7/etc/sysconfig/network-scripts]#nmcli connection add type bond-slave ifname eth0 master bond0
[root@centos7/etc/sysconfig/network-scripts]#nmcli connection add type bond-slave ifname eth1 master bond0

這裏寫圖片描述
注意:如無爲從屬接口提供連接名,則該名稱是接口名稱加類型構成
(3)啓動綁定,必須從從屬接口先啓動
[root@centos7/etc/sysconfig/network-scripts]#nmcli connection up bond-slave-eth0
[root@centos7/etc/sysconfig/network-scripts]#nmcli connection up eth1-bond0
[root@centos7#]nmcli con up bond0

這裏寫圖片描述
(4)測試,我這裏有兩塊網卡,先關閉一塊看看效果
這裏寫圖片描述
上述是沒有down時的狀態。下圖是down以後的狀態。
這裏寫圖片描述
(5)刪除bond
(a)先down,如果直接down bond0配置文件,從屬的都被down
這裏寫圖片描述
(b)刪除配置文件
[root@centos7~]#nmcli connection delete bond0
[root@centos7~]#nmcli connection delete bond-slave-eth0
[root@centos7~]#rm -rf /etc/sysconfig/network-scripts/ifcfg-eth1-bond0

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章