CentOS/Redhat 网卡绑定和桥接
2013-01-28 12:10
459 查看
一、实验环境:
主机名 IP(Static) 系统 配置
CentOS 192.168.100.100 CentOS-6.3-x86_64-minimal 2CPU,1G RAM,20G DISK,2网卡
二、实验目的:
云计算快速发展,不少已经投入实际运用中,在生产环境中,解决云计算各个环节的稳定性和冗余度显得尤为重要,在此我将演示双网卡的绑定和桥接过程;
网卡binding的模式选择:mode=1;
对比几种binding模式,在以前的文章中有说过,在此选择主备(A/S)模式;
三、配置步骤:
1.eth0和eth1配置:
[root@CentOS ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@CentOS ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
2.bond0配置:
[root@CentOS ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
BRIDGE=br0
BONDING_OPTS="miimon=100 mode=1"
3.br0配置:
[root@CentOS ~]# vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=static
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
4.配置modprobe.conf文件:
[root@CentOS ~]# echo “alias bond0 bonding” >> /etc/modprobe.d/modprobe.conf
5.配置network文件:
[root@CentOS ~]# echo “GATEWAY=br0” >> /etc/sysconfig/network
6.重启network服务:
需要两次重启,第一次重启会识别bond0,认为网卡已经桥接过不能再次桥接,这时候再重启一下network服务就可解决:
[root@CentOS ~]# service network restart
7.查看binding状态:
[root@CentOS ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 24:b6:fd:ab:75:db
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 24:b6:fd:ab:75:dd
Slave queue ID: 0
[root@CentOS ~]#
主机名 IP(Static) 系统 配置
CentOS 192.168.100.100 CentOS-6.3-x86_64-minimal 2CPU,1G RAM,20G DISK,2网卡
二、实验目的:
云计算快速发展,不少已经投入实际运用中,在生产环境中,解决云计算各个环节的稳定性和冗余度显得尤为重要,在此我将演示双网卡的绑定和桥接过程;
网卡binding的模式选择:mode=1;
对比几种binding模式,在以前的文章中有说过,在此选择主备(A/S)模式;
三、配置步骤:
1.eth0和eth1配置:
[root@CentOS ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
[root@CentOS ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bond0
SLAVE=yes
2.bond0配置:
[root@CentOS ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
BRIDGE=br0
BONDING_OPTS="miimon=100 mode=1"
3.br0配置:
[root@CentOS ~]# vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=static
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
4.配置modprobe.conf文件:
[root@CentOS ~]# echo “alias bond0 bonding” >> /etc/modprobe.d/modprobe.conf
5.配置network文件:
[root@CentOS ~]# echo “GATEWAY=br0” >> /etc/sysconfig/network
6.重启network服务:
需要两次重启,第一次重启会识别bond0,认为网卡已经桥接过不能再次桥接,这时候再重启一下network服务就可解决:
[root@CentOS ~]# service network restart
7.查看binding状态:
[root@CentOS ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 24:b6:fd:ab:75:db
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 24:b6:fd:ab:75:dd
Slave queue ID: 0
[root@CentOS ~]#
相关文章推荐
- 管理聚合链路和桥接网络(多网卡绑定,redhat liunx 7.0) 基础知识
- CentOS/Redhat 网卡绑定和桥接
- centos7 网桥桥接、网卡绑定终极实战
- CentOS单网卡绑定多IP
- CentOS 6.5 网卡绑定
- Centos系统的单网卡绑定双ip的设置
- CentOS下双网卡绑定
- Centos7,Ubuntu14.04多网卡配置bond,将多网卡绑定在一起
- virtualbox通过桥接网卡上网-虚拟机系统centos
- RedHat 7配置bonding双网卡绑定
- CentOS 7 多网卡绑定 bond
- CentOS6.2网卡绑定配置
- RedHat Enterprise Linux 6.X系统双网卡绑定操作实例
- redhat6.2双网卡绑定
- Centos 双网卡绑定实现负载均衡和故障转移 推荐
- centos设置双网卡绑定band0
- Centos7 网卡bond桥接
- CentOS6.3_RedHat6.3_虚拟机网卡启动失败_网卡eth0未识别的端口_Bringing up interface eth0: Error:
- Linux学习之CentOS(二十九)--Linux网卡高级命令、IP别名及多网卡绑定
- edhat/Centos第二块网卡添加/绑定IP