收藏 分享(赏)

思科交换机简单配置(通用教程).ppt

上传人:weiwoduzun 文档编号:3859839 上传时间:2018-11-23 格式:PPT 页数:31 大小:231.52KB
下载 相关 举报
思科交换机简单配置(通用教程).ppt_第1页
第1页 / 共31页
思科交换机简单配置(通用教程).ppt_第2页
第2页 / 共31页
思科交换机简单配置(通用教程).ppt_第3页
第3页 / 共31页
思科交换机简单配置(通用教程).ppt_第4页
第4页 / 共31页
思科交换机简单配置(通用教程).ppt_第5页
第5页 / 共31页
点击查看更多>>
资源描述

1、思科交换机基本配置,研发七部,思科交换机基本介绍,交换机型号 Catalyst 2960 系列交换机 Catalyst 3560 系列交换机 Catalyst 3750 系列交换机 Catalyst 4500 系列交换机 Catalyst 4948 系列交换机 Catalyst 6500 系列交换机,3560系列交换机,三层交换机 支持PoE(Power over Ethernet)设备 支持IPv6 汇聚层交换机中型企业,Catalyst-3560G-24TS 技术参数转发带宽:32Gbps 每秒分组数:38.7Mpps 支持的mac地址:12000 支持的路由:11000 千兆以太网SFP

2、:4 10/100/1000端口:24 不支持PoE,思科交换机测试中常用配置,交换机配置模式,用户模式 Switch特权模式 Switchenable Switch#全局模式 Switch#configure terminalSwitch(config)#每次进入交换机时,首先会进入到用户模式下 ,在此模式下不能对交换机进行修改、甚至有些信息都无法查看,为了更进一步的对交换机进行操作,我们必须进入到特权模式或全局模式,而从用户模式下只能进入特权模式,再从特权模式进入全局模式,也就是说之中不能跨级。,更改主机名 Switchen Switch#conf t Switch(config)#hos

3、tname 1234 1234(config)#更改特权密码 1234(config)#enable password 123 1234(config)#1234(config)#enable secret 234 1234(config)#,查看全局配置 Switch#show running-config保存当前配置 Switch#copy running-config startup-config恢复出厂默认 Switch#erase startup-config Switch#reload,明文密码和密文密码 Password 1234#show running-confighostn

4、ame 1234enable password 123Secret 1234#show running-confighostname 1234 enable secret 5 $1$CCFV$0DTd3rSPZNycrVDjn1rKv/ (MD5 加密的字符串) enable password 123当明文和密文同时存在时,密文优先级高。,端口配置,全局模式下进入端口后,可以对端口进行配置。 Switch#conf t Switch(config)#interface gigabitEthernet 0/1 Switch(config-if)# 批量修改端口 range命令端口速率: Swit

5、ch(config-if)#speed ?10 Force 10 Mbps operation100 Force 100 Mbps operation1000 Force 1000 Mbps operationauto Enable AUTO speed configuration Switch(config-if)#speed auto Switch(config-if)#,双工模式: Switch(config-if)#duplex ?auto Enable AUTO duplex configurationfull Force full duplex operationhalf Forc

6、e half-duplex operationSwitch(config-if)#duplex auto Switch(config-if)#端口描述 Switch(config-if)#description vlan 10 trunk Switch(config-if)#,Vlan设置,Vlan设置范围:1-4094 在全局模式下配置vlan Switch#conf t Switch(config)#vlan 10 Switch(config-vlan)#name vlan10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#name vla

7、n20Vlan名称可以自行定义Switch#show vlan 查看vlan配置信息,vlan10配置192.168.10.1/24的ip地址Switch#conf t Switch(config)#vlan 10 Switch(config-vlan)#name vlan10 Switch(config-vlan)#exit Switch(config)#interface vlan 10 Switch(config-if)#ip address 192.168.10.1 255.255.255.0 Switch(config-if)#end Switch#copy running-conf

8、ig startup-config配置ip地址的命令格式: ip address ip-address netmask,测试常用端口类型 Access / trunk将此端口设置为vlan10 的access口 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)# 将此端口设置为vlan10 的trunk口 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config

9、-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 10,当一个端口允许多个vlan通过时,trunk allowed vlan中要添加各条vlan信息Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config-if)# switchport trunk allowed vlan all Switch(config-if)#switchpor

