ITPub博客

首页 > Linux操作系统 > Linux操作系统 > CentOS 5.4上双网卡(多网卡)绑定

CentOS 5.4上双网卡(多网卡)绑定

原创 Linux操作系统 作者:kidking2010 时间:2011-07-08 21:06:43 0 删除 编辑

在CentOS上做双网卡绑定:

1.确定网卡和配置文件

修改配置文件:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes

vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes

vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
BOOTPROTO=none

#广播域
BROADCAST=10.10.10.255

#网卡物理地址
IPADDR=10.10.10.221

#子网掩码
NETMASK=255.255.255.0
NETWORK=10.10.10.0
ONBOOT=yes

#网关地址
GATEWAY=10.10.10.1
TYPE=Ethernet

2. 在模块文件中添加如下标红的内容:

vi  /etc/modprobe.conf


alias eth0 bnx2
alias eth1 bnx2
alias scsi_hostadapter megaraid_sas
alias scsi_hostadapter1 usb-storage
alias bond0 bonding
options bond0 miimon=100 mode=0

3.在启动文件中加入如下标红内容:

cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script. will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style. init stuff.

touch /var/lock/subsys/local
ifenslave bond0 eth0 eth1

4.重启网络服务

 /etc/init.d/network restart
Shutting down interface bond0:                             [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface bond0:                               [  OK  ]

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23141985/viewspace-701726/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: unix bench
下一篇: centos vnc
请登录后发表评论 登录
全部评论

注册时间:2011-02-27

  • 博文量
    114
  • 访问量
    332996