CentOS6.2網(wǎng)卡怎么設(shè)置

這篇文章主要講解了“CentOS6.2網(wǎng)卡怎么設(shè)置”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“CentOS6.2網(wǎng)卡怎么設(shè)置”吧!

成都創(chuàng)新互聯(lián)專(zhuān)注于廣德企業(yè)網(wǎng)站建設(shè),自適應(yīng)網(wǎng)站建設(shè),商城網(wǎng)站建設(shè)。廣德網(wǎng)站建設(shè)公司,為廣德等地區(qū)提供建站服務(wù)。全流程按需制作網(wǎng)站,專(zhuān)業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,成都創(chuàng)新互聯(lián)專(zhuān)業(yè)和態(tài)度為您提供的服務(wù)

下面主要介紹在centos6.2下使用系統(tǒng)自帶的bonding進(jìn)行網(wǎng)卡綁定的詳細(xì)步驟。

注意:請(qǐng)?jiān)谂渲们瓣P(guān)閉networkmanager服務(wù)
[root@h63 ~]# service networkmanager status && service networkmanager start
網(wǎng)卡綁定一次可以綁定多個(gè)網(wǎng)卡,你可以使用ifconfig -a查看你的網(wǎng)卡信息,例如:
[root@h63 ~]# ifconfig -a

em1       link encap:ethernet  hwaddr 78:2b:cb:30:08:03
          up broadcast running slave multicast  mtu:1500  metric:1
          rx packets:48236002 errors:0 dropped:0 overruns:0 frame:0
          tx packets:16156472 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          rx bytes:4838973371 (4.5 gib)  tx bytes:1301118550 (1.2 gib)
          interrupt:36 memory:d6000000-d6012800

em2       link encap:ethernet  hwaddr 78:2b:cb:30:08:05
          up broadcast running slave multicast  mtu:1500  metric:1
          rx packets:42385720 errors:0 dropped:0 overruns:0 frame:0
          tx packets:7283526 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          rx bytes:4307780986 (4.0 gib)  tx bytes:466840625 (445.2 mib)
          interrupt:48 memory:d8000000-d8012800

em3       link encap:ethernet  hwaddr 78:2b:cb:30:08:07
          broadcast multicast  mtu:1500  metric:1
          rx packets:0 errors:0 dropped:0 overruns:0 frame:0
          tx packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          rx bytes:0 (0.0 b)  tx bytes:0 (0.0 b)
          interrupt:32 memory:da000000-da012800

em4       link encap:ethernet  hwaddr 78:2b:cb:30:08:09 
          broadcast multicast  mtu:1500  metric:1
          rx packets:0 errors:0 dropped:0 overruns:0 frame:0
          tx packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          rx bytes:0 (0.0 b)  tx bytes:0 (0.0 b)
          interrupt:42 memory:dc000000-dc012800


這里有4個(gè)網(wǎng)卡,分別是em1、em2、em3和em4,我們把em1和em2做一個(gè)綁定,綁定模式為6(關(guān)于網(wǎng)卡綁定模式的介紹請(qǐng)看linux網(wǎng)卡綁定探析),首先我給給網(wǎng)卡綁定后的設(shè)備起個(gè)名字bond0(名稱(chēng)可以自定義),并創(chuàng)建:
[root@h63 ~]# vim /etc/sysconfig/network-scripts/ifcfg-bond0
device=bond0        #設(shè)備名稱(chēng)
bootproto=static      #靜態(tài)ip
onboot=yes          #自動(dòng)啟動(dòng)
ipaddr=172.16.16.63    #設(shè)備綁定的ip
gateway=172.16.23.254       #設(shè)備綁定的網(wǎng)關(guān)
netmask=255.255.248.0    #設(shè)備綁定的掩碼
type=ethernet         #設(shè)備綁定的類(lèi)型

編輯需要綁定的網(wǎng)卡:
[root@h63 ~]# vim /etc/sysconfig/network-scripts/ifcfg-em1

device=em1
bootproto=none
onboot=yes
master=bond0  #綁定后的設(shè)備名稱(chēng)
slave=yes
type=ethernet

[root@h63 ~]# vim /etc/sysconfig/network-scripts/ifcfg-em2

device=em2
bootproto=none
onboot=yes
master=bond0  #綁定后的設(shè)備名稱(chēng)
slave=yes
type=ethernet
說(shuō)明:配置網(wǎng)卡時(shí)不要填寫(xiě)ip地址和mac地址

配置加載模式設(shè)置:
[root@h63 ~]# vim /etc/modprobe.conf

alias bond0 bonding
options bond0 miimon=100 mode=6

說(shuō)明:mode是網(wǎng)卡綁定的模式,此處是模式6

也可以在/etc/modprobe.d/下創(chuàng)建一個(gè)文件:
[root@h63 ~]# vim /etc/modprobe.d/bond

alias bond0 bonding
options bond0 miimon=100 mode=6

綁定配置完成,重啟網(wǎng)絡(luò)服務(wù)
[root@h63 ~]#service network restart

查看網(wǎng)卡綁定的情況:

[root@h63 ~]# cat /proc/net/bonding/bond0
ethernet channel bonding driver: v3.6.0 (september 26, 2009)

bonding mode: adaptive load balancing
primary slave: none
currently active slave: em1
mii status: up
mii polling interval (ms): 100
up delay (ms): 0
down delay (ms): 0

slave interface: em1
mii status: up
speed: 1000 mbps
duplex: full
link failure count: 0
permanent hw addr: 78:2b:cb:30:08:03
slave queue id: 0

slave interface: em2
mii status: up
speed: 1000 mbps
duplex: full
link failure count: 0
permanent hw addr: 78:2b:cb:30:08:05
slave queue id: 0

感謝各位的閱讀,以上就是“CentOS6.2網(wǎng)卡怎么設(shè)置”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)CentOS6.2網(wǎng)卡怎么設(shè)置這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

文章標(biāo)題:CentOS6.2網(wǎng)卡怎么設(shè)置
本文鏈接:http://muchs.cn/article46/gpjdeg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、網(wǎng)站設(shè)計(jì)云服務(wù)器、App開(kāi)發(fā)、軟件開(kāi)發(fā)、品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化