cisco网络交换机配置手册061201.docx

上传人:b****5 文档编号:7370242 上传时间:2023-01-23 格式:DOCX 页数:14 大小:31.75KB
下载 相关 举报
cisco网络交换机配置手册061201.docx_第1页
第1页 / 共14页
cisco网络交换机配置手册061201.docx_第2页
第2页 / 共14页
cisco网络交换机配置手册061201.docx_第3页
第3页 / 共14页
cisco网络交换机配置手册061201.docx_第4页
第4页 / 共14页
cisco网络交换机配置手册061201.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

cisco网络交换机配置手册061201.docx

《cisco网络交换机配置手册061201.docx》由会员分享,可在线阅读,更多相关《cisco网络交换机配置手册061201.docx(14页珍藏版)》请在冰豆网上搜索。

cisco网络交换机配置手册061201.docx

cisco网络交换机配置手册061201

cisco网络交换机配置手册

 

一、网络拓扑

参见三地网络拓扑图。

二、连接设备的方法

1、从console连接:

用Console线和转接头将交换机的console口与PC的串口相联,图示如下:

设置如下图(默认设置):

2、远程telnet连接

给交换机配置了管理地址,就可以直接采用远程telnet登陆进入交换机了,但是必须先配置linevty的密码和enable密码才能允许远程登陆。

三、cisco交换机基本配置的方法

1、配置设备特权模式口令

telnet*.*.*.*

Switch>进入用户模式

Switch>enable                  从用户模式进入特权模式

Switch#configterminal        从特权模式进入全局配置模式

Switch#exit        退出所有配置模式

Switch#end退出配置模式

Switch#wr保存配置

Switch(config)#enablesecretcisco123  ――设置特权模式加密口令(机房使用方法)

Switch(config)#enablepasswordcisco123  ――设置特权模式不加密口令

Switch(config)#servicepassword-encryption――将所有口令进行加密

2、配置虚拟终端线路VTY(VirtualTypeTerminal)

Switch(config)#linevty04

Switch(config-line)#login      --让设备回显一个要求输入口令的提示

Switch(config-line)#passwordcisco――Telnet统一密码

Switch(config-line)#exec-timeout100 ――设备超时时间为10分钟0秒

Switch(config)#linevty04

Switch#(config-line)#loginlocal――设置本地认证模式

Switch(config)#usernamezhangxypassword******

Switch(config)#nousernamezhangxy

3、定义、删除(恢复初始)设备名称

Switch(config)#hostnametest-2950

test-2950(config)#nohostname

4、配置snmp网管串

Switch(config)#snmp-servercommunityxxxxxxro(只读)

Switch(config)#snmp-servercommunityxxxxxxrw(读写)

5、新建、修改、删除某个VLAN,以及对VLAN命名

Switch#vlandatabase

Switch(vlan)#vlan100

Switch(vlan)#vlan100nameXX  (名字一般定义为客户名称或者共享网段标识)

Switch(vlan)#novlan100

或者

Switch#conft

Switch(config)#vlan100

Switch(config-vlan)#nameXX   (名字一般定义为客户名称或者共享网段标识)

Switch(config)#novlan100

6、将某个端口或者一组端口,划分到VLAN

Switch(config)#interfacef0/13    (进入单个端口配置模式)

Switch(config)#interfacerangef0/1-5    (进入一组端口配置模式)

Switch(config)#interfacerangef0/1-5,f0/8-10 (进入一组端口配置模式)

Switch(config-if)#(端口描述)

Description客户名称拼音的全拼(首字母大写)ip=地址带宽操作日期

Switch(config-if)#switchportmodeaccess

Switch(config-if)#switchportaccessvlan100

Switch(config-if)#noshutdown

Switch(config-if)#noswitchport (删除端口相关配置)

7、配置端口工作模式

Switch(config-if)#duplexfull/auto/half  [全双工|自动协商|半双工]

8、配置端口速率

Switch(config-if)#speed10/100/auto

9、配置一个或多个VLAN网关

Switch(config)#intvlan100

Switch(config-subif)#Description客户名称ip=地址带宽操作日期 (描述)

Switch(config-subif)#ipaddress192.168.2.130255.255.255.0

Switch(config-subif)#ipaddress192.168.3.130255.255.255.0secondary

Switch(config-subif)#noshutdown

10、配置交换机设备的管理地址

配置二层交换机设备的管理地址:

Switch(config)#intvlan1(交换机VLAN1的网关地址就是设备的管理地址)

Switch(config-subif)#ipaddress192.168.2.130255.255.255.0

Switch(config-subif)#noshutdown

配置三层交换机的设备管理地址:

Switch(config)#intloopback0――loopback接口是一种逻辑接口,可以创建无数个

Switch(config-if)#ipaddress192.168.2.130255.255.255.0

Switch(config)#nointloopback0

11、为某个端口配置一个或多个地址

