思科三层交换机配置总结

合集下载

CISCO三层交换机VLAN配置说明

CISCO三层交换机VLAN配置说明

CISCO三层交换机VLAN配置说明CISCO三层交换机VLAN配置说明。

实验目标:(1) 第一步实现划分4个vlan,将相应port置入到vlan号中(2) 第二步实现4个vlan间可以相互ping(3) 第三步实现sales,tech,manage不可以相互通讯,但允许和server通讯实现过程:第一步划分vlan如下:Switch#vlan dataSwitch(vlan)#vlan 10 name salesVLAN 10 added:Name: salesSwitch(vlan)#vlan 20 name techVLAN 20 added:Name: techSwitch(vlan)#vlan 30 name manageVLAN 30 added:Name: manageSwitch(vlan)#vlan 40 name serverVLAN 40 added:Name: serverSwitch(vlan)#Switch(config)#int range fa 0/0 - 3Switch(config-if-range)#switchport access vlan 10 Switch(config-if-range)#exitSwitch(config)#int range fa 0/4 - 6Switch(config-if-range)#switchport access vlan 20 Switch(config-if-range)#exitSwitch(config)#int range fa 0/7 - 8Switch(config-if-range)#switchport access vlan 30 Switch(config-if-range)#exitSwitch(config)#int fa 0/9Switch(config-if)#switSwitch(config-if)#switchport acceSwitch(config-if)#switchport access vlan 40 Switch(config-if)#exit查看Switch#sh vlan-switchVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/10, Fa0/11, Fa0/12, Fa0/13 Fa0/14, Fa0/1510 sales active Fa0/1, Fa0/2, Fa0/320 tech active Fa0/4, Fa0/5, Fa0/630 manage active Fa0/7, Fa0/840 server active Fa0/91002 fddi-default active第二步实现4个vlan内的服务器互相pingSwitch(config)#int fa 0/0Switch(config-if)#switchport mode trunkRouter(config-if)#exitRouter(config)#int fa 0/0Router(config-if)#no shutRouter(config-if)#no ip addressRouter(config-if)#exitRouter(config)#int fa0/0.1Router(config-subif)#encapsulation dot1Q 10Router(config-subif)#ip addreRouter(config-subif)#ip address 192.168.33.1 255.255.255.0 Router(config-subif)#exitRouter(config)#int fa0/0.2Router(config-subif)#encapsulation dot1Q 20 Router(config-subif)#ip address 192.168.34.1 255.255.255.0 Router(config-subif)#exitRouter(config)#int fa0/0.3Router(config-subif)#encapsulation dot1Q 30 Router(config-subif)#ip address 192.168.35.1 255.255.255.0 Router(config-subif)#exitRouter(config)#int fa0/0.4Router(config-subif)#encapsulation dot1Q 40 Router(config-subif)#ip address 192.168.36.1 255.255.255.0 Router(config-subif)#查看路由器:interface FastEthernet0/0no ip addressduplex autospeed auto!interface FastEthernet0/0.1 encapsulation dot1Q 10ip address 192.168.33.1 255.255.255.0 !interface FastEthernet0/0.2 encapsulation dot1Q 20ip address 192.168.34.1 255.255.255.0 !interface FastEthernet0/0.3 encapsulation dot1Q 30ip address 192.168.35.1 255.255.255.0!interface FastEthernet0/0.4encapsulation dot1Q 40ip address 192.168.36.1 255.255.255.0!测试:VPCS 1 >shNAME IP/CIDR GATEWAY LPORT RPORT PC1 192.168.33.2/24 192.168.33.1 10001 21001PC2 0.0.0.0/0 0.0.0.0 10002 21002PC3 0.0.0.0/0 0.0.0.0 10003 21003PC4 192.168.34.2/24 192.168.34.1 10004 21004PC5 0.0.0.0/0 0.0.0.0 10005 21005PC6 0.0.0.0/0 0.0.0.0 10006 21006PC7 192.168.35.2/24 192.168.35.1 10007 21007PC8 0.0.0.0/0 0.0.0.0 10008 21008PC9 192.168.36.2/24 192.168.36.1 10009 21009 VPCS 1 >ping 192.168.34.2192.168.34.2 icmp_seq=1 timeout192.168.34.2 icmp_seq=2 time=45.000 ms192.168.34.2 icmp_seq=3 time=47.000 ms192.168.34.2 icmp_seq=4 time=43.000 ms192.168.34.2 icmp_seq=5 time=8.000 msVPCS 1 >ping 192.168.35.2192.168.35.2 icmp_seq=1 time=43.000 ms192.168.35.2 icmp_seq=2 time=14.000 ms192.168.35.2 icmp_seq=3 time=8.000 ms192.168.35.2 icmp_seq=4 time=10.000 ms192.168.35.2 icmp_seq=5 time=12.000 msVPCS 1 >ping 192.168.36.2192.168.36.2 icmp_seq=1 timeout192.168.36.2 icmp_seq=2 time=47.000 ms192.168.36.2 icmp_seq=3 time=6.000 ms192.168.36.2 icmp_seq=4 time=10.000 ms192.168.36.2 icmp_seq=5 time=43.000 msOK,这一步也成功了。

