Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[原创] Gentoo/Cisco混合网络系列:EtherChannel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese)
View previous topic :: View next topic  
Author Message
MACHINE
Tux's lil' helper
Tux's lil' helper


Joined: 30 Mar 2004
Posts: 141
Location: Earth

PostPosted: Mon Sep 19, 2005 2:37 am    Post subject: [原创] Gentoo/Cisco混合网络系列:EtherChannel Reply with quote

越来越多的管理人知道GentooLinux可以用做路由器,它支持RIP、OSPF、BGP、ISIS、组播路由以及它们的IPv6版本(Linux可以带来较CiscoIOS更高效的OSPF算法,详情见www.quagga.net);GentooLinux可以用做交换机,它有先进的NIC-to- NIC零拷贝(不经过CPU直接快速交换)、快速解包、Trunk和各种先进的VLAN特性。加上GentooLinux的精简强壮性、配合x86机器低廉的硬件价格、其高级的电源管理特性。这也是越来越多的国外中小型企业亲睐GentooLinux的原因(www.gentoo.org)。但只有思科设备才可以互相EtherChannel吗?在Linux/UNIX操作系统下,有一种和思科EtherChannel兼容的以太网卡捆绑技术,称为Bonding。这也是GentooLinux用于降低企业成本的一种方法。

……

(我不想再说废话了!!开始!)


实验环境:

硬件:
1、Sempron 2200+的主机,512兆内存
2、两块Intel的百兆网卡
3、一台Cisco 2950交换机

软件:
1、IOS
2、Gentoo Linux(当然,无所不能的OS)

步骤:
1、把Bonding驱动程序编译成模块
Device Driver -> Networking Support -> Bonding driver support
2、编译安装
cd /usr/src/linux
make && make modules_install
3、自动加载
echo "bonding miimon=100 mode=0" > /etc/modules.autoload.d/kernel-2.6

4、编辑/etc/conf.d/net
iface_bond0="192.168.14.5 netmask 255.255.255.0 broadcast 192.168.14.255 up"
gateway="bond0/192.168.14.210"

5、编译安装ifenslave.cc
GentooLinux安装:
emerge ifenslave

------------------------------------------------------------------
其实红帽或其他Linux的安装是这样麻烦的:
cd /usr/src/linux/Documentation/networking
gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux/include ifenslave.c -o ifenslave
cp ifenslave /sbin/ifenslavevW
------------------------------------------------------------------

6、自动运行,编辑/etc/conf.d/local.start
ifenslave bond0 eth0 eth1

7、做软连接
ln -sf /etc/init.d/net.eth0 /etc/init.d/net.bond0

8、删除eth0、eth1自动启动,却自动启动bond0
rc-update del eth0
rc-update del eth1
rc-update add bond0 default

9、重启

10、重启后,运行ifconfig应该可以看到
bond0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:192.168.14.5 Bcast:192.168.14.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:833 errors:0 dropped:0 overruns:0 frame:0
TX packets:226 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:360503 (352.0 Kb) TX bytes:16845 (16.4 Kb)

eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:420 errors:0 dropped:0 overruns:0 frame:0
TX packets:113 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:181991 (177.7 Kb) TX bytes:8241 (8.0 Kb)

eth1 Link encap:Ethernet HWaddr 00:11:22:33:44:55
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:413 errors:0 dropped:0 overruns:0 frame:0
TX packets:113 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:178512 (174.3 Kb) TX bytes:8604 (8.4 Kb)

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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

11、Cisco配置

Rack09SW1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z
Rack09SW1(config)#interface range FastEthernet0/23 -24
Rack09SW1(config-if-range)#channel-group 1 mode auto
Creating a port-channel interface Port-channel1
Rack09SW1(config-if-range)#end
Rack09SW1#show running-config

interface FastEthernet0/23
no ip address
channel-group 1 mode auto

interface FastEthernet0/24
no ip address
channel-group 1 mode auto
[...]

详细技术信息请查看GentooLinux的附带文档
less /usr/src/linux/Documentation/networking/bonding.txt
_________________
Hi, Gentoo men!!
Back to top
View user's profile Send private message
dragonlinux
n00b
n00b


Joined: 21 Nov 2006
Posts: 16

PostPosted: Fri Nov 24, 2006 8:12 pm    Post subject: Reply with quote

这不是二层trunk吗?
bonding 也是把几个端口汇聚成一个逻辑端口,当然也可以是一个三层接口.
这也不是gentoo的特点,只是kernel提供的一个功能而已.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum