Chinaunix
标题:
65xx系列交换机配置(Native IOS)(3)
[打印本页]
作者:
weibaochen
时间:
2008-06-04 20:11
标题:
65xx系列交换机配置(Native IOS)(3)
4. 端口设置
4.1. 端口基本设置
Cisco 65xx系列交换机的端口缺省都是路由模式,一般都会配置为交换端口使用,进入端口配置模式:
对于单一端口,在配置模式下输入:interface Ethernet,Fast Ethernet,Gigabit
Ethernet x/y, x为槽位号,y为端口号。
对于一组端口,可以使用以下的命令进入,例如:
Router(config)# interface range fastethernet 5/1 - 5 或:
Router(config-if)# interface range gigabitethernet 2/1 - 2, gigabitethernet
3/1 - 2
进行端口配置模式后,可以shutdown,或no shutdown端口,并可以对端口进行配置,快速以太端口有全双工、半双工和自动协商模式,如果知道对端连接的设备是采用何种方式,最好采用手工设置方式固定端口的模式和速率。缺省是自动协商模式。
快速以太端口的速率可以设置为100M,也可以设置为10M和自动协商。缺省是自动协商方式。如:
Router(config-if)#speed [10 | 100 | auto](速度)
Router(config-if)# duplex [auto | full | half](双工)
或添加注释,如:
Router(config-if)# description Channel-group to "Marketing"
4.2. 配置二层交换接口 (以fastethernet为例,gigabitethernet一样)
Router(config)# interface fastethernet x/y
Router(config-if)# shutdown
Router(config-if)# switchport ;6500上缺省端口为路由端口,需要写switchport
将端口设置为交换端口
Router(config-if)# switchport mode access
Router(config-if)# switchport access vlan x
Router(config-if)# no shutdown
Router(config-if)# end
清除二层接口配置 (以fastethernet为例,gigabitethernet一样)
Router(config)# interface fastethernet x/y
Router(config-if)# no switchport
Router(config-if)# end
注:使用default interface {ethernet | fastethernet | gigabitethernet}
slot/port,使端口回到原来的缺省配置。
4.3. 配置三层路由端口
6500的端口缺省就是具有三层交换的端口,用来跟其他设备的连接,当将一个端口配
置成三层端口之后,就可以在此端口上分配IP地址了。
Router(config)# interface fastethernet x/y
Router(config)# ip add x.x.x.x x.x.x.x
Router(config)# no shutdown
4.4. 配置端口Trunk
将一个二层端口配置为Trunk模式:
Router(config)# interface fastethernet x/y (以fastethernet为例,
gigabitethernet一样)
Router(config-if)# shutdown
Router(config-if)# switchport
Router(config-if)# switchport trunk encapsulation dot1q
Router(config-if)# switchport mode trunk
Router(config-if)# no shutdown
Router(config-if)# end
Router# exit
4.5. Ethernaet Channel
Router(config)# interface range gigabitethernet1/1 - 2
Router(config-if)#no ip address
Router(config-if)#switchport
Router(config-if)#switchport trunk encapsulation dot1q
Router(config-if)#switchport mode trunk
Router(config-if)#switchport trunk native vlan 1
Router(config-if)#channel-group 1 mode on
产生配置结果如下:
interface Port-channel1 ;自动产生,并且一定要如下所示,否则可能会有问题。
switchport
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet1/1
no ip address
switchport
switchport trunk encapsulation dot1q
switchport trunk native vlan 1
channel-group 1 mode on
!
interface GigabitEthernet1/2
no ip address
switchport
switchport trunk encapsulation dot1q
switchport trunk native vlan 1
channel-group 1 mode on
如果有问题,使用命令#no int port-channel 1 ,#int g2/1 -2 ,#no switchport
4.6. 查看端口配置
Router# show running-config interface fastethernet 5/8
Router# show interfaces fastethernet 5/8 switchport
Router# show running-config interface port-channel 1
Router# show spanning-tree interface fastethernet 4/4
本文来自ChinaUnix博客,如果查看原文请点:
http://blog.chinaunix.net/u2/70632/showart_726226.html
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2