3550从入门到精通
Cat3550把交换和路由聚集到同一个平台上面,跟Cat6500一样,他们都工作在Native IOS环境底下。可以通过两种方式对Cat 3550进行配置,包括:
1 “config t” (常见的进入路由器配置状态命令)
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#?
Configure commands:
aaa Authentication, Authorization and Accounting
access-list Add an access list entry
alias Create command alias
arp Set a static ARP entry
……
……
2 “vlan database” (通过进入vlan database会话进行vlan以及vtp属性设置)
Switch#vlan database
Switch(vlan)#?
VLAN database editing buffer manipulation commands:
abort Exit mode without applying the changes
apply Apply current changes and bump revision number
exit Apply changes, bump revision number, and exit mode
no Negate a command or set its defaults
reset Abandon current changes and reread current database
show Show database information
vlan Add, delete, or modify values associated with a single VLAN
vtp Perform VTP administrative functions.
--当你通过exit命令退出vlan配置会话以后,你当前配置的属性立即就生效了
--本地交换机的配置必须通过命令wr mem或者copy run start进行保存
------------------------------------
关于Cat3550的接口类型:
--路由接口:
1 可路由物理接口——
Switch# conf t
Switch(config)#int fa0/1
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.3.1.1 255.255.0.0
Switch(config-if)#end
如果需要运行某个路由协议ip routing全局命令是必须的,另外,你也必须同时输入你在路由器上面配置路由协议的时候所输入的那些命令,比如router ospf 64;net 10.0.0.0 0.0.0.255 area 0这些……
2 可路由虚拟交换接口——
要给某两个交换接口(二层接口)分配IP地址,你需要有一个独立的接口来扮演路由这两个交换接口的工作;这就是SVI的概念了。SVI使用如interface vlan1或者interface vlan2这些接口名字。那这两个交换接口就被集成到同一个三层接口上面了,然后你就可以给它们分配你希望的三层地址,如IP地址。创建一个SVI很简单,仅仅输入”interface vlan#“命令就可以了。
Switch# conf t
Switch(config)#int vlan 1
Switch(config-if)#ip address 10.1.1.1 255.255.0.0
Switch(config)#int vlan 2
Switch(config-if)#ip address 10.2.1.1 255.255.0.0
Switch(config-if)#end
一旦你给vlan接口或者是物理接口配置了IP地址,你就可以像往常一样给它们配置路由协议,让它们加入到路由信息里面了。
--交换接口:
1 访问端口——
需要把几个接口放到同一个IP子网上面的时候,你需要把接口从路由接口转变成交换接口;在(config-if)模式下使用switchport命令能激活这个目的。注意:一个访问端口只能属于一个VLAN,而且访问接口在默认情况下是自动属于VLAN 1的。
Switch# conf t
Switch(config)#int fa0/1
Switch(config-if)# switchport access vlan 1
Switch(config)#int fa0/2
Switch(config-if)# switchport access vlan 1
Switch(config-if)#end
Switch#
下面我们把两个接口分配到VLAN2上面去,这个时候,你就不能够为他们分配单独的IP地址了,因为它们是二层接口。
Switch# conf t
Switch(config)#int fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 2
Switch(config)#int fa0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 2
Switch(config-if)#end
最后是使用range命令更快的把一堆接口划入某个VLAN里面:
Switch(config)#int range fa0/5 - 9
Switch(config-if-range)#switchport access vlan 15
Switch(config-if-range)#
2 隧道(Trunk)端口——
可以通过创建隧道接口,使用ISL或者802.1q封装,来令多个vlan的信息通过隧道接口传输:
Switch# conf t
Switch(config)#int fa0/1
Switch(config-if)# switchport
Switch(config-if)# switchport trunk encapsulation isl
Switch(config-if)# switchport trunk allowed vlan remove 11-900
Switch(config-if)#end
------------------------------------
EtherChannel配置
EtherChannel是把多条独立的以太网链路捆绑成为一条单独的逻辑链路。每个EtherChannel的接口都必须具有相同的速度,以及必须都被配置为二层或者三层接口。如果EtherChannel内的某一条链路失效了,原来在失效链路上面传输的流量将会那条EtherChannel内剩下的链路上面继续进行传输。交换机将收到一个信息,表明那条EtherChannel里面的链路失效了。从EtherChannel内其中一条链路进入的广播或者多播包将会被拒绝向EtherChannel内的其他链路进行转发。
为二层接口创建EtherChannel是不同于为三层接口创建EtherChannel的,但是,两种配置都需要应用逻辑接口。
下面的例子显示了如何将快速以太网接口0/4和0/5作为静态访问端口被分配到VLAN 10到Channel 5里面,采用PAgP desirable模式:
Switch# configure terminal
Switch(config)# interface range fa0/4 -5
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# channel-group 5 mode desirable
Switch(config-if)# end
可以采用no channel-group接口配置命令,把一个接口从EthterChannel组中删除。
下面的例子显示了如何创建一个逻辑端口Channel 5并分配172.10.20.10作为它的IP地址:
Switch# configure terminal
Switch(config)# interface port-channel 5
Switch(config-if)# no switchport
Switch(config-if)# ip address 198.10.20.10 255.255.255.0
Switch(config-if)# end
可以采用no interface port-channel [port-channel-number]全局配置命令将一个port-channel删除。