Cisco交换机配置总结

Cisco交换机配置总结

Cisco交换机配置总结一、用户及本地、远程登录配置1、创建用户Cisco#configure terminalCisco(config)#username admin secret ****** //建议用secret2、本地验证Cisco(config)#enable secret netadmin3、远程登录Cisco(config)#line vty 0 15Cisco(config-line)#login localCisco(config-line)#logging synchronous //同步显示,可不配二、Vlan配置1、创建vlanCisco(config)#vlan 10Cisco(config-vlan)#name xxx //给vlan取名Cisco(config-vlan)#no shutCisco(config-vlan)#exit2、配置IPCisco(config)#int vlan 10 //进入vlan接口Cisco(config-if)#ip add 192.168.0.254 255.255.255.0 //配IP,二层交换机的非管理vlan不需要配IPCisco(config-if)#no shut3、将多个端口一次性划到一个vlanHRBSH(config)#int range fa0/1 - 16 //进入多个端口HRBSH(config-if-range)#switchport access vlan 10三、Trunk配置HRBSH (config)#int gigabitEthernet 0/1HRBSH (config)#switchportHRBSH (config-if)#switchport trunk encapsulation dot1q //三层交换机需要配置HRBSH (config-if)#switchport mode trunkHRBSH (config-if)#switchport trunk allowed 85,95四、保存配置HRBSH#copy run to configHRBSH#wrHRBSH#copy run tftp //导出配置五、系统维护更改设备名:hostname查看vlan:show vlan查看当前配置:show run查看接口信息:show interface帮助:show ?删除某条配置:no查看arp表: show arp查看mac表:show mac-六、Cisco 2900系列密码破解⒈连接交换机的console口到终端或PC仿真终端。

思科三层交换机简单配置说明

思科三层交换机简单配置说明

首先开机,使用串口线连接交换机。

输入用户名cisco密码cisco然后设定新的密码为3tcloud。

调整交换机到三层模式。

按照说明书设置,连接到交换机,设定本机IP:192.168.1.2 ,访问http:
//192.168.1.254 登录界面如下:
使用用户名cisco密码cisco登录,然后修改新密码为:3tcloud
点击进入Create VLAN菜单
依次添加VLAN
进入Port to VLAN 菜单将网口配置到相关的vlan里
现在的分配情况如下
行政:1~5号市场:5~10号研发(内):11~15号研发(外):16~20号测试1:21~25号
测试2:26~30号产品:31~35号实施:36~40号无线:41~45号主网段:46~52号
进入下一个界面
添加各个网段所使用的虚拟静态IP地址,现在所使用的IP如下:
设置默认VLAN为100VLAN
然后保存相关的配置,重启交换机。

cisco三层交换机配置vlan和DHCP攻略

cisco三层交换机配置vlan和DHCP攻略

cisco三层交换机配置vlan和DHCP攻略ip dhcp pool IT_WEIXIU //配置DHCP服务network 10.42.86.0 255.255.255.224 //配置DHCP网段default-router 10.42.86.30 //DHCP分配网关(应为vlan接口IP)dns-server 10.42.0.82 10.1.2.9 10.1.2.70 //DHCP分配DNSnetbios-name-server 10.1.2.9 10.1.2.70 10.1.2.222 //DHCP分配WINS!vlan 100 //建立vlanname IT_weixiu //vlan命名interface FastEthernet0/25switchport access vlan 100!interface FastEthernet0/26switchport access vlan 100!interface FastEthernet0/27switchport access vlan 100!interface FastEthernet0/28switchport access vlan 100!interface FastEthernet0/29switchport access vlan 100!interface FastEthernet0/30switchport access vlan 100 //端口指定vlan!!interface Vlan100 //配置vlan接口description IT_weixiuip address 10.42.86.30 255.255.255.224 //配置vlan接口IP为网关no ip proxy-arpip ospf 100 area 42 //加入ospf动态路由图(因下方已包含,本条不必要)!interface Vlan200description To_SongZiip address 10.42.85.30 255.255.255.224ip helper-address 10.42.0.16 //指定本网段DHCP服务器为分公司(不指定本条即由本网段内提供DHCP服务或不提供)no ip proxy-arpip ospf 100 area 42 ┗━DHCP服务采用广播协议,故:1不能跨网段;2同一网段只能一台DHCP服务! “ip helper-address”命令即专用来解决DHCP不能跨网段问题。

cisco路由器三层交换机简单环境配置实例

cisco路由器三层交换机简单环境配置实例

cisco路由器三层交换机简单环境配置实例随着Internet的高速发展,网络规模不断膨胀,对于从事网络专业的学生熟练掌握路由器和交换机的配置已显得十分重要。

接下来是小编为大家收集的cisco路由器三层交换机简单环境配置实例方法,希望能帮到大家。

cisco路由器三层交换机简单环境配置实例:一、网络拓扑图:二、配置命令:1、路由器的配置:interface FastEthernet0/0ip address 10.66.88.222 255.255.255.0ip nat outsideduplex autospeed autointerface FastEthernet0/1ip address 192.168.1.1 255.255.255.0ip nat insideduplex autospeed autointerface Vlan1no ip addressshutdownip nat inside source list 1 interface FastEthernet0/0 overload ip classlessip route 192.168.2.0 255.255.255.0 192.168.1.222ip route 192.168.3.0 255.255.255.0 192.168.1.222access-list 1 permit 192.168.0.0 0.0.255.255三、三层交换机的配置:hostname L3-SWip dhcp pool vlan2poolnetwork 192.168.3.0 255.255.255.0 default-router 192.168.3.1dns-server 202.101.172.35ip dhcp pool vlan1poolnetwork 192.168.2.0 255.255.255.0 default-router 192.168.2.1dns-server 202.101.172.35interface FastEthernet0/1no switchportip address 192.168.1.222 255.255.255.0 duplex autospeed autointerface FastEthernet0/2 switchport mode trunkinterface FastEthernet0/5 switchport mode trunkinterface Vlan1ip address 192.168.2.1 255.255.255.0 interface Vlan2ip address 192.168.3.1 255.255.255.0 ip classlessip route 0.0.0.0 0.0.0.0 192.168.1.1四、二层交换机的配置:1、switch0的配置:hostname sw0interface FastEthernet0/1 switchport mode trunkinterface FastEthernet0/2 switchport mode access2、switch1的配置:hostname sw1interface FastEthernet0/1switchport mode trunkinterface FastEthernet0/2switchport access vlan 2switchport mode access看了“cisco路由器三层交换机简单环境配置实例”还想看:1.思科交换机基本配置实例讲解2.三层交换机配置的实例教程3.cisco路由器怎么在虚拟环境下配置三层交换4.cisco2960交换机的简单配置5.交换机配置基础及实例讲解6.思科三层交换机与路由器的比较方法7.思科交换机配置教程详解。

思科三层交换机配置总结

思科三层交换机配置总结

思科三层交换机配置总结思科交换机的基本配置命令学习CISCO交换机基本配置:Console端口连接用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname csico ;设置交换机的主机名switch(config)#enable secret csico1 ;设置特权加密口令switch(config)#enable password csico8 ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;虚拟终端允许登录switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6switch#exit ;返回命令交换机VLAN创建,删除,端口属性的设置,配置trunk端口,将某端口加入vlan中,配置VTP:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名为vlan3 switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config)#speed ? 查看speed命令的子命令switch(config)#speed 100 设置该端口速率为100mb/s (10/auto)switch(config)#duplex ? 查看duplex的子命令switch(config)#duplex full 设置该端口为全双工(auto/half)switch(config)#description TO_PC1 这是该端口描述为TO_PC1 switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为trunk模式(access模式)switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain vtpserver ;设置vtp域名相同switch(config)#vtp password ;设置发vtp密码switch(config)#vtp server ;设置vtp服务器模式switch(config)#vtp client ;设置vtp客户机模式交换机设置IP地址,默认网关,域名,域名服务器,配置和查看MAC地址表:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;设置IP地址switch(config)#ip default-gateway 192.168.1.6 ;设置默认网关switch(config)#ip domain-name /doc/0113809409.html, 设置域名switch(config)#ip name-server 192.168.1.18 设置域名服务器switch(config)#mac-address-table? 查看mac-address-table 的子命令switch(config)#mac-address-table aging-time 100 设置超时时间为100msswitch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址在f0/3端口switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入静态地址目标端口f0/6源端口f0/7 switch(config)#endswitch#show mac-address-table 查看整个MAC地址表switch#clear mac-address-table restricted static 清除限制性静态地址交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息switch#show int f0/0 status;查看指定端口状态switch#dir flash: ;查看闪存Cisco路由器配置命令大全网络2010-06-26 06:43:44 阅读657 评论0 字号:大中小订阅 .(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号"全局配置模式----线控模式,使用命令"line+接口类型+接口号"注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAM write 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息 + # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