10、t trunk allowed vlan 10,50,60 Switch(config-if)#switchport trunk allowed vlan add 20 (remove 删除) Switch(config-if)#switchport trunk allowed vlan add 30 Switch(config-if)#switchport trunk allowed vlan add 40 Switch(config-if)#switchport trunk native vlan 1 Switch(config-if)#no shutdown Switch(config-

11、if)#end Switch#copy running-config startup-config此端口为vlan10 vlan20 vlan30 vlan40的trunk口,default vlan 1经过此端口时不会带上标签。,光端口配置Switch(config)#interface gigabitEthernet 0/25 Switch(config-if)# switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)#no shutdown Switch(config-if)

12、#end Switch#copy running-config startup-config注意:由于思科的交换机只自动识别自己品牌的光模块,所以如果用其他品牌的光模块,需在配置模式下输入一下两条命令,开启兼容性。 service unsupported-transceiver no errdisable detect cause gbic-invalid 命令输入完成后保存设置重启设备,端口镜像配置,Cisco 3560G配置全局配置下:Switch(config)#monitor session 1 destination interface gigabitEthernet 0/1 Swi

13、tch(config)#monitor session 1 source interface gigabitEthernet 0/2 both Switch(config)#monitor session 1 source interface gigabitEthernet 0/3 bothmonitor session 1 建立一个端口镜像组 Destination 监控端口 Source 镜像端口,DHCP配置,配置一个dhcp给vlan10内的主机分配地址 Switch(config)#service dhcp Switch(config)#ip dhcp pool vlan10 Swi

14、tch(dhcp-config)#network 192.168.10.0 255.255.255.0 Switch(dhcp-config)#default-router 192.168.10.1 Switch(dhcp-config)#dns-server 192.168.10.2 Switch(dhcp-config)#lease 3 20 20 (天/小时/分钟) (缺省为1天) Switch(dhcp-config)#exit Switch(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.19 Switch(confi

15、g)# ip dhcp excluded-address 排除某些地址,禁止被动态分配 DHCP设置是针对全局的,不是定义在某个接口上的。 DHCP调试命令 Switch(config)#no service dhcp 关闭dhcp服务 Switch#show ip dhcp binding 查看dhcp分配情况,思科作DHCP server给AP分地址 在server中设置Option43、Option60字段信息。Switch(config)#ip dhcp pool vlan20 Switch(dhcp-config)#network 192.168.1.0 255.255.255.0

16、Switch(dhcp-config)#default-router 192.168.1.1 Switch(dhcp-config)#option 43 hex 0106 0104 c0a8 01e4 Switch(dhcp-config)#option 60 hex xxxx xxxx xxxx (AC回的offer包中的信息) Switch(dhcp-config)# lease 1 Switch(dhcp-config)#end Switch#copy running-config startup-config,DHCP relay配置,DHCP relay功能可以汇聚处于不同广播域的客

17、户端的DHCP请求,转发给DHCP服务器,并发送DHCP服务器的响应给各个客户端,也就是起到了DHCP报文在各个网段的转发功能。Cisco的设备需要启用ip helper-address命令,来实现此功能。 配置了ip helper-address命令之后的交换机在中继DHCP请求时的工作过程如下: (1)DHCP客户端发送请求,由于没有IP地址,所以自己的源IP地址为0.0.0.0,而且也不知道目的DHCP服务器的地址,所以广播255.255.255.255。该数据报文中还包括源mac地址和目的mac地址(全F)。 (2)当交换机接收到该数据包的时候,它就用自己的接口地址来取代源地址0.0.

18、0.0,并且用ip helper-address命令置顶的地址来取代目的地址255.255.255.255。 (3)当DHCP服务器接收到交换机转发过来的DHCP请求包时,它会做出响应,并且由交换机把数据包转发回客户端。,DHCP relay 配置Switch(config)#vlan 100 Switch(config-vlan)#name vlan100 Switch(config-vlan)#int vlan 100 Switch(config-if)#ip helper-address 192.168.1.228 Switch(config-if)#exit Switch(config

19、)#service dhcp Switch(config)#ip dhcp relay information trust-all Switch(config)#end Switch#copy running-config startup-config,DHCP relay功能测试实例: AC lan端口开启dhcp server dhcp server1:192.168.20.10-192.168.20.100/24的地址,网关为192.168.20.1。 dhcp server2:192.168.30.10-192.168.30.100/24的地址,网关为192.168.30.1。 AC

