Cisco交换机简单配置实例
- 格式:doc
- 大小:59.50 KB
- 文档页数:9
二层交换机配置案例(配置2层交换机可远程管理):Switch>Switch>en进入特权模式Switch#config进入全局配置模式Switch(config)#hostname2ceng更改主机名为2ceng2ceng(config)#interfacevlan1进入VLAN12ceng(config-if)#noshut激活VLAN12ceng(config-if)#exit退出到全局配置模式2ceng(config)#interfacevlan2创建VLAN22ceng(config-if)#noshut激活VLAN22ceng(config-if)#exit退出到全局配置模式2ceng(config)#interfacevlan3创建VLAN32ceng(config-if)#noshut激活VLAN32ceng(config-if)#ipaddress2ceng(config-if)#exit2ceng(config)#interfacerangefa0/1-122ceng(config-if-range)#exit2ceng(config)#interfacerangefa0/13-23telnet2ceng(config)#exit2ceng#wr保存配置Buildingconfiguration...[OK]三层(或多层)交换机配置实例:Switch>Switch>enSwitch#configConfiguringfromterminal,memory,ornetwork[terminal]? Enterconfigurationcommands,oneperline.EndwithCNTL/Z. Switch(config)#hostname3ceng3ceng(config)#interfacevlan13ceng(config-if)#noshut3ceng(config-if)#exit3ceng(config)#interfacevlan23ceng(config-if)#noshut3ceng(config-if)#exit3ceng(config)#interfacevlan33ceng(config-if)#noshut3ceng(config-if)#ipaddress3ceng(config-if)#descriptionguanli描述vlan3为管理3ceng(config-if)#exit3ceng(config)#interfacerangefa0/1-123ceng(config-if-range)#switchportmodeaccess3ceng(config-if-range)#switchaccessvlan13ceng(config-if-range)#exit3ceng(config)#interfacerangefa0/13-243ceng(config-if-range)#switchaccessvlan23ceng(config-if-range)#exit3ceng(config)#ipdhcppoolvlan1设置VLAN1DHCP3ceng(dhcp-config)#network设置DHCP的网段3ceng(dhcp-config)#dns-server设置3ceng(dhcp-config)#default-router设置3ceng(dhcp-config)#exit3ceng(config)#ipdhcppoolvlan23ceng(dhcp-config)#network3ceng(dhcp-config)#dns-server3ceng(config)#exit3ceng#wrBuildingconfiguration...[OK]。
Cisco交换机综合配置实例(一) 本实例综合性很强,基本上包含了Cisco交换机的所有交换技术1.网络拓扑和相应设计目录:网络配置实例网络拓扑和相应设计Catalyst 5509 配置Catalyst 4003配置RSM配置Catalyst 5505配置网络拓扑和相关设计网络拓扑图2.Catalyst 5509 的配置下面列出Catalyst 5509 的基本配置Enter password:Console> enableEnter password:Console> (enable) set system name 5509-ER-F1System name set.5509-ER-F1> (enable) set system location 1st Floor Equipment Room System location set.5509-ER-F1> (enable) set system contact sysadmin@ System contact set.5509-ER-F1> (enable) set time 04/30/1999 9:30:00Fri Apr 30 1999, 09:30:005509-ER-F1> (enable) set passwordEnter old password:Enter new password:Retype new password:Password changed.5509-ER-F1> (enable) set enablepassEnter old password:Enter new password:Retype new password:Password changed.5509-ER-F1> (enable) set banner motd %5509-ER-F1 (Catalyst 5509)Access Restricted%MOTD banner set5509-ER-F1> (enable) set interface sc0 10.10.1.10/24 Interface sc0 IP address set.5509-ER-F1> (enable) set ip route default 10.10.1.1 Route added.5509-ER-F1> (enable) set ip dns server 10.10.10.10010.10.10.100 added to DNS server table as primary server. 5509-ER-F1> (enable) set ip dns domain Default DNS domain name set to 5509-ER-F1> (enable) set ip dns enableDNS is enabled5509-ER-F1> (enable) set vtp domain BigCorp mode server VTP domain BigCorp modified5509-ER-F1> (enable) set vlan 10 name CorporateVlan 10 configuration successful5509-ER-F1> (enable) set vlan 20 name DevEngVlan 20 configuration successful5509-ER-F1> (enable) set vlan 30 name MfgVlan 30 configuration successful5509-ER-F1> (enable) set vlan 40 name QAVlan 40 configuration successful5509-ER-F1> (enable) set vlan 50 name Finance&Admin Vlan 50 configuration successful5509-ER-F1> (enable) set vlan 60 name Sales&MktgVlan 60 configuration successful5509-ER-F1> (enable) set module name 1 Supervisor III Module name set.5509-ER-F1> (enable) set port flowcontrol 1/1-2 send off Ports 1/1-2 flow control send administration status set to off (ports will not send flowcontrol to far end)5509-ER-F1> (enable) set port flowcontrol 1/1-2 receive off Ports 1/1-2 flow control receive administration status set to off (ports will not allow far end to send flowcontrol)5509-ER-F1> (enable) set port negotiation 1/1-2 enablePorts 1/1-2 negotiation enabled5509-ER-F1> (enable) set port name 1/1-2 GEC 802.1Q Trunk Ports 1/1-2 name set.5509-ER-F1> (enable) set port channel 1/1-2 desirablePort(s) 1/1-2 channel mode set to desirable.5509-ER-F1> (enable) set trunk 1/1 desirable dot1qPort(s) 1/1 trunk mode set to desirable.Port(s) 1/1 trunk type set to dot1q.5509-ER-F1> (enable) set module name 3 RSM (RSM-ER-F1)Module name set.5509-ER-F1> (enable) set module name 5 Fast Ether Uplinks Module name set.5509-ER-F1> (enable) set port name 5/1-4 FEC ISL Trunk Ports 5/1-4 name set.5509-ER-F1> (enable) set port speed 5/1-4 100Ports 5/1-4 transmission speed set to 100Mbps.5509-ER-F1> (enable) set port duplex 5/1-4 fullPorts 5/1-4 set to full-duplex.5509-ER-F1> (enable) set port flowcontrol 5/1-4 send off Ports 5/1-4 flow control send administration status set to off (ports will not send flowcontrol to far end)5509-ER-F1> (enable) set port flowcontrol 5/1-4 receive off Ports 5/1-4 flow control receive administration status set to off (ports will not allow far end to send flowcontrol)5509-ER-F1> (enable) set port negotiation 5/1-4 enable Ports 5/1-4 negotiation enabled5509-ER-F1> (enable) set port channel 5/1-4 desirablePort(s) 5/1-4 channel mode set to desirable.5509-ER-F1> (enable) set trunk 5/1 desirable islPort(s) 5/1 trunk mode set to desirable.Port(s) 5/1 trunk type set to isl.5509-ER-F1> (enable) set module name 6 DevEng 100Mb Hosts Module name set.5509-ER-F1> (enable) set port name 6/1 DE Sparc UltraPort 6/1 name set.5509-ER-F1> (enable) set port name 6/2-7 DE Sparc20Ports 6/2-7 name set.5509-ER-F1> (enable) set port name 6/8-12 DE NT Workstation Ports 6/8-12 name set.5509-ER-F1> (enable) set port speed 6/1-12 100Ports 6/1-12 transmission speed set to 100Mbps.5509-ER-F1> (enable) set port duplex 6/1-12 fullPorts 6/1-12 set to full-duplex.5509-ER-F1> (enable) set port flowcontrol 6/1-12 send desired Ports 6/1-12 flow control send administration status set to desired (ports will send flowcontrol to far end if far end supports it)5509-ER-F1> (enable) set port flowcontrol 6/1-12 receive desired Ports 6/1-12 flow control receive administration status set to desired (ports will allow far end to send flowcontrol if far end supports it) 5509-ER-F1> (enable) set port channel 6/1-12 offPort(s) 6/1-12 channel mode set to off.5509-ER-F1> (enable) set trunk 6/1-12 offPort(s) 6/1-12 trunk mode set to off.Warning: Spantree port fast start should only be enabled on ports connected to a single host. Connecting hubs, concentrators, switches, bridges, etc. to a fast start port can cause temporary spanning tree loops. Use with caution. Spantree ports 6/1-12 fast start enabled.5509-ER-F1> (enable) set vlan 20 6/1-12VLAN 20 modified.VLAN 1 modified.VLAN Mod/Ports---- -----------------------201/1-25/1-46/1-125509-ER-F1> (enable) set module name 7 Corp/Mfg 10Mb Hosts Module name set.5509-ER-F1> (enable) set port name 7/1-12 Corp Win98 PCPorts 7/1-12 name set.5509-ER-F1> (enable) set port name 7/13-48 Mfg Win98 PCPorts 7/13-48 name set.5509-ER-F1> (enable) set port duplex 7/1-48 fullPorts 7/1-48 set to full-duplex.Warning: Spantree port fast start should only be enabled on ports connected to a single host. Connecting hubs, concentrators, switches, bridges, etc. to a fast start port can cause temporary spanning tree loops. Use with caution. Spantree ports 7/1-48 fast start enabled.5509-ER-F1> (enable) set vlan 10 7/1-12VLAN 10 modified.VLAN 1 modified.VLAN Mod/Ports---- -----------------------101/1-25/1-47/1-125509-ER-F1> (enable) set vlan 30 7/13-48VLAN 30 modified.VLAN 1 modified.VLAN Mod/Ports---- -----------------------301/1-25/1-47/13-485509-ER-F1> (enable) set module name 8 DevEng 10Mb HostsModule name set.5509-ER-F1> (enable) set port name 8/1-48 DevEng WinNT PCPorts 8/1-48 name set.5509-ER-F1> (enable) set port duplex 8/1-48 fullPorts 8/1-48 set to full-duplex.5509-ER-F1> (enable) set spantree portfast 8/1-48 enableWarning: Spantree port fast start should only be enabled on ports connected to a single host. Connecting hubs, concentrators, switches, bridges, etc. to a fast start port can cause temporary spanning tree loops. Use with caution. Spantree ports 8/1-48 fast start enabled.5509-ER-F1> (enable) set vlan 20 8/1-48VLAN 20 modified.VLAN 1 modified.VLAN Mod/Ports---- -----------------------201/1-25/1-46/1-128/1-485509-ER-F1> (enable) set module name 9 DevEng 10Mb HostsModule name set.5509-ER-F1> (enable) set port name 9/1-48 DevEng WinNT PCPorts 9/1-48 name set.5509-ER-F1> (enable) set port duplex 9/1-48 fullPorts 9/1-48 set to full-duplex.5509-ER-F1> (enable) set spantree portfast 9/1-48 enableWarning: Spantree port fast start should only be enabled on ports connected to a single host. Connecting hubs, concentrators, switches, bridges, etc. to a fast start port can cause temporary spanning tree loops. Use with caution. Spantree ports 9/1-48 fast start enabled.5509-ER-F1> (enable) set vlan 20 9/1-48VLAN 20 modified.VLAN 1 modified.VLAN Mod/Ports---- -----------------------201/1-25/1-46/1-128/1-489/1-485509-ER-F1> (enable)。
CISCO交换机配置实例(VTP、VLAN、TRUNK、channel)本文通过实例为大家介绍CISCO交换机的一些常用功能的配置方法,包括VTP 配置、VLAN划分、Trunk配置、channel通道配置、双工模式配置等。
掌握这些配置方法基本上可以满足CISCO交换机一般的日常维护要求了。
网络拓扑图:1、配置VTP, 设置domain为dgmobile, Sw1为server, 其它switch配置为client。
Sw1(config)# vtp mode severSw1(config)# vtp domain dgmobileSw2(config)# vtp mode client2、在Sw1建立三个vlan, 要求在其它Sw2上通过VTP可以看到同样的vlan。
vlan2:engineering,vlan6:marketing,vlan9:accouting.Sw1(config)# vlan 2Sw1(config-vlan)#name engineeringSw1(config)# vlan 6Sw1(config-vlan)#name marketingSw1(config)# vlan 9Sw1(config-vlan)#name accouting3、把sw2的端口5,8,13划入vlan2;端口3,4,9划入vlan6;端口6,7,16划入vlan9。
Sw2(config)#int range fa0/5 , fa0/8 , fa0/13Sw2(config-if-range)#switchport access vlan 2Sw2(config)#int range fa0/3 , fa0/4 , fa0/9Sw2(config-if-range)#switchport access vlan 6Sw2(config)#int range fa0/6 , fa0/7 , fa0/16Sw2(config-if-range)#switchport access vlan 94、Sw1和Sw2的23和24端口互连,配置交换机间的Trunk,用802.1q封装。
cisco交换机配置实例教程cisco交换机配置实例教程1、在交换机上启动QOSSwitch(config)#mls qos //在交换机上启动QOS2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //控制pc1下行流量Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量class-map mach-all {name}match access-group 110policy-mapclass二、详细配置过程注:每个接口每个方向只支持一个策略;一个策略可以用于多个接口。
因此所有PC的下载速率的限制都应该定义在同一个策略(在本例子当中为policy-map user-down),而PC不同速率的区分是在Class-map 分别定义。
1、在交换机上启动QOSSwitch(config)#mls qos //在交换机上启动QOS2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //控制pc1下行流量Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量3、定义类,并和上面定义的访问控制列表绑定Switch(config)# class-map user1-up //定义PC1上行的类,并绑定访问列表10Switch(config-cmap)# match access-group 10Switch(config-cmap)# exitSwitch(config)# class-map user2-upSwitch(config-cmap)# match access-group 11 //定义PC2上行的类,并绑定访问列表10Switch(config-cmap)# exitSwitch(config)# class-map user1-downSwitch(config-cmap)# match access-group 100 //定义PC1下行的类,并绑定访问列表100Switch(config-cmap)# exitSwitch(config)# class-map user2-downSwitch(config-cmap)# match access-group 111 //定义PC2下行的类,并绑定访问列表111Switch(config-cmap)# exit4、定义策略,把上面定义的类绑定到该策略Switch(config)# policy-map user1-up //定义PC1上行的速率为1MSwitch(config-pmap)# class user1-upSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 1024000 1024000 exceed-action dropSwitch(config)# policy-map user2-up //定义PC2上行的速率为2MSwitch(config-pmap)# class user2-upSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 2048000 1024000 exceed-action dropSwitch(config)# policy-map user-downSwitch(config-pmap)# class user1-downSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 1024000 1024000 exceed-action dropSwitch(config-pmap-c)# exitSwitch(config-pmap)# class user2-downSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 2048000 1024000 exceed-action dropSwitch(config-pmap-c)# exit5、在接口上运用策略Switch(config)# interface f0/1Switch(config-if)# service-policy input user1-upSwitch(config)# interface f0/2Switch(config-if)# service-policy input user2-upSwitch(config)# interface g0/1Switch(config-if)# service-policy input user-down看了cisco交换机配置实例教程还想看:1.思科交换机基本配置实例讲解2.CISCO交换机配置操作学习教程3.思科交换机配置教程详解4.cisco交换机qos配置实例教程5.思科路由器、交换机的基本管理教程6.Cisco 2960交换机的基础安装配置教程Cisco交换机入门配置的方法Cisco交换机入门配置的方法:机型:Cisco 3750想对交换机警醒配置。
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.思科交换机配置教程详解。
思科交换机NAT配置介绍及实例思科交换机(Cisco Switch)是企业级网络设备中最常用的一种。
与传统的路由器不同,交换机主要用于在局域网(LAN)内部提供数据包的转发和过滤功能。
然而,在一些情况下,我们可能需要使用交换机进行网络地址转换(NAT)来实现特定的网络部署需求。
本文将介绍思科交换机的NAT配置方法,并提供实例说明。
1.NAT概述网络地址转换(NAT)是一种在不同网络之间转换IP地址的技术。
它主要用于解决IPv4地址空间的短缺问题,并允许多个主机通过一个公网IP地址来访问互联网。
NAT实现了将内部网络地址与外部IP地址之间进行映射,使得内部主机可以通过共享公网IP地址来与外部网络进行通信。
2.NAT配置方法在思科交换机上配置NAT通常涉及以下步骤:步骤1:创建访问控制列表(ACL)访问控制列表(Access Control List)用于定义需要进行NAT转换的数据包。
我们可以根据源地址、目标地址、端口等条件来配置ACL,以确定哪些数据包需要进行NAT转换。
例如,下面是一条配置ACL的命令示例:access-list 10 permit 192.168.1.0 0.0.0.255该命令表示允许192.168.1.0/24网段的内部主机进行NAT转换。
步骤2:创建NAT池NAT池用于定义可以被映射到的公网IP地址范围。
我们可以通过配置交换机的外部接口和NAT池来设置NAT转换的目标IP地址。
例如,下面是一条配置NAT池的命令示例:ip nat pool NAT_POOL 203.0.113.1 203.0.113.10 netmask255.255.255.0该命令表示创建一个名为NAT_POOL的NAT池,其中可用的IP地址范围为203.0.113.1至203.0.113.10。
步骤3:创建NAT规则NAT规则用于将内部网络的私有IP地址映射到NAT池的公网IP地址。
我们可以通过配置NAT类型(静态/动态)、内部地址、外部地址等参数来创建NAT规则。
Cisco交换机配置实验报告实验目的本实验旨在了解和掌握Cisco交换机的基本配置和操作方法,包括VLAN划分、端口配置、静态路由等。
实验环境•Cisco交换机(型号:XYZ)•一台计算机•Console连接线实验步骤步骤一:连接设备1.将计算机通过Console连接线与Cisco交换机的Console端口相连。
2.打开终端软件(如SecureCRT、PuTTY等),配置串口连接参数,如波特率、数据位、停止位等。
3.点击连接按钮,与Cisco交换机建立串口连接。
步骤二:进入特权模式1.在终端中输入用户名和密码,登录到Cisco交换机的用户模式。
2.输入enable命令,进入特权模式,需输入特权密码。
步骤三:配置主机名1.在特权模式下,输入configure terminal命令,进入全局配置模式。
2.输入hostname [名称]命令,设置Cisco交换机的主机名。
3.按下Ctrl+Z保存配置并退出。
步骤四:配置VLAN1.进入全局配置模式,输入vlan [VLAN编号]命令,创建VLAN。
2.输入name [VLAN名称]命令,为VLAN设置名称。
3.重复以上步骤,创建所需的所有VLAN。
4.按下Ctrl+Z保存配置并退出。
步骤五:配置端口1.进入全局配置模式,输入interface [端口编号]命令,进入端口配置模式。
2.输入switchport mode access命令,设置端口为访问模式。
3.输入switchport access vlan [VLAN编号]命令,将端口划分到对应的VLAN。
4.重复以上步骤,配置所有需要的端口。
5.按下Ctrl+Z保存配置并退出。
步骤六:配置静态路由1.进入全局配置模式,输入ip route [目标子网] [子网掩码] [下一跳地址]命令,添加静态路由。
2.重复以上步骤,配置所有需要的静态路由。
3.按下Ctrl+Z保存配置并退出。
步骤七:查看配置1.在特权模式下,输入show running-config命令,查看当前的运行配置。
1.1路由器的几个操作模式Router>//用户模式Router>enable//用户模式敲入enable进入特权模式Router#configure terminal//特权模式敲入configure terminal进入全局配置模式Router(config)#interface ethernet 0//配置模式敲入interface+接口类型+接口编号,进入接口配置模式(如:interface serial 0 或是interface serial 0/1 ,interface fast1/1,接口编号是多少具体要看是哪个型号的设备)Router (config)#interface range fa 0/2 – 5//利用range可以一次操作多个端口Router(config-if)#exit //从接口模式退出到配置模式Router(config)#exit//从配置模式退出到特权模式注意:任何时候按Ctrl-z或是end都会退出到特权模式1.2命名主机名Router(config)#hostname 主机名//路由默认主机名为Router,交换机为switch如:Router(config)#hostname Wisdom//设置主机名是WisdomWisdom(config)#1.3给路由器设置时间Wisdom(config)#clock set 23:46:50 sep 4 2006Wisdom#show clock//用show clock 命令查看时间1.8.利用TELNET来管理网络首先通CONSOLE口控制R1,控制R1后通过TELNET到R2,R3,对R2,R3进行管理.在R1上实验:R1#telnet 12.1.1.2//从R1 TELNET到R2R2>按<Ctrl-Shift-6>x 切换回R1R1#telnet 13.1.1.3//从R1 TELNET到R3R3>按<Ctrl-Shift-6>x 切换回R1R1#show sessions//在R1上查看打开了多少个TELNET的会话Conn Host Address Byte Idle Conn Name1 12.1.1.2 12.1.1.2 0 0 12.1.1.2* 2 13.1.1.3 13.1.1.3 0 0 13.1.1.3R1#resume 2//重新连接到R3R3>按<Ctrl-Shift-6>x 切换回R1R1#R1#disconnect 1//从R1是主动断开到R2的连接(断开一个TELNET的会话)在R2上实验:R2#show users//在R2上查看有谁登录到路由器Line User Host(s) Idle Location* 0 con 0 idle 00:00:002 vty 0 idle 00:01:52 12.1.1.1R2#clear line 2//发现有人TELNET过来,把他清除R2#show usersLine User Host(s) Idle Location* 0 con 0 idle 00:00:00注意:Show session和show user的区别Disconnect 和Clear line的区别Ctrl+shift+6 x 和resume1.9 PING、TraceRoute、Debug、Sysloga.使用PING命令R1#ping 12.1.1.2如果ping的结果是!!!!!则表明网络正常.如果ping的结果是…..则表明网络不通.如果ping的结果是U.U.U则表明下一跳不可达.b.使用traceroute命令, 在网络层上追踪源到目的地址所经过的路由器.(或是数据包经过的路径)例:R2#traceroute 33.1.1.3Tracing the route to 33.1.1.31 12.1.1.1 4 msec 4 msec 4 msec2 13.1.1.34 msec 4 msec *//从以上可以看出从R2 到达33.1.1.3经过了12.1.1.1和13.1.1.3两个路由器例:………………………………………………………………………………………………………………….3.3使用串口管理交换机。
二层交换机配置案例(配置2层交换机可远程管理):Switch>Switch>en进入特权模式Switch#config进入全局配置模式Switch(config)#hostname2ceng更改主机名为2ceng2ceng(config)#interfacevlan1进入VLAN12ceng(config-if)#noshut激活VLAN12ceng(config-if)#exit退出到全局配置模式2ceng(config)#interfacevlan2创建VLAN22ceng(config-if)#noshut激活VLAN22ceng(config-if)#exit退出到全局配置模式2ceng(config)#interfacevlan3创建VLAN32ceng(config-if)#noshut激活VLAN32ceng(config-if)#ipaddress2ceng(config-if)#exit2ceng(config)#interfacerangefa0/1-122ceng(config-if-range)#exit2ceng(config)#interfacerangefa0/13-23telnet2ceng(config)#exit2ceng#wr保存配置Buildingconfiguration...[OK]三层(或多层)交换机配置实例:Switch>Switch>enSwitch#configConfiguringfromterminal,memory,ornetwork[terminal]? Enterconfigurationcommands,oneperline.EndwithCNTL/Z. Switch(config)#hostname3ceng3ceng(config)#interfacevlan13ceng(config-if)#noshut3ceng(config-if)#exit3ceng(config)#interfacevlan23ceng(config-if)#noshut3ceng(config-if)#exit3ceng(config)#interfacevlan33ceng(config-if)#noshut3ceng(config-if)#ipaddress3ceng(config-if)#descriptionguanli描述vlan3为管理3ceng(config-if)#exit3ceng(config)#interfacerangefa0/1-123ceng(config-if-range)#switchportmodeaccess3ceng(config-if-range)#switchaccessvlan13ceng(config-if-range)#exit3ceng(config)#interfacerangefa0/13-243ceng(config-if-range)#switchaccessvlan23ceng(config-if-range)#exit3ceng(config)#ipdhcppoolvlan1设置VLAN1DHCP3ceng(dhcp-config)#network设置DHCP的网段3ceng(dhcp-config)#dns-server设置3ceng(dhcp-config)#default-router设置3ceng(dhcp-config)#exit3ceng(config)#ipdhcppoolvlan23ceng(dhcp-config)#network3ceng(dhcp-config)#dns-server3ceng(config)#exit3ceng#wrBuildingconfiguration...[OK]。
实验二交换机的基本配置一、实验目的:学习用命令行方式配置交换机的基本方法。
二、实验环境:Catalyst 2950交换机1台;PC机2台。
图2.1三、实验工具:Boson Netsim模拟器四、实验内容:(1) 按图2.1所示连接网络;(2) 配置交换机名字为S1;在命令提示符的前面是交换机的名字,这在有多台交换机时可方便我们进行识别。
交换机的默认名字是Switch,下面把它改名为S1:Switch(config)#hostname S1S1(config)#(3) 设置交换机的控制台口令为12345;控制台口令是用超级终端登录交换机时使用的口令。
S1(config)#line console 0S1(config-line)#loginS1(config-line)#password 12345line console 0表示配置控制台端口0;用login命令允许登录;用password命令设置登录密码。
可以用logout结束会话再重新登录来验证登录口令:S1(config-line)#exitS1#logoutRouter con0 is now availablePress RETURN to get startedPassword:S1>在“Password:”后输入口令12345,就可以进入用户模式。
(注:输入口令时无回显,即没有任何显示。
)(4) 设置交换机的远程登录口令为54321;远程登录口令是用Telnet登录交换机时使用的口令。
S1(config)#line vty 0 15S1(config-line)#loginS1(config-line)#password 54321本例中把远程登录口令设置为54321。
(5) 设置交换机的特权口令为abcde,特权密码为edcba;特权口令是从用户模式进入特权模式时使用的口令,它有口令和密码两种形式。
口令在配置文件中是用明文显示的,密码在配置文件中是用密文显示的,所以密码的安全性更高。
思科Cisco交换机配置——端⼝安全配置实验案例图⽂详解本⽂讲述了思科Cisco交换机端⼝安全配置实验。
分享给⼤家供⼤家参考,具体如下:⼀、实验⽬的:在交换机f0/1端⼝上设置安全配置,使PC1和PC2两台机中只有⼀台机器能够正常通信,另⼀台通信时端⼝则会⾃动关闭⼆、拓扑图如下三、实验步骤:1、先给各台主机配置IP地址(PC1、PC2、PC3)记录PC1或PC2的其中⼀台主机的mac地址2、配置交换机S1enable --进⼊特权模式config terminal --进⼊全局配置模式hostname S2 --修改交换机名为S1interface f0/1 --进⼊到f0/1端⼝shutdown --关闭f0/1端⼝switchport mode access --修改端⼝模式switchport port-security --修改端⼝为安全模式switchport port-security maximum 1 --配置mac地址最⼤数量为1switchport port-security violation shutdown --配置违反安全设置后的处理动作为关闭端⼝switchport port-security mac-address 0009.7C2D.DC67 --将PC1或PC2其中⼀台的mac地址与端⼝绑定no shutdown --激活端⼝end --返回特权模式copy running-config startup-config --保存配置3、分别测试PC1和PC2主机PingPC3主机PC1:正常PIng通PC2:不能正常Ping通违反端⼝安全导致端⼝关闭(如下图,),若想再次启动需要进⼊到f0/1端⼝先shutdown再no shutdown启动:S1:enable --进⼊特权模式config terminal --进⼊全局配置模式interface f0/1 --进⼊f0/1端⼝shutdown --关闭f0/1端⼝no shutdown --激活f0/1端⼝。
cisco交换机配置实例教程每个接口每个方向只支持一个策略;一个策略可以用于多个接口。
接下来是小编为大家收集的cisco交换机配置实例教程,希望能帮到大家。
cisco交换机配置实例教程1、在交换机上启动QOSSwitch(config)#mls qos //在交换机上启动QOS2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量Switch(config)#access-list 100 permit any10.10.1.0 0.0.0.255 //控制pc1下行流量 Switch(config)#access-list11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量class-map mach-all {name}match access-group 110policy-mapclass二、详细配置过程注:每个接口每个方向只支持一个策略;一个策略可以用于多个接口。
因此所有PC的下载速率的限制都应该定义在同一个策略(在本例子当中为policy-map user-down),而PC不同速率的区分是在Class-map分别定义。
1、在交换机上启动QOSSwitch(config)#mls qos //在交换机上启动QOS2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //控制pc1下行流量Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量3、定义类,并和上面定义的访问控制列表绑定Switch(config)# class-map user1-up //定义PC1上行的类,并绑定访问列表10Switch(config-cmap)# match access-group 10Switch(config-cmap)# exitSwitch(config)# class-map user2-upSwitch(config-cmap)# match access-group 11 //定义PC2上行的类,并绑定访问列表10Switch(config-cmap)# exitSwitch(config)# class-map user1-downSwitch(config-cmap)# match access-group 100 //定义PC1下行的类,并绑定访问列表100Switch(config-cmap)# exitSwitch(config)# class-map user2-downSwitch(config-cmap)# match access-group 111 //定义PC2下行的类,并绑定访问列表111Switch(config-cmap)# exit4、定义策略,把上面定义的类绑定到该策略Switch(config)# policy-map user1-up //定义PC1上行的速率为1MSwitch(config-pmap)# class user1-upSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 1024000 1024000 exceed-action dropSwitch(config)# policy-map user2-up //定义PC2上行的速率为2MSwitch(config-pmap)# class user2-upSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 2048000 1024000 exceed-action dropSwitch(config)# policy-map user-downSwitch(config-pmap)# class user1-downSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 1024000 1024000 exceed-action dropSwitch(config-pmap-c)# exitSwitch(config-pmap)# class user2-downSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 2048000 1024000 exceed-action dropSwitch(config-pmap-c)# exit5、在接口上运用策略Switch(config)# interface f0/1Switch(config-if)# service-policy input user1-upSwitch(config)# interface f0/2Switch(config-if)# service-policy input user2-upSwitch(config)# interface g0/1Switch(config-if)# service-policy input user-down看了“cisco交换机配置实例教程”还想看:1.思科交换机基本配置实例讲解2.CISCO交换机配置操作学习教程3.思科交换机配置教程详解4.cisco交换机qos配置实例教程5.思科路由器、交换机的基本管理教程6.Cisco 2960交换机的基础安装配置教程。
命令句法约定:垂直竖线 ( | )分隔可选的,互斥的元素方括号 ([ ])表示可选的元素花括号 ({ })表示必选项.在方括号内的花括号 ( [{ }] )表示可选元素中的必选项.粗体表示要按字母所示原封不动输入的命令和关键词.即粗休表示由用户手工输入的命令.斜体表示要为之提供实际值的参数.Show 指令:# Show run (显示内存配置文件,当你下了一条指令即在内存中,但若没有用write mem 则不会写入Flash,)# Show conf (显示Flash配置文件,每条指令一定是写入到Flash中的,这样突然停机配置文件才不会丢失)# Show session (列出到本地交换机的连接上所有打开的会话以及连接号)# show int vlan n (n 是编号,用来查看vlan n的信息)# show hardware 或 show version (L2 IOS上显示交换机的硬件或模块信息)# show clock (显示日期和时间)# sh mac-address-table {dynamic | static | secure} mac-address {Vlan vlan-id} {interface int1 [int2…int4] {protocol {ip | ipx | assigned}} (显示mac 交换表信息)# sh mac-address-table address 0000.1111.2222 (显示特定的pc在交换机的哪一端口)# sh int status (显示所有端口的状态信息)# sh int f 0/1 switchport (显示指定交换端口的信息)Switch# boot system filesname (从Flash文件系统内指定一个引导系统的os映像)Switch# vlan database 进入VLAN数据库模式Switch(config)# ip domain-lookup 在交换机上启用DNS服务:Switch(config)# ip name-server serveraddress1 [serveraddress2….serveraddress6] 规定DNS服务器的地址:Switch(config)# ip host name address 指定用于名字解析的主机配置项Switch(config)# interface type mod/num type是界面类型,mod是模块,num是端口号Switch(config)# interface range port-range 选择一个范围内的端口Switch(config-if)# description word 给端口指派一个描述性的名字及端口速度Switch(config-if)# speed {10 |100 |1000|auto|nonegotiate} (设置端口的速度)Switch(config-if)# no shutdown (启用端口,shutdown是禁用端口)Switch(config)# ip routing (启动路由功能 )Switch(config-if)# no switchport (为3层操作配置接口:可以将端口配置成2层交换接口或3层路由端口,要把端口配置成3层端口,可使用 no switchport命令禁止2层操作,启动3层操作)Switch(config-if)# no shutdown (启用接口:许多3层接口默认状态是shutdown的.)配置VTP指定VTP域名:Switch# vlan databaseSwitch(vlan)# vtp domain name (各交换机之间要同步vlan数据,则各交换机的vtp domain name要相同)或Switch(config)# vtp domain name配置VTP模式Switch(vlan)# vtp transparent或Switch(config)# vtp mode transparent改变VTP模式Switch(vlan)# vtp mode [ server | client | transparent ]VTP有3种模式运行: Server(服务器), Client(客户机), Transparent(透明).这三种模式决定了VTP如何传送信息,如何保持VLAN数据库同步,以及是否可以为给定的交换机管理VLAN.Server服务器模式: 这是默认模式,此模式可以创建,删除或者修改本地VLAN数据库里的VLAN,在做过改动之后,vlan数据库的变化被送出到vtp域内所有处于server或者client模式的其他交换机上,Server模式也可以接收从域内其他交换机发送来的vlan数据库变化信息.Client客户机模式: 此Client模式的交换机不能创建,修改或者删除本地vlan数据库里的vlan,相反,它们依靠域内的其他交换机来更新自己的新Vlan它会保持数据库同步,但不会保存vlan信息,如果掉电的话,会丢失所有这些信息.Client还会公布自己数据库的信息,把VTP信息转发给其他交换机.Transparent模式: Transparent模式运行起来和Server模式非常相像,Transparent模式也可以创建,删除或者修改本地vlan数据库里的vlan,这与Server模式的区别在于这些变化不会被传播给其他交换机.此外,本地vlan数据库也不接收从其他交换机来的修改信息.VTP Transparent模式的交换机在其他的Server或者Client模式的交换机之间转发或者中继信息.VTP Transparent模式的交换机不要求有VTP域名.创建vlan:创建一个新的Vlan:Switch# vlan database (进入vlan数据库)Switch(vlan)# vlan number (创建一个vlan,number为新建一个vlan的号, 正常范围1~1000和扩展范围1025~4096)Switch(config)# int vlan 2Switch(config-if)#vlan 2Switch(config-vlan)# name vlantest (给number号的vlan取名为vlantest)划分端口:在Cisco交换机上,端口被分配给独立的VLAN,这些端口称为接入端口(access ports),用于连接终端用户或结点设备.在默认情况下,所有的端口都被划入vlan 1,它叫做默认vlan (default vlan ) ,在创建vlan后,您可手工把某个端口分配给一个新建的vlan.使之成为某个vlan的成员.步骤如下:Switch(config)# int type mod/port (type为适配卡类型,mod/port为端口号,在全局下进入某一个vlan模式如# int f 0/1)Switch(config-if)# switchport mode access (设定f 0/1端口的接入类型为接入端口即access ports.)Switch(config-if)# switchport access vlan number (把此端口即接入端口划分到vlan number 中.number为vlan 号)Switch(config-if)# no shutdown删除一个已存在的vlan要删除一个vlan, 先从VLAN中移除所有存在的PORT,也就是将此vlan所属的端口移到其它vlan 中.进入到vlan database à no vlan numberSwitch# vlan databaseSwitch(vlan)# no vlan 2Switch(vlan)# apply (要apply保证修改,abort放弃修改)注意:在删除某一个vlan之前,要确定此vlan没有任何端口,而且此vlan不在trunk中,否则你先要从trunk中把此vlan移除再下no vlan 2的指令.从trunk中移除vlan的指令:Switch(config-if)# switchport trunk allowed vlan remove 2)使用下面的步骤启动交换机之间的Trunking功能:Switch(config)#int f0/2switch(config-if)#switchport (设定端口为交换端口而不路由端口)Switch(config-if)#switchport trunk encapsulation dot1q (设定此端口的封装为dot1q而不是isl & negotiate)Switch(config-if)#switchport mode trunk (设定此交换端口为trunk即中继端口)Switch(config-if)#switchport nonegotiate (禁止发出任何DTP信令)手工从Trunk链路中删除一个vlan,使此vlan不能通过Trunk链路传送流量:Switch(config)#int f0/2Switch(config-if)#switchport trunk allowed vlan remove 2 (不允许vlan 2使用f 0/2 的Trunk链路)手工将一个vlan新增到Trunk链路中:Switch(config-if)#switchport trunk allowed vlan add 2 (新增一个vlan到Trunk链路中.)&Switch(config-if)#switchport trunk allowed vlan add all (所有vlan使用Trunk 链路)端口安全SwitchL3(config-if)#switchport port-security 启用端口安全功能SwitchL3(config-if)#switchport port-security maximum 1 设定接入mac最大值SwitchL3(config-if)#switchport port-security violation protect 指定端口所采取的措施:SwitchL3(config-if)#switchport port-security mac-address 0000.1111.2222 锁定mac 地址Switch之DHCP功能先介绍第一种方式第一步,启用某台win2k server作DHCP第二步:启用DHCP中继代理/*关键一步,若缺少以下两条命令,在VLAN中使用“IP HELPER-ADDRESS DHCP服务器地址”指定DHCP服务器,客户机仍然不能获得IP地址*/Switch>EnableSwitch#Config tSwitch(Config)Service DhcpSwitch(Config)Ip Dhcp Relay Information Option第三步在C3550的每个vlan中都要下一个指令: ip helper x.x.x.x接着介绍第二种方式:配置Vlan1所用的地址池和相应参数:switch(config)#ip dhcp pool test01 设定dhcp pool 名称为test01switch(config-pool)#network 10.31.0.0 255.255.255.0 设定此名称可分配的IP 地址即地址池.switch(config-pool)#dns-server 10.32.0.2 设定DNS Serverswitch(config-pool)default-router 10.31.0.1 设定默认网关,也就是vlan的ip设置dhcp保留不分配的地址switch(config)#ip dhcp excluded-address 10.31.0.1 10.31.0.10WEB浏览器界面a. 启用web界面: Switch(config)# ip http server (no ip http server 命令可以禁用http服务器)b. 设置浏览器的端口号Switch(config)# ip http port numberc. 限制对web界面的访问Switch(config)# ip http access-class access-listd. 选择用户身份验证的方法Switch(config)# ip http authentication {aaa | enable | local | tacacs}e. 查看交换机的主页:http://switch/ 就能访问交换机的主页.这里的switch是交换机的ip地址或主机名.配置用户级口令: (为0至4级telnet登录配置口令)Switch(config)# line vty 0 4Switch(config-line)# loginSwitch(config-line)# password password配置特权级口令:Switch(config)# enable secret paaword日志记录启用或禁用日志记录Switch(config)# [no] logging on把消息日志记录到systlog服务器:a. 标识syslog服务器: Switch(config)# logging 10.132.227.168b. 向syslog的设备发送消息: Switch(config)# logging facility facility-typeMonitor功能Switch(config)# monitor session session {source {interface interface} | {vlan vlan-id} } [, |-|rx|tx|both]Switch(config)# monitor session session {destination {interface interface} [, |- ] | {vlan vlan-id}例: SwitchL3(config)#monitor session 1 source interface fastEthernet 0/1 bothSwitchL3(config)#monitor session 1 destination interface f0/24此两句指令是将f0/1上产生的流量镜像到f0/24 Port.Spanning-tree快速接入设定:SwitchL3(config)# int f0/24SwitchL3(config-if)#spanning-tree portfast此两句指令是将f0/24port设为快速以太网口,设为快速以太网口后计算机只要接入交换机的端口,此端口就会立马被激活使用,而不需要等待一段时间,其优点是接入速度更快,缺点是不能阻止环.这样就会导致当接入此port的hub有两个port被做成环时会造成网络瘫痪!有关端口的几个指令选择一个端口:Switch(config)# interface type mod/num (type是界面类型,mod是模块,num是端口号)选择一个范围内的端口Switch(config)# interface range port-range(交换机允许指定多个端口,各端口之间用逗号隔开,同模块下的range端口可写成0/1-4,1/1,不同模块下的range端口写成0/1,1/1)给端口指派一个描述性的名字及端口速度Switch(config-if)# description wordSwitch(config-if)# speed {10 |100 |1000|auto|nonegotiate} (设置端口的速度)设置端口模式及流控Switch(config-if)# duplex {full | half |auto} (设置端口的单双工模式)Switch(config)-if# flowcontrol {send | receive} {desired |off |on} (启用或禁用端口Switch(config-if)# no shutdown (启用端口,shutdown是禁用端口)Copy Flash的IOS到本机的TFTP首先在本机开启TFTP程序,然后在console模式下输入指令:Switch#copy flash tftp (copy flash下的某檔到tftpSource filename [c3550-i5q3l2-mz.121-20.EA1a/c3550-i5q3l2-mz.121-20.EA1a.bin]? (注意源文档位于EA1a目录下,)Address or name of remote host []? 10.132.227.168 (指定tftp 的IP)Destination filename [c3550-i5q3l2-mz.121-20.EA1a/c3550-i5q3l2-mz.121-20.EA1a.bin]? c3550 (指定目的地文件名)从Flash文件系统内指定一个引导系统的OS映像:Switch(config)# boot system flashnameVLAN访问控制列表基础知识:访问列表分为标准(Standard access-list)和扩展(Extended access-list)两种访问列表.区别:标准访问列表(1-99):a. 只检查源地址而不管数据包所有达到的目的地.b. 只管理数据包而不分数据包是哪种协议扩展访问列表(100-199): a. 检查源地址和目的地址b. 检查数据包具体是哪种协议允许或拒绝.当设置了访问列表后,当packet到达access-list后,若Access-list没有说明数据包是被deny 还是被permit,则数据包会被deny掉.例: router(config)#1.建立标准访问列表:access-list access-list-number {permit | deny} {源地址}2.应用到某一适配卡: {protocol} access-group access-list-number { in | out}这里在写掩码时是子网掩码的反码Ip及子网在access-list中的一些写法:192.168.0.1 255.255.255.255在access-list中写成: 192.168.0.1 0.0.0.0或 host 192.168.0.1Any 在access-list 中写成0.0.0.0 255.255.255.255注意:如果你想删除access-list 1的某一项列表,用no access-list 1 deny host 10.32.0.1指令它会将整个access-list 1删除.。