2024版思科网络交换机配置命令详细总结归纳

使用`interface`命令进入接口配置模式, 如`interface FastEthernet 0/1`进入 FastEthernet 0/1接口。
VLAN间路由配置
01 02 03 04
使用`interface`命令进入三层接口配置模式,如`interface vlan 10`进入 VLAN 10的三层接口。
源端口和目的端口散列
同时考虑数据包的源端口和目的端口进行负载均衡。
配置负载均衡策略
在全局配置模式下使用`port-channel load-balance`命令进行配置。
端口聚合故障排除技巧
01
检查物理连接
确保所有参与聚合的物理端口都已 正确连接。
03
检查交换机配置
确认交换机的配置是否正确,包括 聚合模式、聚合组号等。
限制登录用户
指定允许通过SSH远程登录的用户或用户组。
交换机日志与审计功能启用
启用日志功能
将交换机操作记录到日志文件中,方便后续 审计和分析。
远程日志服务器
将日志文件发送到远程日志服务器进行集中 存储和管理。
配置日志级别
根据需要设置日志记录的详细程度(如信息、 警告、错误等)。
审计功能
启用审计功能,对特定操作进行实时监控和 记录。
思科网络交换机配置命令详细 总结归纳
目 录
• 交换机基本配置 • VLAN配置与管理 • 生成树协议(STP)配置与优化 • 端口聚合(EtherChannel)配置与应用 • 交换机安全性设置与加固 • 交换机性能监控与故障排除
01
交换机基本配置
交换机登录与访问控制
1 2
通过控制台端口登录 使用终端仿真软件通过控制台端口连接到交换机, 输入用户名和密码进行登录。

三层交换机路由功能配置实验总结

三层交换机路由功能配置实验总结三层交换机作为一种网络交换设备,除了基本的交换功能外,还具备了路由功能。

在网络中,路由功能是至关重要的,因为它可以实现不同子网之间的通信。

本文将介绍如何通过三层交换机实现路由功能,并进行实验总结。

一、实验环境本次实验环境如下:1. 三台计算机,分别连接在三个不同的子网中,IP地址分别为:- 192.168.1.2/24- 192.168.2.2/24- 192.168.3.2/242. 三层交换机,具备路由功能,连接以上三个子网。

二、实验步骤1. 配置三层交换机的接口IP地址三层交换机需要为每个接口分配IP地址,以便能够在不同的子网之间进行路由转发。

在本次实验中,我们需要为三个接口分别配置IP 地址:- 接口 VLAN 1:192.168.1.1/24- 接口 VLAN 2:192.168.2.1/24- 接口 VLAN 3:192.168.3.1/24可以通过以下命令进行配置:```interface vlan 1ip address 192.168.1.1 255.255.255.0no shutdowninterface vlan 2ip address 192.168.2.1 255.255.255.0no shutdowninterface vlan 3ip address 192.168.3.1 255.255.255.0no shutdown```2. 配置路由为了实现不同子网之间的通信,需要在三层交换机中配置路由。

在本次实验中,我们需要将两个子网之间的路由添加到路由表中。

假设需要从192.168.1.0/24子网中的计算机访问192.168.3.0/24子网中的计算机,需要将192.168.3.0/24子网的路由添加到路由表中。

可以通过以下命令进行配置:```ip route 192.168.3.0 255.255.255.0 192.168.2.2```其中,192.168.3.0 255.255.255.0表示需要访问的目标子网,192.168.2.2表示下一跳路由器的IP地址。

Cisco三层交换机配置命令及解释

