思科三层交换机配置总结
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交换机配置总结一、用户及本地、远程登录配置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攻略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路由器三层交换机简单环境配置实例随着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版思科网络交换机配置命令详细总结归纳
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端口连接。
2、思科模拟器 实验二(三层交换机VLAN配置)hao
思科模拟器三层交换机VLAN配置一、实验拓扑图:交换机switch 1的端口fei_0/1和交换机switch 2的端口fei_0/1属于VLAN 10;交换机switch 1的端口fei_0/2和交换机switch 2的端口fei_0/2属于VLAN 20,均为Access端口。
两台交换机通过端口fei_0/16以Trunk方式连接,两端口为Trunk端口。
二、操作步骤:1、在switch 1上配置VLAN10和VLAN20,VLAN10的成员包括fei_0/1和上行端口fei_0/16,VLAN20的成员包括fei_0/2上行端口fei_0/16。
2、在switch 2上配置VLAN10和VLAN20,VLAN10的成员包括fei_0/1和上行端口fei_0/16,VLAN20的成员包括fei_0/2和上行端口fei_0/16。
switch 1配置命令如下:ZXR10>enableZXR10#vlan database------在特权模式下配置VLAN数据库ZXR10(vlan)#vlan 10-------创建VLAN 10ZXR10(vlan)#vlan 20------创建VLAN 20ZXR10(vlan)#exitZXR10#configure terminalZXR10(config)#1、进入端口fei_0/1,把端口fei_0/1加入vlan 10,fei_0/1模式为access;ZXR10(config)#interface fastethernet 0/1ZXR10(config-if)#switchport mode accessZXR10(config-if)#switchport access vlan 10ZXR10(config-if)#exit2、进入端口fei_0/2,把端口fei_0/2加入vlan 20,fei_0/2模式为access;ZXR10(config)#interface fastethernet 0/2ZXR10(config-if)#switchport mode accessZXR10(config-if)#switchport access vlan 20ZXR10(config-if)#exit3、进入fei_0/16端口,将该端口设置成trunk模式,并且把端口fei_0/16以trunk模式加入vlan10,vlan 20ZXR10(config)#interface fastethernet 0/16ZXR10(config-if)#switchport mode trunkZXR10(config-if)#switchport trunk allowed vlan 10,20ZXR10(config-if)#endZXR10#write---------保存文件(备注:switch 2配置命令同switch 1一样)三、验证方法:1. PC-1和PC-2不能互通,PC-3和PC-4不能互通2. PC-1和PC-3互通,PC-2和PC-4互通。
思科三层交换机配置
思科三层交换机配置思科三层交换机配置为解决vlan间的路由问题,我们引进三层交换概念,它被大家称为二层交换+三层转发。
三层交换机相当于多个专门处理vlan间路由的多个单臂路由和交换的集成。
三层交换机的转发原理三层交换机通过硬件来交换和路由选择数据包。
为处理数据包的高层信息,三层交换有两种体系结构:1> 传统的MLS(Multilayer Switching)依靠ASIC(Application-Specific Integrated Circuit)对数据流的第一个数据包进行路由处理后,第三层引擎对硬件交换组件进行程序处理为后续数据包提供路由。
产生MLS条目记录,一次路由多次交换。
2> 基于CEF(Cisco Express Forwarding)的MLSCEF是基于拓扑的转发模型,它预先将所有路由信息加入到转发信息库(FIB),方便快速路由。
基本概念有:转发信息库(FIB):类似路由表,记录IP与vlan的对应关系邻接关系表:类似mac地址表,记录相邻接口所连接主机的'mac 地址虚接口:不依赖物理接口的子接口,开启vlan配置网关,属于该vlan的物理接口即可动态充当vlan的网关三层交换机配置三层交换机的接口默认是二层接口,命令switchport 转换为三层接口,相反no switchport将路由接口转为交换接口。
以下面模拟图配置为例。
配置步骤:1>在二层交换机上创建vlan,并分配端口,f0/0端口配置trunk(命令略)2>在三层交换机上创建vlan,并配置trunk指定接口封装方式SW_3L(config)# int f0/0SW_3L(config-if)# switchport trunk encapsulation dot1qSW_3L(config-if)# switchport mode trunk3> 在三层交换机上配置各vlan的ip地址SW_3L(config)# int vlan 10SW_3L(config-if)# ip add 192.168.1.1 255.255.255.0SW_3L(config-if)# no shvlan20和vlan30略4> 三层交换机启用路由,配置接口ipSW_3L(config)# ip routingSW_3L(config)# int f1/0SW_3L(config-if)# no switchportSW_3L(config-if)# ip add 10.1.1.1 255.255.255.248SW_3L(config-if)# no sh5> 为三层交换机配置默认路由SW_3L(config)# ip route 0.0.0.0 0.0.0.0 10.1.1.2经过上面配置,在对客户机设置ip和网关,不同vlan间已经可以正常通信。
cisco3750三层交换机配置说明
cisco3750三层交换机配置说明三层交换机可以通过Telnet方式或超级终端方式连上,第一次使用的三层交换机需要进行配置,具体步骤如下:1)、用Cisco 3750三层交换机自带的一条串行电缆将其Console口与1台维护笔记本的串口(需要知道是Com1还是Com2)相连。
2)在维护笔记本上执行以下操作:“开始→程序→附件→通讯→超级终端”,在“连接描述”对话框的名称一栏中输入“cisco3750”(此名字没有实际意义,可以随便输入),创建一个叫做"cisco3750"的新连接,点击"确定",缺省的使用COM1(根据维护计算机连接的端口选择),在"串口设置"中将波特率改为9600波特,其他参数不变,点击"确定"就可以得到三层交换机的控制台。
3)、设置结束,打开三层交换机电源,就会出现三层交换机的启动信息。
这时就可以像在终端一样对三层交换机进行操作了。
此时不要进行任何操作,以免破坏三层交换机的启动进程,直到三层交换机出现了:“Copyright (c) 1986-2006 by Cisco Systems, Inc.Compiled Fri 28-Jul-06 08:46 by yenanh”回车,提示“Would you like to terminate autoinstall? [yes]:”是否要终止自动安装,输入N,进入配置页面:“--- System Configuration Dialog ---Would you like to enter the initial configuration dialog? [yes/no]:”输入N,选择不需要,提示“Switch>00:14:58: %LINK-5-CHANGED: Interface Vlan1, changed state to administratively down”,出现“switch>”就可以输入命令进行配置。
思科设备三层交换机的vlan间通信配置
思科设备三层交换机的vlan间通信配置本次主要讲解三层交换实现vlan间的相互通信:本例配置模型图命令行:swA配置命令:Switch>enableSwitch#vlan database //进入vlan配置模式% Warning: It is recommended to configure VLAN from config mode, as VLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode.Switch(vlan)#vlan 2 name TztA //在swA上创建vlan 2 名为TztA VLAN 2 added: Name: TztASwitch(vlan)#vlan 3 name TztB //在swA上创建vlan 3 名为TztB VLAN 3 added: Name: TztBSwitch(vlan)#exitAPPLY completed.Exiting....Switch#conf tEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#int f0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 2 //将f0/2划分给vlan 2Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 3 //将f0/3划分给vlan 3Switch(config-if)#exitSwitch(config)#int f0/1Switch(config-if)#switchport mode trunk //配置与三层设备连接的f0/1为trunk模式%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#switchport trunk allowed vlan all //允许所有vlan通过f0/1端口Switch(config-if)#exitSwitch(config)#exitSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch#wrBuilding configuration... [OK]Switch#(三层交换机)M sw命令配置:Switch>Switch>enableSwitch#vlan database //进入vlan配置模式% Warning: It is recommended to configure VLAN from config mode, as VLAN database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode.Switch(vlan)#vlan 2 name TztA //在Msw上创建vlan 2 名为TztAVLAN 2 added:Name: TztASwitch(vlan)#vlan 3 name TztB //在Msw上创建vlan 2 名为TztAVLAN 3 added:Name: TztBSwitch(vlan)#exitAPPLY completed.Exiting....Switch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/1Switch(config-if)#switchport mode trunk //配置三层设备与二层设备连接的f0/1为trunk模式Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.Switch(config-if)#switchport trunk allowed vlan all //允许所有vlan通过f0/1端口Switch(config-if)#no shutdown //激活端口Switch(config-if)#exit Switch(config)#ip routing //使用三层设备的路由功能Switch(config)#int vlan 2 //进入vlan 2配置模式虚拟端口%LINK-5-CHANGED: Interface Vlan2, changed state to upSwitch(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up Switch(config-if)#ip address 192.168.1.1 255.255.255.0 //配置vlan 2的ip地址Switch(config-if)#no shutdown //激活端口Switch(config-if)#exitSwitch(config)#int vlan 3 //配置vlan 3虚拟端口Switch(config-if)#%LINK-5-CHANGED: Interface Vlan3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to up Switch(config-if)#ip address 192.168.2.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#do show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.1.0/24 is directly connected, Vlan2 //上述的配置成果C 192.168.2.0/24 is directly connected, Vlan3Switch(config)#Switch(config)#exit Switch#%SYS-5-CONFIG_I: Configured from console by console Switch#wrBuilding configuration...[OK]以上配置结束完成后,两台PC能够相互通信(如图):注意:通信基础需要配置网关本次讲解结束!。
思科VLAN:STP配置、测试与总结实验
STP配置1、左上角交换机配置vlan10,11,12:Switch(config)#vlan 10Switch(config-vlan)#vlan 11Switch(config-vlan)#vlan 12Switch(config-vlan)#Switch(config-vlan)#int f0/1Switch(config-if)#switchport trunk encapsulation dot1q //思科三层交换机必须封装dot1q,才能设置trunk链路Switch(config-if)#switchport mode trunkSwitch(config-if)#int f0/2Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#int f0/11Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 11Switch(config-if)#int f0/12Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 12Switch(config)#int vlan 10Switch(config-if)#Switch(config-if)#ip add 192.168.10.1 255.255.255.0Switch(config-if)#int vlan 11Switch(config-if)#Switch(config-if)#ip add 192.168.11.1 255.255.255.0Switch(config-if)#int vlan 12Switch(config-if)#ip add 192.168.12.1 255.255.255.0开启路由功能(三层交换机默认路由关闭)Switch>enSwitch#conf terEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#ip routing2、右上角交换机配置:Switch(config)#int f0/3Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunkSwitch(config)#int f0/1Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunkSwitch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)#3、最下面的交换机配置vlan10,11,12:Switch>enSwitch#conf terEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10Switch(config-vlan)#vlan 11Switch(config-vlan)#vlan 12Switch(config-vlan)#int f0/10Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#int f0/11Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 11Switch(config-if)#int f0/12Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 12Switch(config-if)#此时让vlan10中两个计算机互ping会出现Ping不通的问题将右上角交换机的f0/1关闭后再重新ping正常Switch(config-if)#int f0/1Switch(config-if)#shutdown下面配置STP4、左上角交换机配置vlan10,vlan11为主根,vlan12为次根Switch>enSwitch#conf terSwitch(config)#spanning-tree vlan 10 priority 0Switch(config)#spanning-tree vlan 11 priority 0Switch(config)#spanning-tree vlan 12 priority 4096// #配置生成树的主根时,设置它的优先级,优先级默认是32768,比它小就越靠谱,#优先级默认是4096的倍数,0最高Switch(config)#5、右上角交换机配置vlan10,vlan11为次根,vlan12为主根Switch(config)#spanning-tree vlan 10 priority 4096Switch(config)#spanning-tree vlan 11 priority 4096Switch(config)#spanning-tree vlan 12 priority 0Switch(config)#6、测试(1)全部链路正常启动,将右上角交换机f0/1开启Switch(config-if)#int f0/1Switch(config-if)#no shutdownPC3 ping pc0(2)关闭左上角和下面交换机之间的端口会从备份右上角家交换机,使用pc3和pc0互通(3)关闭其他重复的链路查看通信情况(4)查看数据包通过哪条路传送到目的地总结:配置生成树,目的是为了防止物理环路的产生,防止广播风暴,好处是,可以起到负载均衡的作用,和链路的冗余备份。
思科三层交换机配置实例及命令
思科三层交换机配置实例及命令思科三层交换机配置实例及命令交换机的命名一般是WS开头这个是固定的,再下一个字母有两种一个是C一个是X,C代表固化交换机或者机箱,X代表的是模块。
下面是店铺精心整理的思科三层交换机配置实例及命令,仅供参考,希望能够帮助到大家。
三层交换机是不是经常让你机器不好使,看看下面的三层交换机配置文章,一切问题都能解决。
本文详细介绍实例讲解:全面的三层交换机配置比较全面的三层交换机配置实例,带命令解释哟!三层交换机配置:Enable //进入私有模式Configure terminal //进入全局模式service password-encryption //对密码进行加密hostname Catalyst 3550-12T1 //给三层交换机定义名称enable password 123456. //enable密码Enable secret 654321 //enable的加密密码(应该是乱码而不是654321这样)Ip subnet-zero //允许使用全0子网(默认都是打开的)Ip name-server 172.16.8.1 172.16.8.2 //三层交换机名字Catalyst 3550-12T1对应的IP地址是172.16.8.1Service dhcp //提供DHCP服务ip routing //启用三层交换机上的路由模块Exit三层交换机配置:Vtp mode server //定义VTP工作模式为sever模式Vtp domain centervtp //定义VTP域的名称为centervtpVlan 2 name vlan2 //定义vlan并给vlan取名(如果不取名的话,vlan2的名字应该是vlan002)Vlan 3 name vlan3Vlan 4 name vlan4Vlan 5 name vlan5Vlan 6 name vlan6Vlan 7 name vlan7Vlan 8 name vlan8Vlan 9 name vlan9Exit三层交换机配置:interface Port-channel 1 //进入虚拟的以太通道组1switchport trunk encapsulation dot1q //给这个接口的trunk封装为802.1Q的帧格式switchport mode trunk //定义这个接口的工作模式为trunkswitchport trunk allowed vlan all //在这个trunk上允许所有的vlan通过Interface gigabitethernet 0/1 //进入模块0上的吉比特以太口1 switchport trunk encapsulation dotlq //给这个接口的trunk封装为802.1Q的帧格式switchport mode trunk //定义这个接口的工作模式为trunkswitchport trunk allowed vlan all //在这个trunk上允许所有的vlan通过channel-group 1 mode on //把这个接口放到快速以太通道组1中Interface gigabitethernet 0/2 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchport trunk allowed vlan allchannel-group 1 mode on三层交换机配置:port-channel load-balance src-dst-ip //定义快速以太通道组的负载均衡方式(依*源和目的IP的方式)interface gigabitethernet 0/3 //进入模块0上的.吉比特以太口3switchport trunk encapsulation dotlq //给trunk封装为802.1Qswitchport mode trunk //定义这个接口的工作模式为trunkswitchport trunk allowed vlan all //允许所有vlan信息通过interface gigabitethernet 0/4 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchport trunk allowed vlan allinterface gigbitethernet 0/5 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchport trunk allowed vlan allinterface gigbitethernet 0/6 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchprot trunk allowed vlan all三层交换机配置:interface gigbitethernet 0/7 //进入模块0上的吉比特以太口7 Switchport mode access //定义这个接口的工作模式为访问模式switchport access vlan 9 //定义这个接口可以访问哪个vlan(实际就是分配这个接口到vlan)no shutdownspanning-tree vlan 6-9 cost 1000 //在生成树中,vlan6-9的开销定义为10000interface range gigabitethernet 0/8 – 10 //进入模块0上的吉比特以太口8,9,10switchport mode access //定义这些接口的工作模式为访问模式switchport access vlan 8 //把这些接口都分配到vlan8中no shutdown三层交换机配置:spanning-tree portfast //在这些接口上使用portfast(使用portfast以后,在生成树的时候不参加运算,直接成为转发状态) interface gigabitethernet 0/11 //进入模块0上的吉比特以太口11switchport trunk encapsulation dotlq //给这个接口封装为802.1Qswitchport mode trunk //定义这个接口的工作模式为trunkswitchport trunk allowed vlan all //允许所有vlan信息通过interface gigabitethernet 0/12 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchport trunk allowed vlan allinterface vlan 1 //进入vlan1的逻辑接口(不是物理接口,用来给vlan做路由用)ip address 172.16.1.7 255.255.255.0 //配置IP地址和子网掩码no shutdown三层交换机配置:standby 1 ip 172.16.1.9 //开启了冗余热备份(HSRP),冗余热备份组1,虚拟路由器的IP地址为172.16.1.9standby 1 priority 110 preempt //定义这个三层交换机在冗余热备份组1中的优先级为110,preempt是用来开启抢占模式interface vlan 2 //同上ip address 172.16.2.252 255.255.255.0no shutdownstandby 2 ip 172.16.2.254standby 2 priority 110 preemptip access-group 101 in //在入方向上使用扩展的访问控制列表101interface vlan 3 //同上ip address 172.16.3.252 255.255.255.0 no shutdown三层交换机配置:standby 3 ip 172.16.3.254standby 3 priority 110 preemptip access-group 101 ininterface vlan 4 //同上ip address 172.16.4.252 255.255.255.0 no shutdownstandby 4 ip 172.16.4.254standby 4 priority 110 preemptip access-group 101 ininterface vlan 5ip address 172.16.5.252 255.255.255.0 no shutdownstandby 5 ip 172.16.5.254standby 5 priority 110 preemptip access-group 101 ininterface vlan 6ip address 172.16.6.252 255.255.255.0 no shutdown三层交换机配置:standby 6 ip 172.16.6.254standby 6 priority 100 preempt interface vlan 7ip address 172.16.7.252 255.255.255.0 no shutdownstandby 7 ip 172.16.7.254standby 7 priority 100 preemptinterface vlan 8ip address 172.16.8.252 255.255.255.0no shutdownstandby 8 ip 172.16.8.254standby 8 priority 100 preemptinterface vlan 9ip address 172.16.9.252 255.255.255.0no shutdown三层交换机配置:standby 9 ip 172.16.9.254standby 9 priority 100 preemptaccess-list 101 deny ip any 172.16.7.0 0.0.0.255 //扩展的访问控制列表101access-list 101 permit ip any anyInterface vlan 1 //进入vlan1这个逻辑接口Ip helper-address 172.16.8.1 //可以转发广播(helper-address 的作用就是把广播转化为单播,然后发向172.16.8.1)Interface vlan 2Ip helper-address 172.16.8.1Interface vlan 3ip helper-address 172.16.8.1interface vlan 4ip helper-address 172.16.8.1interface vlan 5ip helper-address 172.16.8.1interface vlan 6ip helper-address 172.16.8.1interface vlan 7ip helper-address 172.16.8.1interface vlan 9ip helper-address 172.16.8.1router rip//启用路由协议RIPversion 2//使用的是RIPv2,如果没有这句,则是使用RIPv1network 172.16.0.0//宣告直连的网段exit三层交换机配置:ip route 0.0.0.0 0.0.0.0 172.16.9.250//缺省路由,所有在路由表中没有办法匹配的数据包,都发向下一跳地址为172.16.9.250这个路由器line con 0line aux 0line vty 0 15//telnet线路(路由器只有5个,是0-4)password 12345678//login密码loginendcopy running-config startup-config 保存配置。
思科三层交换机VLAN+NAT+静态路由(已经修改过的)
一台思科三层交换机划分两个VLAN 其中VLAN2 IP地址为 192.168.1.1 子网掩码 255.255.255.0 另外一个VLAN3 IP地址为 192.168.2.1 子网掩码255.255.255.0 三层交换机的F0/2接口绑定到VLAN2中而三层交换机F0/3口绑定到对应的VLAN3中而三层交换机F0/2口下面连了一台思科的二层交换机的F0/1口而三层交换机F0/3口下面也连了一台思科二层交换机F0/1口 F0/2口下面连的二层交换机所有的24个端口都养绑定到VLAN2里面而F0/3口下面的二层交换机所有的24个端口都养绑定到VLAN3里面,当然要求两台交换机都要能够互相PING通对方!同时也要求三层交换机和二层交换机全部都要开启telnet功能方便以后通过电脑可以远程管理交换机!同时思科三层交换机的F0/1口还连着一台思科路由器!思科路由器做NAT 和端口映射!要求二层交换机连着的那些电脑都能够通过这台思科路由器上因特网,并且服务器通过端口映射可以让因特网的电脑访问到这些服务器具体网络拓扑结构如下图首先在三层交换机上做如下操作!C3550>enableC3550#vlan databaseC3550(vlan)#vlan 2C3550(vlan)#vlan 3C3550(vlan)#exitC3550#conf tC3550(config)#int f0/2C3550(config-if)#switchport mode accessC3550(config-if)#switchport access vlan 2C3550(config-if)#no shut downC3550(config-if)#int f0/3C3550(config-if)#switchport mode accessC3550(config-if)#switchport access vlan 3C3550(config-if)#no shut downC3550(config-if)#exitC3550(config)#int vlan 2C3550(config-if)#ip address 192.168.1.1 255.255.255.0 C3550(config-if)#int vlan 3C3550(config-if)#ip address 192.168.2.1 255.255.255.0 C3550(config-if)#exitC3550(config)#ip routingC3550(config)#endC3550(config)#int f0/2C3550(config-if)#switchport mode trunkC3550(config-if)#switchport trunk encapsulation dot1q C3550(config-if)#switchport trunk allowed vlan allC3550(config)#int f0/3C3550(config-if)#switchport mode trunkC3550(config-if)#switchport trunk encapsulation dot1q C3550(config-if)#switchport trunk allowed vlan allC3550#vlan databaseC3550(vlan)#vtp serverC3550(vlan)#vtp domain ntC3550(vlan)#vtp password 123C3550(vlan)#exitC3550#conf tC3550 (config)#line vty 0 4C3550 (config-line)#password 123C3550 (config-line)#loginC3550 (config-line)#exitC3550#copy running-config startup-config然后在二层交换机上做如下操作C2900>enableC2900#vlan databaseC2900(vlan)#vtp clientC2900(vlan)#vtp domain ntC2900(vlan)#vtp password 123C2900(vlan)#exitC2900#config tC2900(config)#int f0/1C2900(config-if)#switchport mode trunkC2900(config-if)#switchport trunk encapsulation dot1q C2900(config-if)#switchport trunk allowed vlan allC2900(config-if)#no shut downC2900(config)#int range f0/2 -24C2900(config-if)#switchport mode accessC2900(config-if)#switchport access vlan 2C2900(config-if)#exitC2900(config)#int vlan 2C2900(config-if)#ip address 192.168.1.200 255.255.255.0 C2900(config-if)#ip default-gateway 192.168.1.1C2900(config)#line vty 0 4C2900 (config-line)#password 123C2900 (config-line)#loginC2900 (config-line)#exitC2900#copy running-config startup-config在另外一台二层交换机上做如下操作C2900>enableC2900#vlan databaseC2900(vlan)#vtp clientC2900(vlan)#vtp domain ntC2900(vlan)#vtp password 123C2900(vlan)#exitC2900#config tC2900(config)#int f0/1C2900(config-if)#switchport mode trunkC2900(config-if)#switchport trunk encapsulation dot1qC2900(config-if)#switchport trunk allowed vlan allC2900(config-if)#no shut downC2900(config)#int range f0/2 -24C2900(config-if)#switchport mode accessC2900(config-if)#switchport access vlan 3C2900(config-if)#no shut downC2900(config-if)#exitC2900(config)#int vlan 3C2900(config-if)#ip address 192.168.2.200 255.255.255.0 C2900(config-if)#ip default-gateway 192.168.2.1C2900(config)#line vty 0 4C2900 (config-line)#password 123C2900 (config-line)#loginC2900 (config-line)#exitC2900#copy running-config startup-config接着再回到三层交换机上做如下操作C3550>enableC3550#conf tC3550(config)#int f0/1C3550(config)#no switchportC3550(config-if)#ip address 192.168.3.1 255.255.255.0C3550(config-if)#exitC3550#copy running-config startup-config接着到路由器上做如下操作(假设找ISP申请了三个外网IP地址 202.99.96.63 202.99.96.64 202.99.96.65 子网掩码255.255.255.248 统一用202.99.96.63这个外网IP上因特网R1>enableR1#config tR1(config)#int f0/0R1(config-if)#ip address 192.168.3.2 255.255.255.0R1(config-if)#ip nat insideR1(config-if)#no shut downR1(config-if)#exitR1(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.1R1(config)int s0/0R1(config-if)#ip address 202.99.96.63 255.255.255.248R1(config-if)#no shut downR1(config-if)#ip nat outsideR1(config-if)#exitR1(config)#ip nat pool nt 202.99.96.63 202.99.96.65R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255R1(config)#access-list 2 permit 192.168.2.0 0.0.0.255R1(config)#access-list 3 permit 192.168.3.0 0.0.0.255R1(config)#ip nat inside source list 1 pool nt overloadR1(config)#ip nat inside source list 2 pool nt overloadR1(config)#ip nat inside source list 3 pool nt overloadR1(config)#ip route 0.0.0.0 0.0.0.0 s0/0R1(config)#line vty 0 4R1 (config-line)#password 123R1 (config-line)#loginR1(config-line)#exit此外局域网中还有一个80端口的WEB服务器还有一个21端口的FTP服务器需要把这两个服务器做端口映射映射到因特网上!R1(config)#ip nat inside source static tcp 192.168.1.200 80202.99.96.63 80R1(config)#ip nat inside source static tcp 192.168.1.201 21202.99.96.63 21R1(config)#exitR1#copy running-config startup-config最后回到三层交换机做一下操作C3550 (config)#ip route 0.0.0.0 0.0.0.0 192.168.3.2C3550#copy running-config startup-config所有的操作都已经完成了!以上所有的操作都是本人自己总结的!也是自己写的!请问我完成了以上的那些操作之后是否可以达到我刚开始说的那些要求!如果可以达到我刚开始说的那些要求的话请说出为什么能达到!没有命令是错误的?如果不可以达到我刚开始说的那些要求的话请说出为什么不能达到!请问还有哪些命令是错误的呢?请写出具体正确的命令!谢谢!Inter vlan 2Ip address 192.168.1.200 255.255.255.0Ip default-gateway 192.168.1.1Inter vlan 3Ip address 192.168.2.200 255.255.255.0Ip default-gateway 192.168.2.1。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 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号或旧的来进行修改。