20、lan端口地址为192.168.1.228 正确配置交换机和AC使AP获得相应地址并上线。,AC lan,3560G,AP1,AP2,Vlan30,Vlan20,Vlan10,Cisco 3560G配置interface GigabitEthernet0/1 interface Vlan10 switchport access vlan 10 ip address 192.168.1.1 255.255.255.0 switchport mode access ! interface GigabitEthernet0/2 interface Vlan20switchport access vl

21、an 20 ip address 192.168.20.1 255.255.255.0switchport mode access ip helper-address 192.168.1.228 ! interface GigabitEthernet0/3 interface Vlan30switchport access vlan 30 ip address 192.168.30.1 255.255.255.0switchport mode access ip helper-address 192.168.1.228ip routing service dhcp ip dhcp relay

22、information trust-all,AC配置 瘦AP端口地址:192.168.1.228 255.255.255.0 瘦AP端口DHCP: dhcp server1:192.168.20.10-192.168.20.100/24的地址,网关为192.168.20.1。 dhcp server2:192.168.30.10-192.168.30.100/24的地址,网关为192.168.30.1。 静态路由: 目的地址 0.0.0.0 子网掩码 0.0.0.0 下一跳 192.168.1.1,静态路由设置,Switch(config)#ip routing (全局路由)思科默认不开启 S

23、witch(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.1 (静态路由格式: 目的地址 子网掩码 下一跳)静态路由测试实例,AP通过dhcp方式上线,集中转发正常广播SSID AC开启2个虚接口,STA连接vif1,Vif1属于vlan1 地址192.168.10.1/24 ,vif2属于vlan2 地址192.168.20.1/24 3560G 1端口与AC的vif2相连,地址为192.168.20.2/24 3560G 2端口与PC相连,地址为192.168.30.1/24 PC的地址为192.168.30.1/24 网关为19

24、2.168.30.1测试要求: STA正常获得地址并且与PC通信。,Cisco 3560G配置 interface Vlan20 ip address 192.168.20.2 255.255.255.0 interface Vlan30 ip address 192.168.30.1 255.255.255.0 ip route 192.168.10.0 255.255.255.0 192.168.20.1 ip routinginterface GigabitEthernet0/1switchport access vlan 20switchport mode access interfa

25、ce GigabitEthernet0/2switchport access vlan 30switchport mode access,AC开启2个虚接口vif1、vif2,vif1开启dhcp server功能,给STA分配地址,同时将vif1的地址设置为网关。同时配置静态路由 目的地址 192.168.30.0 子网掩码 255.255.255.0 下一跳: 192.168.20.2,测试实例,三层漫游在三层交换机上划分三个VLAN,VLAN10 VLAN20 VLAN30,其管理地址分别为192.168.10.1,192.168.20.1,192.168.1.226,瘦AP通过DHCP

26、的方式获得地址,解析到交换机的地址。,AC配置:AP通过cisco获得地址,通过option43字段信息找到AC并关联上线。 AC设置缺省路由,下一跳指向与lan口相连的cisco端口地址。 AC开启vif与radius 服务器能够正常通信。 瘦AP模板 AP下发相同的模板,STA正常关联后经过802.1x认证。 关联成功后,查看无线终端列表,将未关联的AP信号加强,使STA漫游至与这台AP关联。 STA开启抓包,在发生切换时应该能抓到reassociation的重关联报文。,Cisco 3560G配置,ip dhcp pool vlan20network 192.168.20.0 255.2

27、55.255.0default-router 192.168.20.1 option 43 hex 0108.0104.c0a8.01e4 ! ip dhcp pool vlan10network 192.168.10.0 255.255.255.0default-router 192.168.10.1 option 43 hex 0108.0104.c0a8.01e4 ! interface FastEthernet0/12switchport access vlan 10switchport mode access ! ip routing,interface FastEthernet0/24switchport access vlan 20switchport mode access ! interface Vlan1no ip addressshutdown ! interface Vlan10ip address 192.168.10.1 255.255.255.0 ! interface Vlan20ip address 192.168.20.1 255.255.255.0!,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 实用文档 > 简明教程

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报