Cisco三层交换机配置命令及解释1、2、DEBUG命令3、思科交换机⽇志管理查看⽇志:show loggingCisco交换机 SNMP配置——————————————————————————————————————基本配置S> enable 进⼊特权模式S# configure terminal 进⼊全局配置模式S(config)# hostname name 改变交换机名称S(config)# enable password level level_# password 设置⽤户⼝令(level_#=1)或特权⼝令(level_#=15)S(config)# line console 0 进⼊控制台接⼝S(config-line)# password console_password 接上⼀条命令,设置控制台⼝令S(config)# line vty 0 15 进⼊虚拟终端S(config-line)# password telnet_password 接上⼀条命令,设置Telnet⼝令S(config-line)# login 允许Telnet登录S(config)# enable password|secret privilege_password 配置特权⼝令(加密或不加密)S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进⼊接⼝⼦配置模式S(config-if)# [no] shutdown 关闭或启⽤该接⼝(默认启⽤)S(config)# ip address IP_address sunbet_mask 指定IP地址S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认⽹关S# show running-config 查看当前的配置S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中S> show interface [type slot_#/port_#] 查看所有或指定接⼝的信息S> show ip 显⽰交换机的IP配置(只在1900系列上可⽤)S> show version 查看设备信息S# show ip interface brief 验证IP配置S(config-if)# speed 10|100|auto 设置接⼝速率S(config-if)# duplex auto|full|half 设置接⼝双⼯模式S> show mac-address-table 查看CAM表S# clear mac-address-table 清除CAM表中的动态条⽬1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM表中创建静态条⽬2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中创建静态条⽬1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface 设置静态端⼝安全措施1900(config-if)# port secure 启⽤粘性学习1900(config-if)# port secure max-mac-count value 设置粘性学习特性能够学到的地址数量(默认132,取值范围是1-132)1900(config)# address-violation suspend|ignore|disable 改变安全选项1900> show mac-address-table security 验证端⼝安全措施2950(config)# switchport mode access 定义接⼝为主机端⼝⽽不是中继端⼝2950(config)# switchport port-security 启⽤端⼝安全措施2950(config)# switchport port-security maximum value 指定可与此接⼝相关的设备的最⼤数量2950(config)# switchport port-security violation protect|restrict|shutdown 指定出现安全违规时应该发⽣的事2950(config)# switchport port-security mac-address MAC_address 指定允许与此接⼝相关的确切的MAC地址2950(config)# switchport port-security mac-address sticky 启⽤粘性学习特性2950(config)# show port interface type [slot_#/] port_# 验证接⼝配置2950(config-if) description name 设置接⼝描述信息2950# show buffers 查看系统缓存的⼤⼩1900# copy nvram tftp:// IP_address_of_TFTP_server/ file_name 将配置⽂件备份到TFTP服务器上1900# copy tftp:// IP_address_of_TFTP_server/ file_name nvram 从TFTP服务器上恢复配置到NVRAM1900# delete nvram 删除配置⽂件2950# erase startup-config 删除配置⽂件3550# show tcam qos TCAM_ID statistics 查看TCAM剩余容量4000> enable 进⼊特权模式4000>(enable) set password 设置⽤户模式密码4000>(enable) set enablepass 设置授权密码4000>(enable) set interface sc0 IP_address mask 配置IP地址4000>(enable) set port enable|disable slot_#/port_# 启⽤/禁⽤接⼝4000>(enable) show port [slot_#/port_#] 显⽰接⼝信息4000>(enable) set port name slot_#/port_# name 设置交换机接⼝描述信息4000>(enable) set port speed slot_#/port_# 4|10|16|100|auto 设置交换机接⼝速率4000>(enable) set port duplex slot_#/port_# full|half 设置交换机接⼝双⼯模式4000>(enable) clear config all 删除NVRAM中的配置信息4000>(enable) erase all 删除FLASH中的内容4000>(enable) show flash 显⽰FLASH中的内容4000>(enable) show cam [count] dynamic|static|permanent|system [vlan_#] 显⽰CAM表VLAN 1900(config)# vtp domain VTP_domain_name 定义交换机域名1900(config)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)1900(config)# vtp password VTP_password 配置VTP⼝令1900(config)# vtp pruning enable|disable 启⽤/禁⽤修剪(默认启⽤)1900(config)# vtp trap enable 启⽤SNMP陷阱(默认启⽤)1900# show vtp 验证VTP配置2950# vtp database 访问VLAN和VTP配置(以下均是在IOS12.1前⽤,12.1后全是在全局配置模式下)2950(vlan)# vtp domain VTP_domain_name 定义交换机域名2950(vlan)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)2950(vlan)# vtp password VTP_password 配置VTP⼝令2950(vlan)# vtp pruning 启⽤/禁⽤修剪(默认启⽤)2950(config)# snmp-server enable traps vtp 启⽤SNMP陷阱(默认启⽤)2950# show vtp status 检查VTP配置2950# show vtp counters 显⽰与VTP消息发送与接收相关的VTP统计信息1900(config-if)# trunk on|off|desirable|auto 指定中继类型1900# show trunk A|B 验证接⼝中继(A是fa0/26,B是fa0/27)2950(config-if)# switchport mode trunk|dynamic desirable|dynamic auto|nonegotiate 指定中继类型(默认⾃动协商)2950(config-if)# switchport trunk native|allowed|pruning vlan VLAN_# 配置中继2950(config-if)# switchport trunk pruning vlan remove VLAN_# 清除不希望消减的VLAN2950# show interfaces [type 0/port_#] switchport|trunk 验证接⼝中继1900(config)# vlan VLAN_# [name VLAN_name] 创建VLAN1900(config-if)# vlan-membership static VLAN_# 将该接⼝静态地分配给⼀个VLAN1900# show vlan 验证VLAN1900# show vlan-membership 查看VLAN成员关系1900# show spantree [VLAN_#] 查看VLAN的STP信息2950# vlan database 进⼊VLAN数据库(ISO12.1前⽤)2950(vlan)# vlan VLAN_# [name VLAN_name] 创建VLAN2950(config)# vlan VLAN_# 进⼊VLAN数据库(ISO12.1后⽤)2950(config-vlan)# name VLAN_name 创建VLAN2950(config-if)# switchport mode access 指定连接是接⼊链路连接2950(config-if)# switchport access vlan VLAN_# 指定VLAN是接⼊链路连接4000>(enable) set vlan VLAN_# name VLAN_name 配置VLAN4000>(enable) set vlan VLAN_# slot_#/port_#-port_# 为VLAN分配端⼝4000>(enable) set trunk slot_#/port_# [on|off|desirable|auto|nonegotiate] [VLAN_#] [isl|dot1q|dot10|lane|negotiate] 配置中继4000>(enable) clear trunk slot_#/port_# VLAN_# 删除VLAN4000>(enable) show trunk slot_#/port_# 验证中继端⼝4000>(enable) set vtp v2 enable 配置VTPv24000>(enable) set vtp [domain name] [mode client|server|transparent] [passwd password] [pruning enable|disable] [v2 enable|disable] 设置VTP4000>(enable) show vtp domain 验证VTP域的信息4000>(enable) show vtp statistics 显⽰发出或收到的VTP通告信息的摘要内容4000>(enable) set vtp pruneeligible VLAN_# 设置VTP消减4000>(enable) clear vtp pruneeligible VLAN_# 清除不希望消减的VLANSTP 4000>(enable) set spantree enable|disable VLAN_# 启⽤/禁⽤STP(默认启⽤)2950(config)# [no] spanning-tree vlan VLAN_# 启⽤/禁⽤STP(默认启⽤)4000>(enable) show spantree [VLAN_#] 验证STP状态2950# show spanning-tree 验证STP状态4000>(enable) set spantree root [secondary] VLAN_# [dia network_diameter] [hello hello_time] 设置主根节点桥、备份节点桥、最⼤桥数量(2-7)、持续时间(1-10,默认2)4000>(enable) set spantree portcost slot_#/port_# cost_# 设置端⼝开销2950(config-if)# spanning-tree cost cost_# 设置端⼝开销4000>(enable) set spantree portpri slot_#/port_# priority_# 设置端⼝优先级4000>(enable) set spantree portvlanpri slot_#/port_# priority_# [VLAN_#] 改变VLAN的优先级设置2950(config-if)# spanning-tree vlan VLAN_# port-priority priority_# 设置端⼝优先级4000>(enable) set spantree fwddelay delay_# [VLAN_#] 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)4000>(enable) set spantree hello interval_time [VLAN_#] 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)4000>(enable) set spantree maxage agingtime [VLAN_#] 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)2950(config)# spanning-tree vlan VLAN_# forward-time forward_time 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)2950(config)# spanning-tree vlan VLAN_# hello-time hello_time 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)2950(config)# spanning-tree vlan VLAN_# max-age maxage 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)4000>(enable) set port channel slot_#/port_# on 建⽴以太通道集合4000>(enable) show port capabilities slot_#/port_# 查看端⼝的配置4000>(enable) show port channel 验证以太通道集合的配置2950(config-if)# channel-group group_number mode auto|desirable|on 建⽴以太通道集合2950# show etherchannel group_number|brief|detail|load-balance|port|port-channel|summary 验证以太通道集合的配置4000>(enable) set spantree portfast slot_#/port_# enable 配置PortFast2950(config-if)# spanning-tree portfast 配置PortFast4000>(enable) set spantree uplinkfast enable|disable [rate station_update_rate] [all-protocols off|on] 启⽤/禁⽤UplinkFast4000>(enable) show spantree uplinkfast 验证UplinkFast配置2950(config)# spanning-tree uplinkfast [max_update_rate] 启⽤/禁⽤UplinkFast2950# show spanning-tree uplinkfast 验证UplinkFast配置4000>(enable) set spantree backbonefast enable|disable 启⽤/禁⽤BackboneFast4000>(enable) show spantree backbonefast 验证BackboneFast配置2950(config)# spanning-tree backbonefast 启⽤BackboneFast虚拟⽹间路由2600(config)# interface type slot_#/port_#.subint_number 配置⼦接⼝2600(config-subif)# encapsulation dot1q|isl|sde|tr-isl VLAN_# 配置封装类型4000>(enable) show module 查看交换机的硬件配置4000>(enable) session module_# 访问L3SML3SM(config-if)# mac-address mac_address 分配MAC地址MLS 2600(config)# mls rp ip 启动MLS2600(config-if)# mls rp vtp-domain domain_name 分配路由器接⼝到VTP域中2600(config-if)# mls rp vlan-id VLAN_# 向接⼝分配VLAN2600(config-if)# mls rp management-interface 指定该接⼝为管理接⼝2600# show mls rp 提供全局MLS信息2600# show mls rp interface type slot_#/port_# 提供指定接⼝的MLS信息2600# show mls rp vtp-domain domain_name 提供VTP域的MLS信息6500>(enable) set mls enable 在MLS-SE上启动MLS6500>(enable) set mls include rp_ip_address 告诉交换机哪⼀个IP地址是正确的6500>(enable) show mls include 显⽰外部路由处理器的IP地址列表6500>(enable) set mls flow [destination|destination-source|full] 告诉MLS交换机要缓存候选数据包的哪些信息6500>(enable) show mls entry 显⽰第三层缓存表6500>(enable) set mls agingtime aging_time 改变缓存的衰⽼时间(默认256秒,取值范围是8-2032秒中的8的倍数值)6500>(enable) set mls agingtime fast fast_aging_time pkt_threshold 改变快速衰⽼周期和数据包门限值6500>(enable) show mls ip 验证MLS-SE的配置6500>(enable) clear mls entry [destination IP_address] [source IP_address] [flow protocol] [source_port] [destination_port] [all] 删除所有或指定MLS缓存记录3550(config)# ip routing 启动IP路由3550(config)# ip cef 启动CEF3550(config-if)# no switchport 将第⼆层接⼝转换为第三层接⼝3550(config-if)# ip route-cache cef 在接⼝上启动CEF3550# show ip cef 验证CEF组播3640(config)# ip multicast-routing 启动路由器上的组播服务3640(config-if)# ip pim dense-mode 将接⼝设置为PIM密集模式3640(config-if)# ip pim sparse-mode 将接⼝设置为PIM稀疏模式3640(config-if)# ip pim sparsed-dense-mode 将接⼝设置为PIM稀疏-密集模式3640(config)# ip pim rp-address IP_address group_ACL_# [override] ⼿⼯配置RP3640(config)# ip pim send-rp-announce type slot_#/port_# scope ttl_value group-list ACL_# 通告RP组的分配3640(config)# ip pim send-rp-discovery scope ttl_value 配置RP映射代理3640(config-if)# ip multicast ttl-threshold ttl_value 设置TTL门限值3640(config-if)# ip igmp join-group group_address 加⼊组播组3640# show ip mroute 查看组播信息3640# ping 验证RP之间或其他组播路由器之间的连接3640# mtrace source_IP_address [destination_IP_address] [group] 组播traceroute3640(config-if)# ip cgmp 配置CGMP路由器4000>(enable) set cgmp enable 启动CGMP4000>(enable) show cgmp statistics 查看CGMP统计信息4000>(enable) show multicast group cgmp 查看交换机了解到的组播组信息4000>(enable) set cgmp leave enable 检查由客户端产⽣的IGMPv2的离开信息4000>(enable) set igmp enable 启动IGMP4000>(enable) ip igmp snooping 启动IGMP探听4000>(enable) set igmp fastleave enable 启动快速离开过程4000>(enable) show igmp statistics 显⽰交换机上IGMP探听的状态信息QoS 2950(config)# wrr-queue cos-map queue_ID cos_value 建⽴队列2950(config)# wrr-queue bandwidth bandwidth_value 设置队列门限2950(config)# class-maps name 定义对信息传输分类时的匹配标准2950(config-cmap)# match access-group ACL_# 识别被分类的信息传输2950(config)# policy-map name 确定为接⼊信息传输所设置的分类标准2950(config-pmap)# class name2950(config-pmap-c)# set ip dscp number2950(config-if)# service-policy input name 对该接⼝应⽤策略3550(config)# mls qos 启动QoS3550(config-if)# auto qos voip 在接⼝上启动⾃动服务质量3550(config)# priority-list priority_queue_# protocol protocol high|medium|normal|low [list ACL_#] 为优先级队列定义信息流3550(config)# priority-list priority_queue_# queue-limit limit_# 定义特定优先级队列的最⼤队列空间3550(config-if)# priority-group priority_queue_# 向特定输出接⼝分配优先级队列3550(config)# queue-list queue_list_# interface type slot_#/port_# queue_number 为⼀个特定的定制队列定义信息流3550(config)# queue-list queue_list_# queue queue_number byte-count size_in_bytes [limit number_of_queue] 为特定的定制队列定义队列的最⼤空间3550(config-if)# custom-queue-list custom_queue_number 为特定的输出接⼝分配优先级队列4840(config)# ip slb serverfarm serverfarm_name 配置SLB冗余4840(config-slb-sfarm)# real IP_address [port_#] 指定虚拟IP地址4840(config-slb-sfarm)# inservice 启动服务器4840(config)# virtual IP_address [network_mask] tcp|udp [port_number|wsp|wsp-wtp|wsp-wtls|wsp-wtp-wtls] [service service_name] 建⽴虚拟服务器IP地址h。

