Red Hat Enterprise Linux 允許管理員使用bonding 內(nèi)核模塊和稱為通道綁定接口的特殊網(wǎng)絡(luò)接口將多個(gè)網(wǎng)絡(luò)接口綁定到一個(gè)通道。根據(jù)選擇的綁定模式 , 通道綁定使兩個(gè)或更多個(gè)網(wǎng)絡(luò)接口作為一個(gè)網(wǎng)絡(luò)接口 , 從而增加帶寬和 / 提供冗余性
1.利用 nmcli 命令管理 bond
nm-connection-editor
刪除所有網(wǎng)絡(luò)接口
nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup ip4 172.25.254.199/24
ifconfig
watch -n 1 cat /proc/net/bonding/bond0
nmcli connection add type bond-slave con-name eth0 ifname eth0 master bond0
nmcli connection add type bond-slave con-name eth2 ifname eth2 master bond0
ifconfig eth0 down
2.選擇 Linux 以太網(wǎng)綁定模式
模式 0 ( 平衡輪循 balance-rr) - 輪循策略 , 所有接口都使用采用輪循方式在所有 Slave 中傳輸封包 ; 任何Slave 都可以接收
模式 1 ( 主動(dòng)備份 active-backup ) - 容錯(cuò)。一次只能使用一個(gè)Slave 接口 , 但是如果該接口出現(xiàn)故障 , 另一個(gè)Slave 將 接替它
模式 3 ( 廣播 broadcast) - 容錯(cuò)。所有封包都通過(guò)所有Slave 接口廣播
3.主動(dòng)備份配置示例
3-1 建立綁定接口 bond0 配置文件 :
/etc/sysconfig/network-scripts/ifcfg-bond0
– BOOTPROTO="none"
– IPADDR="10.1.1.250"
– PREFIX=”24”
– ONBOOT="yes"
– BONDING_OPTS=”mode=1 miimon=50”
3-2 建立 Slave 接口 eth0 配置文件:
/etc/sysconfig/network-scripts/ifcfg-eth0
– DEVICE="eth0" ####硬件網(wǎng)卡名
– BOOTPROTO="none"
– ONBOOT="yes"
– MASTER="bond0"
– SLAVE="yes“
3-3 建立 Slave 接口 eth2 配置文件 :
/etc/sysconfig/network-scripts/ifcfg-eth2
– DEVICE="eth2"
– BOOTPROTO="none"
– ONBOOT="yes"
– MASTER="bond0"
– SLAVE="yes“
3-4 配置系統(tǒng)加載 binding 模塊 :
/etc/modprobe.d/bonding.conf
– alias bond0 bonding
ifenslave bond0 eth0 eth2
systemctl stop NetworkManager
systemctl restart network
查看 bonding 狀態(tài)
– cat /proc/net/bonding/bond0
二。學(xué)習(xí)配置 team 網(wǎng)絡(luò)接口
1.Team 接口
Team 和 bond0 功能類似
Team 不需要手動(dòng)加載相應(yīng)內(nèi)核模塊
Team 有更強(qiáng)的拓展性
– 支持 8 快網(wǎng)卡
2.Team 的種類
broadcast 廣播容錯(cuò)
roundrobin 輪詢
activebackup 主備
loadbalance 負(fù)載均衡
3.通過(guò) nmcli 設(shè)定 team
nmcli connection add type team con-name team0 ifname team0 config '{"runner"{"name":"loadbalance"}}' ip4 172.25.254.198/24
nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
nmcli connection add con-name eth2 ifname eth2 type team-slave master team0
4.監(jiān)控team0,并測(cè)試
teamctl team0 stat
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth2 down
ifconfig eth2 up
三。學(xué)習(xí)配置網(wǎng)絡(luò)橋接
1.網(wǎng)絡(luò)橋接
網(wǎng)絡(luò)橋接用網(wǎng)絡(luò)橋?qū)崿F(xiàn)共享上網(wǎng)主機(jī)和客戶機(jī)除了利用軟件外,還可以用系統(tǒng)自帶的網(wǎng)絡(luò)橋建立連接用雙網(wǎng)卡的機(jī)器做主機(jī)
2.網(wǎng)絡(luò)橋接的配置
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 ###設(shè)備名,可能不同
ONBOOT=yes
BOOTPROTO=none
BRIDGE=br0 ###重點(diǎn),必須說(shuō)明
vim /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
TYPE=Bridge ###重點(diǎn),必須說(shuō)明
IPADDR=172.25.254.198
3.網(wǎng)絡(luò)橋接的管理命令
brctl
### 橋接管理命令
– show ### 顯示
– addbr ### 添加網(wǎng)橋
– delbr ### 刪除網(wǎng)橋
– addif ### 添加網(wǎng)橋連接
– delif ### 刪除網(wǎng)橋連接
卸載橋接接口過(guò)程
brctl show
brctl delif br0 eth0
brctl show
brctl delbr br0
ifconfig br0 down
brctl show
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
當(dāng)前題目:高級(jí)網(wǎng)絡(luò)配置——bond/team/橋接網(wǎng)絡(luò)-創(chuàng)新互聯(lián)
標(biāo)題網(wǎng)址:http://www.rwnh.cn/article42/ceidec.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、自適應(yīng)網(wǎng)站、Google、網(wǎng)站導(dǎo)航、小程序開(kāi)發(fā)、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容