Switch(config)#interfacef0/13

Switch(config-if)#ipaddress192.168.1.130255.255.255.0

Switch(config-if)#ipaddress192.168.1.130255.255.255.0secondary

12、将设备互联的端口设置为trunk,让其通过vlan信息

Switch(config)#intrangef0/40,f0/48  (range的作用是同时对多个端口进行配置)

Switch(config-if)#switchporttrunkencapsulationdot1q

Switch(config-if)#switchporttrunkallowedvlan1-10,12-4094  

(没有这句配置,则说明所有VLAN均能通过trunk)

Switch(config-if)#switchportmodetrunk

(如果要增加vlan100划分到truck时,必须把原有的vlan再都写上)

Switch(config-if)#switchporttrunkallowedvlan1-10,100,12-4094

13、新建port-channel,并将多个端口划分到该port-channel

Switch(config)#interfaceport-channel1

Switch(config)#interfacef0/1

Switch(config-if)#channel-group1modeon

Switch(config)#interfacef0/2

Switch(config-if)#channel-group1modeon

14、删除port-channel,并将该port-channel下的端口删除

Switch(config)#interfacef0/1

Switch(config-if)#nochannel-group1

Switch(config)#nointerfaceport-channel1

15、在三层交换机上配置静态路由

Switch(config)#iproute172.16.1.0255.255.255.010.1.1.1

――iproute目标地址段下一跳地址

16、将源端口的流入或流出流量镜像到目的端口

将源端口的流入或流出流量镜像到目的端口以便于在目的端口接上笔记本电脑,利用anylazer软件抓包,并分析数据包是否正常。

假设6509G4/1作为目的端口,将G4/2作为源端口。

实际应用中一般来说,源端口和目的端口速率应该一致。

IDC-BJ02-6509-1(config)#monitorsession2sourceinterfaceg4/1both

IDC-BJ02-6509-1(config)#monitorsession2destinationinterfaceg4/2

17、SHOW命令的使用

#showversion显示系统硬件配置、软件版本信息及最近一次启动以来连续运行的时间等

#showrunning-configuration显示设备运行配置信息

#showrunning-configintf0/13  显示某个端口的配置信息

#showvlan       显示所有VLAN信息

#showinterfacef0/13显示设备所有或指定接口的状态信息

#showintdescription   显示所有端口的描述信息

#showintstatus显示所有端口的状态信息

#showipintbrief    显示所有端口IP摘要

#showarp显示所有地址解析协议信息

#showmac-address-table显示MAC地址表内容

#showip显示设备上配置的IP地址、子网掩码、网关地址参数,管理VLAN号、域名解析服务器、HTTP信息及路由协议设定等(该命令不被路由器支持,只被交换机支持)

#showiprouter显示某个或所有的路由信息

#showspanning-tree显示STP信息

#showlogging查看系统当前日志设置和缓冲区里的日志信息

#showhistory查看命令缓冲区内容

#showproccpu|exc0.00显示CPU占用的情况(exc表示除值为0以外的进程)

#showplatformcpupacketstat

#showmonitorsession1显示镜像端口的流量情况

下面列举常用命令:

6509-1#showinterfacef0/13显示设备所有或指定接口的状态信息

FastEthernet0/29isup,lineprotocolisup(connected)

 下面列出cisco二层、三层交换机端口不同显示状态的线路连接情况:

二层交换机端口状态:

Status

lineprotocol

线路连接情况

administrativelydown

down

管理员手工关闭端口

down

down(notconnect)

端口己打开,但没插线(初始态)

up

Up(connect)

端口己打开,并且己插线

三层交换机端口状态:

Status

lineprotocol

线路连接情况

administrativelydown

down(disabled)

管理员手工关闭端口

up

down

端口己打开,但没插线(初始态)

up

up

端口己打开,并且己插线

6509-1#shipintbrief

InterfaceIP-AddressOK?

MethodStatusProtocol

Vlan1unassignedYESNVRAMadministrativelydowndown

Vlan75211.100.2.113YESNVRAMupup

Vlan501211.100.34.1YESNVRAMadministrativelydowndown

GigabitEthernet1/1unassignedYESNVRAMupdown

GigabitEthernet1/2unassignedYESNVRAMadministrativelydowndown

GigabitEthernet3/1211.100.2.45YESNVRAMupup

FastEthernet5/22unassignedYESunsetupup

FastEthernet5/23unassignedYESunsetupdown

FastEthernet5/25unassignedYESunsetadministrativelydowndown

6509-1#shintdescription

InterfaceStatusProtocolDescription

Vl10admindowndown

Vl501admindowndownShare34.1

Vl583upupDongFangWangJing1

Vl701admindowndownChengHeWang20041229

Gi1/2admindowndown

Gi3/1upupToM320G0/2/3

Gi3/5updown

Fa5/5upupYiFangDaIp=*****20060601

