centos 網卡彙總

來源:互聯網
上載者:User

標籤:centos網卡彙總

1、cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-bond0
2、vi /etc/sysconfig/network-scripts/ifcfg-bond0 檔案,內容如下:
DEVICE=bond0
USERCTL=no
BOOTPROTO=static
IPADDR=192.168.233.232
NETMASK=255.255.255.0
ONBOOT=yes
GATEWAY=192.168.233.1
TYPE=Ethernet

3、vi /etc/sysconfig/network-scripts/ifcfg-eth0 檔案,內容如下:
DEVICE=eth0
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes
USERCTL=no

4、vi /etc/sysconfig/network-scripts/ifcfg-eth1 檔案,內容如下:
DEVICE=eth1
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes
USERCTL=no

5、vi /etc/modprobe.conf 增加:
alias bond0 bonding
options bond0 miimon=100 mode=0

6、service network restart
結果沒有報錯:
[[email protected] network-scripts]# service network restart
Shutting down interface bond0:                             [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface bond0:                               [  OK  ]
[[email protected] network-scripts]#

7、重啟系統

8、檢查配置是否成功,如下顯示表示配置成功
[[email protected] network-scripts]# ifconfig
bond0     Link encap:Ethernet  HWaddr 00:0C:29:DF:D6:84  
          inet addr:192.168.233.232  Bcast:192.168.233.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:756 errors:0 dropped:0 overruns:0 frame:0
          TX packets:836 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:74148 (72.4 KiB)  TX bytes:189998 (185.5 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0C:29:DF:D6:84  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:735 errors:0 dropped:0 overruns:0 frame:0
          TX packets:658 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:70034 (68.3 KiB)  TX bytes:159290 (155.5 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:DF:D6:84  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:23 errors:0 dropped:0 overruns:0 frame:0
          TX packets:190 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4234 (4.1 KiB)  TX bytes:32540 (31.7 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1996 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1996 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3242068 (3.0 MiB)  TX bytes:3242068 (3.0 MiB)

[[email protected] network-scripts]#

本文出自 “小白的小窩” 部落格,請務必保留此出處http://qing429.blog.51cto.com/5781009/1589368

centos 網卡彙總

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.