配置思科三层交换的综合案例

配置思科三层交换的综合案例网络基本情况网络拓扑结构为:中心交换机采用Cisco Catalyst 4006-S3,Supervisor Engine III G引擎位于第1插槽,用于实现三层交换;1块24口1000Base-T模块位于第2插槽,用于连接网络服务器;1块6端口1000Base-X模块位于第3插槽,用于连接6台骨干交换机。

一台交换机采用Cisco Catalyst 3550-24-EMI,并安装1块1000Base-X GBIC千兆模块。

一台交换机采用Cisco Catalyst 3550-24-SMI,也安装1块1000Base-X GBIC千兆模块。

另外四台交换机采用Cisco Catalyst 2950G-24-SMI,安装1块1000Base-T GBIC千兆模块。

所有服务器划分为一个VLAN,即VLAN 50。

四台Catalyst 2950G-24-SMI交换机也只划分为一个VLAN,分别为VLAN 60、VLAN 70、VLAN 80和VLAN 90。

Catalyst 3550-24-EMI划分为4个VLAN,分别为VLAN 10、VLAN 20、VLAN 30和VLAN 40。

Catalyst 3550-24-SMI划分2个VLAN,分别为VLAN 60和VLAN 80,与另外两台Catalyst 2950G-24-SMI交换机分别位于同一VLAN。