Fa5/11updownTianYuanKeJiip=****20060525

Fa5/25admindowndown

6509-1#sharp

ProtocolAddressAge(min)HardwareAddrTypeInterface

Internet192.168.10.98350010.db76.8f80ARPAFastEthernet6/48

Internet211.100.28.171530030.4857.353cARPAVlan584

Internet211.100.21.161-00d0.0106.5800ARPAVlan755

Internet211.100.27.1690000f.b587.b194ARPAVlan705

Internet211.100.21.1650IncompleteARPA

6509-1#shintstatus

PortNameStatusVlanDuplexSpeedType

Gi1/1notconnectroutedfull1000NoGBIC

Gi1/2disabledroutedfull1000NoGBIC

Gi4/3disabled747full10001000BaseS

Gi3/1ToM320G0/2/3connectedroutedfull10001000BaseSX

Gi3/3disabled1full1000

Fa5/1To2950-40/1connectedtrunkfull10010/100BaseTX

cisco7507#shversion

CiscoInternetworkOperatingSystemSoftware

IOS(tm)RSPSoftware(RSP-PV-M),Version12.0(17)S,EARLYDEPLOYMENTRELEASE

                         ――ISO版本信息

ROM:

SystemBootstrap,Version11.1(8)CA1,EARLYDEPLOYMENTRELEASESOFTWARE(fc1)                       ――ROM版本信息

cisco7507uptimeis19weeks,3days,4hours,6minutes--设备开机时间

Systemimagefileis"slot0:

rsp-pv-mz.120-17.S.bin"    ――Flash中的IOS映像文件名

ciscoRSP4(R5000)processorwith262144K/2072Kbytesofmemory.  ――处理器信息

1GEIPcontroller(1GigabitEthernet).

3VIP2R5Kcontrollers(4FastEthernet)(2Serial)(2POS).

4FastEthernet/IEEE802.3interface(s)

1GigabitEthernet/IEEE802.3interface(s)

2Serialnetworkinterface(s)

2PacketoverSONETnetworkinterface(s)

123Kbytesofnon-volatileconfigurationmemory.    ――NVRAM值

Configurationregisteris0x2102   ――配置存储器值

查看及修改系统当前日志设置和缓冲区里的日志信息:

cisco7507#shlogging

Sysloglogging:

enabled(0messagesdropped,0flushes,0overruns)

Consolelogging:

leveldebugging,1957messageslogged――控制台的日志信息

Monitorlogging:

leveldebugging,73messageslogged ――Telnet客户端发送的系统日志

Bufferlogging:

disabled              ――缓冲区日志

LoggingExceptionsize(65536bytes)

Traplogging:

levelinformational,472messagelineslogg

――向SNMP管理软件发送的系统日志

cisco7507#conft

cisco7507(config)#loggingbuffer

cisco7507(config)#nologgingbuffer

18、限流方法:

Cisco设备制定限流策略以及应用:

Switch#conft

Switch(config)#access-list1permitany

Switch(config)#class-mapmatch-allc9M

Switch(config-cmap)#matchaccess-group1

Switch(config-cmap)#exit

Switch(config)#policy-mapp9M

Switch(config-pmap)#classc9M

Switch(config-pmap-c)#police90000004096exceed-actiondrop

Switch(config-pmap-c)#exit

Switch#conft

Switch(config)#interfacef0/13

Switch(config-if)#service-policyinputp9M

Switch(config-if)#exit

Switch(config)#interfacef0/14

Switch(config-if)#service-policyinputp9M

Switch(config-if)#exit

Switch#wr

19、ACL使用方法

Switch(config)#access-listaccess-list-number{permit|deny}{protocol}

{sourcesource-wildcard|any}{destinationdestination-wildcard|any}

例1:

允许北京电信IDC内部的ip地址telnet到各个网络设备

Switch(config)#access-list101permittcp218.30.26.00.0.0.63anyeqtelnet

Switch(config)#access-list101permittcp218.30.27.00.0.0.127anyeqtelnet

Switch(config)#access-list101permittcp218.30.25.00.0.0.255anyeqtelnet

例2:

ACL限制对客户的192.168.1.119的访问

Switch(config)#access-list130denyiphost192.168.1.119any

Switch(config)#access-list130permitipanyany

Switch(config)#interfacef0/22

Switch(config-if)#ipaccess-group130in

例3:

172.21.0.0(VLAN31)、172.22.0.0(VLAN32)、172.23.0.0(VLAN33)三个网段之间不能互相访问,其他网段均能访问,配置方法如下:

SS6509-1#conft

SS6509-1(config)#access-list101denyipany172.22.0.00.0.255.255

SS6509-1(config)#access-list101denyipany172.23.0.00.0.255.255

SS6509-1(config)#access-list101permitipanyany

SS6509-1(config)#access-list102denyipany172.21.0.00.0.255.255

SS6509-1(config)#access-li

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

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1