Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6837586
  • 博文数量: 3857
  • 博客积分: 6409
  • 博客等级: 准将
  • 技术积分: 15948
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 16:48
个人简介

迷彩 潜伏 隐蔽 伪装

文章分类

全部博文(3857)

文章存档

2017年(5)

2016年(63)

2015年(927)

2014年(677)

2013年(807)

2012年(1241)

2011年(67)

2010年(7)

2009年(36)

2008年(28)

分类:

2012-09-30 22:02:23

原文地址:linux 网卡绑定与多vlan实现 作者:ox1943

 
linux 网卡绑定与多vlan实现
1.先停止network service:
#service network stop
2.建立bound0 虚拟接口
#cd /etc/sysconfig/network-scripts
#touch ifcfg-bound0
#vi ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
ONBOOT=yes
USERCTL=no
TYPE=Ethernet
3.设定bound0 的slave接口
#vi ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HOTPLUG=no
MASTER=bond0
SLAVE=yes
#vi ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
HOTPLUG=no
MASTER=bond0
SLAVE=yes
#vi ifcfg-eth2
DEVICE=eth2
BOOTPROTO=static
ONBOOT=yes
HOTPLUG=no
MASTER=bond0
SLAVE=yes
 
#vi ifcfg-eth3
DEVICE=eth3
BOOTPROTO=static
ONBOOT=yes
HOTPLUG=no
MASTER=bond0
SLAVE=yes
4.设定bond0 的slave接口
# vim /etc/ modprobe.conf
alias eth0 bnx2
alias eth1 bnx2
alias eth2 bnx2
alias eth3 bnx2
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptsas
alias scsi_hostadapter2 megaraid_sas
alias scsi_hostadapter3 ata_piix
alias usb0 cdc_ether
install bond0 /sbin/modprobe bonding -o bond0 miimon=100 mode=4     #-----mode=4 是标准的802.3ad
# Begin Dell MD Modification
options scsi_dh_rdac blacklist="DELL:MD3000,DELL:MD3000i"
# End Dell MD Modification
alias pcspkr off
5.加载bound0
#modprob bond0
6.建立vlan
建立vlan2
#cd /etc/sysconfig/network-scripts
#touch ifcfg-bond0.2       #----表示建立vlan2
#vi ifcfg-bond0.2
DEVICE=bond0.2
BOOTPROTO=static
ONBOOT=yes
USERCTL=no
VLAN=yes
IPADDR=2.2.2.2
NETMASK=255.255.255.0

建立vlan3
#cd /etc/sysconfig/network-scripts
#touch ifcfg-bound0.3       #----表示建立vlan2
#vi ifcfg-bond0.3
DEVICE=bond0.3
BOOTPROTO=static
ONBOOT=yes
USERCTL=no
VLAN=yes
IPADDR=3.3.3.3
NETMASK=255.255.255.0

7.将加载bond 选项加入到开机选项中
[root@MCDBKP01 network-scripts]# more /etc/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.
modprobe bonding                     加载bonding 模块
service network restart             
保存退出

8.重启网络服务
在/etc/sysconfig/network 中添加default gateway
GATEWAY =X.X.X.X
#/etc/init.d/network restart
 
到此server 上配置结束了
ifconifg  看到 所有vlan的IP了
route 可以看到所有的路由

察看bond0 的模式
more /sys/class/net/bond0/bonding/mode

echo 0 > /sys/class/net/bond0/bonding/mode

交换机配置:
交换机 邦定向对应端口 使用标准802.3ad 协议 静态绑定

  active    Enable initiation of LACP negotiation on a port
  on        Enable static link aggregation on this port
  passive   Disable initiation of LACP negotiation on a port
阅读(1168) | 评论(0) | 转发(0) |
0

上一篇:iptables配置

下一篇:ubuntu指定本地源

给主人留下些什么吧!~~