***************************实例分析****************************由于所有Catalyst 2950G交换机都是一个独立的VLAN,因此,必须先在这些交换机上创建VLAN(VLAN 60~VLAN 90),并将所有端口都指定至该VLAN。

然后,再在Catalyst 4006交换机相应端口上分别创建VLAN。

Catalyst 4006的1000Base-X端口分别与各Catalyst 2950G的1000Base-X端口连接。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

思科交换机的基本配置命令学习CISCO交换机基本配置:Console端口连接用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname csico ;设置交换机的主机名switch(config)#enable secret csico1 ;设置特权加密口令switch(config)#enable password csico8 ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;虚拟终端允许登录switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6switch#exit ;返回命令交换机VLAN创建,删除,端口属性的设置,配置trunk端口,将某端口加入vlan中,配置VTP:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名为vlan3switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config)#speed ? 查看speed命令的子命令switch(config)#speed 100 设置该端口速率为100mb/s (10/auto)switch(config)#duplex ? 查看duplex的子命令switch(config)#duplex full 设置该端口为全双工(auto/half)switch(config)#description TO_PC1 这是该端口描述为TO_PC1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为trunk模式(access模式)switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain vtpserver ;设置vtp域名相同switch(config)#vtp password ;设置发vtp密码switch(config)#vtp server ;设置vtp服务器模式switch(config)#vtp client ;设置vtp客户机模式交换机设置IP地址,默认网关,域名,域名服务器,配置和查看MAC地址表:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;设置IP地址switch(config)#ip default-gateway 192.168.1.6 ;设置默认网关switch(config)#ip domain-name 设置域名switch(config)#ip name-server 192.168.1.18 设置域名服务器switch(config)#mac-address-table? 查看mac-address-table的子命令switch(config)#mac-address-table aging-time 100 设置超时时间为100msswitch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址在f0/3端口switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入静态地址目标端口f0/6源端口f0/7switch(config)#endswitch#show mac-address-table 查看整个MAC地址表switch#clear mac-address-table restricted static 清除限制性静态地址交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息switch#show int f0/0 status;查看指定端口状态switch#dir flash: ;查看闪存Cisco路由器配置命令大全网络 2010-06-26 06:43:44 阅读657 评论0 字号:大中小订阅 .(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号"全局配置模式----线控模式,使用命令"line+接口类型+接口号"注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息 + # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

相关文档
最新文档