导航:首页 > 程序命令 > cisco基本命令

cisco基本命令

发布时间:2022-12-29 23:53:56

❶ cisco常用命令

cisco常用命令大全

为帮助大家更好通过思科认证。我为大家分想的是思科认证基本命令,欢迎参考阅读!

路由器的几个基本命令:

Router>enable 进入特权模式

Router#disable 从特权模式返回到用户模式

Router#configure terminal 进入到全局配置模式

Router(config)#interface ethernet 1 进入到路由器编号为1的以太网口

exit 返回上层模式

end 直接返回到特权模式

========================================================

注意:

1、CISCO CATALYST(交换机),如果在初始化时没有发现“用户配置”文件,就会自动载入Default Settings(默认配置)文件,进行交换机初始化,以确保交换机正常工作。

2、CISCO Router(路由器)在初始化时,如果没有发现“用户配置”文件,系统会自动进入到“初始化配置模式”(系统配置对话模式,SETUP模式, STEP BY STEP CONFIG模式),不能正常工作!

========================================================

1、CONSOLE PORT(管理控制台接口):距离上限制,独占的方式。刚开始配置的时候一般使用这个。

2、AUX port(辅助管理接口):可以挂接MODEM实现远程管理,独占的方式。

3、Telnet:多人远程管理(决定于性能,VTY线路数量)不安全。后期维护,远程管理登陆。

========================================================

注意:

交换机、路由器配置命令都是回车后立即执行,立即生效的。在运行中的机器上修改命令的时候要特别注意。

========================================================

Router(config)#hostname ?

WORD This system's network name

在配置模式下修改当前主机的本地标识,例:

------------------

Router(config)#hostname r11

r11(config)#

------------------

r11(config-if)#ip address ?

A.B.C.D IP address

为当前端口设置IP地址,使用前先进入需要配置的端口,例:

------------------

r11(config)#interface ethernet 1

r11(config-if)#ip address 172.16.1.1 255.255.255.0

------------------

r11>show version

r11#show version 观察IOS版本,设备工作时间,相关接口列表

r11#show running-config 查看当前生效的配置,此配置文件存储在RAM

r11#show interfaces ethernet 1 查看以太网接口的状态,工作状态等等等...

========================================================

r11#reload 重新加载Router(重启)

r11#setup 手工进入setup配置模式

r11#show history 查看历史命令(最近刚用过的命令)

r11#terminal history size <0-256> 设置命令缓冲区大小,0 : 代表不缓存

r11# running-config startup-config 保存当前配置

注意概念:

nvram:非易失性内存,断电信息不会丢失 <-- 用户配置 <-- 保存着startup-config

ram:随机存储器,断电信息全部丢失 <-- 当前生效配置 <-- 保存着running-config

startup-config:在每次路由器或是交换机启动时候,会主动加载(默认情况)

========================================================

设置说明和密码的几个命令:

r11(config)#banner motd [char c] 同时要以[char c]另起一行结束,描述机器登陆时的说明

r11(config-if)#description 描述接口注释,需要在端口配置模式下

配置console口密码:

------------------

r11(config)#line console 0 进入到consolo 0

r11(config-line)#password eliuzd 设置一个密码为“eliuzd”

r11(config-line)#login 设置login(登陆)时使用密码

------------------

配置enable密码:

------------------

r11(config)#enable password cisco 设置明文的enable密码

r11(config)#enable secret eliuzd 设置暗文的enable密码(优先于明文被使用)

r11(config)#service password-encryption 加密系统所有明文密码(功能较弱)

------------------

配置Telnet密码:

------------------

r11(config)#line vty 0

r11(config-line)#password cisco

r11(config-line)#login

------------------

========================================================

配置虚拟回环接口:(回环接口默认为UP状态)

(config)# 下,虚拟一个端口

------------------

r11(config)#interface loopback 0 创建一个回环接口loopback 0

r11(config-if)#ip address 192.168.1.1 255.255.255.0 配置它的IP地址

no * 做配置的反向操作(删除配置)

------------------

=========================================================

路由器 DCE/DTE 仅存在广域网中r11#show controllers serial 0 用于查看DCE与DTE的属性,serial 0路由器广域网端口

DCE的Router需要配置时钟频率

r11(config-if)#clock rate ? 配置DCE接口的时钟频率(系统指定频率)

一般实际情况下,这个不需要自己配置,因为DCE设备都在运营商那。

=========================================================

r11#show interfaces serial 1

查看端口状态,第一行提示说明

Serial1 is administratively down, Line protocol is down

没有使用no shutdown命令激活端口

Serial1 is down, Line protocol is down

1、对方没有no shutdown激活端口

2、线路损坏,接口没有任何连接线缆

Serial1 is up, line protocol is down

1、对方没有配置相同的二层协议,Serial接口default encapsulation: HDLC

2、可能没有配置时钟频率

3、可能没有正确的配置三层地址(可能)

Serial1 is up,line protocol is up

接口工作正常

========================================================

查看CDP信息的几个命令:

r11#show cdp neighbors 查看CDP的邻居(不含IP)

r11#show cdp neighbors detail 查看CDP的邻居(包含三层的IP地址)

r11#show cdp entry * 查看CDP的邻居(包含三层的IP地址)老命令

r1(config)#no cdp run 在全局配置模式关闭CDP协议(影响所有的接口)

r1(config-if)#no cdp enable 在接口下关闭CDP协议(仅仅影响指定的接口)

r11#clear cdp table 清除CDP邻居表

r11#show cdp interface serial 1 查看接口的CDP信息

注意两个提示:

Sending CDP packets every 60 seconds(每60秒发送cdp数据包)

HoldTime 180 seconds(每个cdp数据包保持180秒)

========================================================

r11(config)#ip host 设置静态的主机名映射

r11#show sessions 查看设置过的映射主机名

========================================================

Telnet *.*.*.* 被telnet的设备,需要设置line vty的密码,如果需要进入特权模式需要配置enable密码

例:

------------------

Router#telnet 192.168.1.1

------------------

Router#show users 查看登录到本地的用户

Router#show sessions 查看从本地telnet外出的会话

Router#clear line * 强制中断“telnet到本地”的会话

Router#disconnect * 强制中断“telnet外出”的会话

========================================================

以下只是在实验时连接交换机上切换登陆路由器的命令,可以跳过。

>show hosts 显示当前的主机名配置

>show sessions 显示当前的外出TELNET会话

>clear line XXX 清除线路

+ 直接返回到特权模式

++<6> + x

========================================================

Access-enable允许路由器在动态访问列表中创建临时访问列表入口

Access-group把访问控制列表(ACL)应用到接口上

Access-list定义一个标准的IP ACL

Access-template在连接的路由器上手动替换临时访问列表入口

Appn向APPN子系统发送命令

Atmsig 执行ATM信令命令

B 手动引导操作系统

Bandwidth 设置接口的带宽

Banner motd 指定日期信息标语

Bfe 设置突发事件手册模式

Boot system 指定路由器启动时加载的系统映像

Calendar 设置硬件日历

Cd 更改路径

Cdp enable 允许接口运行CDP协议

Clear 复位功能

Clear counters 清除接口计数器

Clear interface 重新启动接口上的件逻辑

Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率

Cmt 开启/关闭FDDI连接管理功能

Config-register 修改配置寄存器设置

Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息

Configure memory 从NVRAM加载配置信息

Configure terminal 从终端进行手动配置

Connect 打开一个终端连接

Copy 复制配置或映像数据

Copy flash tftp 备份系统映像文件到TFTP服务器

Copy running-config startup-config 将RAM中的当前配置存储到NVRAM

Copy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上

Copy tftp flash 从TFTP服务器上下载新映像到Flash

Copy tftp running-config 从TFTP服务器上下载配置文件

Debug 使用调试功能

Debug dialer 显示接口在拨什么号及诸如此类的信息

Debug ip rip 显示RIP路由选择更新数据

Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息

Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息

Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程

Debug ppp 显示在实施PPP中发生的业务和交换信息

Delete 删除文件

Deny 为一个已命名的IP ACL设置条件

Dialer idle-timeout 规定线路断开前的空闲时间的长度

❷ cisco基本配置命令

Cisco 的交换机产品以“Catalyst ”为商标,包含1900 、2800 、2900 、3500 、4000 、5000 、5500 、6000 、8500 等十多个系列。

基本配置命令如下:

1、Switch>enable 进入特权模式

2、Switch #config terminal 进入全局配置模式

3、Switch(config)#hostname 设置交换机的主机名

4、Switch(config)#enable password 进入特权模式的密码(明文形式保存)

5、Switch(config)#enablesecret 加密密码(加密形式保存) (优先)

6、Switch(config)#ipdefault-gateway 配置交换机网关

7、Switch(config)#showmac-address-table 查看MAC地址

8、Switch(config)loggingsynchronous 阻止控制台信息覆盖命令行上的输入

9、Switch(config)no ipdomain-lookup 关闭DNS查找功能

10、Switch(config)exec-timeout 00 阻止会话退出

(2)cisco基本命令扩展阅读

cisco常用配置命令:

一、使用Telnet远程式管理

1、Switch(config)#line vty 0 4 进入虚拟终端

2、Switch (config-line)# password 设置登录口令

3、Switch(config-line)# login 要求口令验证

二、控制台口令

1、switch(config)#lineconsole 0 进入控制台口

2、switch(config-line)# password xx

3、switch(config-line)#设置登录口令login 允许登录

三、恢复出厂配置

Switch(config)#erasestartup-config

Switch(config)delete vlan.dat

❸ Cisco常用的路由器交换机配置命令

cisco制造的路由器设备、交换机和其他设备承载了全世界80%的互联网通信,成为硅谷中新经济的传奇,那么你了解Cisco常用的路由器交换机配置命令吗?下面是我整理的一些关于Cisco常用的路由器交换机配置命令的相关资料,供你参考。

Cisco常用的路由器支持的命令:

路由器显示命令:

router#show run ;显示配置信息

router#show interface ;显示接口信息

router#show ip route ;显示路由信息

router#show cdp nei ;显示邻居信息

router#reload ;重新起动

路由器口令设置:

router>enable ;进入特权模式

router#config terminal ;进入全局配置模式

router(config)#hostname ;设置交换机的主机名

router(config)#enable secret xxx ;设置特权加密口令

router(config)#enable password xxb ;设置特权非密口令

router(config)#line console 0 ;进入控制台口

router(config-line)#line vty 0 4 ;进入虚拟终端

router(config-line)#login ;要求口令验证

router(config-line)#password xx ;设置登录口令xx

router(config)#(Ctrl+z) ; 返回特权模式

router#exit ;返回命令

路由器配置:

router(config)#int s0/0 ;进入Serail接口

router(config-if)#no shutdown ;激活当前接口

router(config-if)#clock rate 64000 ;设置同步时钟

router(config-if)#ip address ;设置IP地址

router(config-if)#ip address second ;设置第二个IP

router(config-if)#int f0/0.1 ;进入子接口

router(config-subif.1)#ip address ;设置子接口IP

router(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议

router(config)#config-register 0x2142 ;跳过配置文件

router(config)#config-register 0x2102 ;正常使用配置文件

router#reload ;重新引导

路由器文件操作:

router# running-config startup-config ;保存配置

router# running-config tftp ;保存配置到tftp

router# startup-config tftp ;开机配置存到tftp

router# tftp flash: ;下传文件到flash

router# tftp startup-config ;下载配置文件

ROM状态:

Ctrl+Break ;进入ROM监控状态

rommon>confreg 0x2142 ;跳过配置文件

rommon>confreg 0x2102 ;恢复配置文件

rommon>reset ;重新引导

rommon> xmodem: flash: ;从console传输文件

rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP

rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码

rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP

rommon>TFTP_FILE=c2600.bin ;指定下载的文件

rommon>tftpdnld ;从tftp下载

rommon>dir flash: ;查看闪存内容

rommon>boot ;引导IOS

静态路由:

ip route ;命令格式

router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例

router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例

动态路由:

router(config)#ip routing ;启动路由转发

router(config)#router rip ;启动RIP路由协议。

router(config-router)#network ;设置发布路由

router(config-router)#negihbor ;点对点帧中继用。

帧中继命令:

router(config)#frame-relay switching ;使能帧中继交换

router(config-s0)#encapsulation frame-relay ;使能帧中继

router(config-s0)#fram-relay lmi-type cisco ;设置管理类型

router(config-s0)#frame-relay intf-type DCE ;设置为DCE

router(config-s0)#frame-relay dlci 16 ;

router(config-s0)#frame-relay local-dlci 20 ;设置虚电路号

router(config-s0)#frame-relay interface-dlci 16 ;

router(config)#log-adjacency-changes ;记录邻接变化

router(config)#int s0/0.1 point-to-point ;设置子接口点对点

router#show frame pvc ;显示永久虚电路

router#show frame map ;显示映射

基本访问控制列表:

router(config)#access-list permit|deny

router(config)#interface ;default:deny any

router(config-if)#ip access-group in|out ;defaultut

例1:

router(config)#access-list 4 permit 10.8.1.1

router(config)#access-list 4 deny 10.8.1.0 0.0.0.255

router(config)#access-list 4 permit 10.8.0.0 0.0.255.255

router(config)#access-list 4 deny 10.0.0.0 0.255.255.255

router(config)#access-list 4 permit any

router(config)#int f0/0

router(config-if)#ip access-group 4 in

扩展访问控制列表:

access-list permit|deny icmp [type]

access-list permit|deny tcp [port]

例3:

router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo

router(config)#access-list 101 permit ip any any

router(config)#int s0/0

router(config-if)#ip access-group 101 in

例3:

router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80

router(config)#access-list 102 permit ip any any

router(config)#interface s0/1

router(config-if)#ip access-group 102 out

删除访问控制例表:

router(config)#no access-list 102

router(config-if)#no ip access-group 101 in

路由器的nat配置

Router(config-if)#ip nat inside ;当前接口指定为内部接口

Router(config-if)#ip nat outside ;当前接口指定为外部接口

Router(config)#ip nat inside source static [p] [port]

Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1

Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80

Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0

Router(config)#ip nat inside source list 1 pool p1

Router(config)#ip nat inside destination list 2 pool p2

Router(config)#ip nat inside source list 2 interface s0/0 overload

Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary

Router#show ip nat translation

rotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配。

overload参数用于PAT 将内部IP映射到一个公网IP不同的端口上。

外部网关协议配置

routerA(config)#router bgp 100

routerA(config-router)#network 19.0.0.0

routerA(config-router)#neighbor 8.1.1.2 remote-as 200

配置PPP验证:

RouterA(config)#username password

RouterA(config)#int s0

RouterA(config-if)#ppp authentication {chap|pap}

3.PIX防火墙命令

Pix525(config)#nameif ethernet0 outside security0 ;命名接口和级别

Pix525(config)#interface ethernet0 auto ;设置接口方式

Pix525(config)#interface ethernet1 100full ;设置接口方式

Pix525(config)#interface ethernet1 100full shutdown

Pix525(config)#ip address inside 192.168.0.1 255.255.255.0

Pix525(config)#ip address outside 133.0.0.1 255.255.255.252

Pix525(config)#global (if_name) natid ip-ip ;定义公网IP区间

Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15 ;例句

Pix525(config)#global (outside) 1 133.0.0.1 ;例句

Pix525(config)#no global (outside) 1 133.0.0.1 ;去掉设置

Pix525(config)#nat (if_name) nat_id local_ip [netmark]

Pix525(config)#nat (inside) 1 0 0

内网所有主机(0代表0.0.0.0)可以访问global 1指定的外网。

Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0

内网172.16.5.0/16网段的主机可以访问global 1指定的外网。

Pix525(config)#route if_name 0 0 gateway_ip [metric] ;命令格式

Pix525(config)#route outside 0 0 133.0.0.1 1 ;例句

Pix525(config)#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1 ;例句

Pix525(config)#static (inside, outside) 133.0.0.1 192.168.0.8

表示内部ip地址192.168.0.8,访问外部时被翻译成133.0.0.1全局地址。

Pix525(config)#static (dmz, outside) 133.0.0.1 172.16.0.8

中间区域ip地址172.16.0.8,访问外部时被翻译成133.0.0.1全局地址。

Cisco常用的交换机支持的命令:

交换机基本状态:

switch: ;ROM状态, 路由器是rommon>

hostname> ;用户模式

hostname# ;特权模式

hostname(config)# ;全局配置模式

hostname(config-if)# ;接口状态

交换机口令设置:

switch>enable ;进入特权模式

switch#config terminal ;进入全局配置模式

switch(config)#hostname ;设置交换机的主机名

switch(config)#enable secret xxx ;设置特权加密口令

switch(config)#enable password xxa ;设置特权非密口令

switch(config)#line console 0 ;进入控制台口

switch(config-line)#line vty 0 4 ;进入虚拟终端

switch(config-line)#login ;允许登录

switch(config-line)#password xx ;设置登录口令xx

switch#exit ;返回命令

交换机VLAN设置:

switch#vlan database ;进入VLAN设置

switch(vlan)#vlan 2 ;建VLAN 2

switch(vlan)#no vlan 2 ;删vlan 2

switch(config)#int f0/1 ;进入端口1

switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2

switch(config-if)#switchport mode trunk ;设置为干线

switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan

switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继

switch(config)#vtp domain ;设置发vtp域名

switch(config)#vtp password ;设置发vtp密码

switch(config)#vtp mode server ;设置发vtp模式

switch(config)#vtp mode client ;设置发vtp模式

交换机设置IP地址:

switch(config)#interface vlan 1 ;进入vlan 1

switch(config-if)#ip address ;设置IP地址

switch(config)#ip default-gateway ;设置默认网关

switch#dir flash: ;查看闪存

交换机显示命令:

switch#write ;保存配置信息

switch#show vtp ;查看vtp配置信息

switch#show run ;查看当前配置信息

switch#show vlan ;查看vlan配置信息

switch#show interface ;查看端口信息

switch#show int f0/0 ;查看指定端口信息

❹ 思科路由器设置方法和常见配置命令

思科路由器设置方法和常见配置命令

思科路由器怎么设置,是我们经常遇到的问题,下面我准备了关于思科路由器设置方法和常见配置命令,欢迎大家参考学习!

一、基本设置方式

一般来说,可以用5种方式来设置Cisco思科路由器:

1.Console口接终端或运行终端仿真软件的微机;

2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;

3.通过Ethernet上的TFTP服务器;

4.通过Ethernet上的TELNET程序;

5.通过Ethernet上的SNMP网管工作站。

但Cisco思科路由器的第一次设置必须通过第一种方式进行,一般用超级终端通过com口进行控制。此时终端的硬件设置如下:

波特率 :9600

数据位 :8

停止位 :1

奇偶校验: 无

二、命令操作

Cisco思科路由器所用的操作系统是IOS.共有以下几种状态:

1、router>

在router>提示符下,Cisco思科路由器处于用户命令状态,这时用户可以看Cisco思科路由器的连接状态,访问其它网络和主机,但不能看到和更改Cisco思科路由器的设置内容。此时输入?并回车,可以查看到在此状态下可以用的命令。(IOS允许你在任何时候用这种方式查看在某种状态下可以用的命令)。在敲入enable并回车后,按照系统提示输入密码,(在新的Cisco思科路由器第一次进行调试的时候不需要输入密码,直接回车即可)进入#提示符,就可以对Cisco思科路由器进行各种操作了。

2、router#

Cisco思科路由器进入特权命令状态router#后,不但可以执行所有的用户命令,还可以看到和更改Cisco思科路由器的设置内容。此时就可以对Cisco思科路由器的名字、密码等进行设置。

3、router(config)#

在router#提示符下键入configure terminal,出现提示符router(config)#,此时Cisco思科路由器处于全局设置状态,这时可以设置Cisco思科路由器的全局参数。

4、router(config-if)#;

router(config-line)#;

router(config-router)#;…

Cisco思科路由器处于局部设置状态,这时可以设置Cisco思科路由器某个局部的参数。

5、Cisco思科路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时Cisco思科路由器不能完成正常的功能,只能进行软件升级和手工引导。在此状态下,可以进行口令恢复。

三、常用命令

1.帮助

在IOS操作中,无论任何状态和位置,都可以键入“?”得到系统的帮助。系统会显示此时可以使用的命令。

2.改变命令状态

任务命令

进入特权命令状态enable

退出特权命令状态disable

进入设置对话状态Setup

进入全局设置状态config terminal

退出全局设置状态End

进入端口设置状态interface type slot/number

进入子端口设置状态interface type number.subinterface [point-to-point | multipoint]

进入线路设置状态line type slot/number

进入路由设置状态router protocol

退出局部设置状态Exit

3.显示命令

任务命令

查看版本及引导信息show version

查看运行设置show running-config

查看开机设置show startup-config

显示端口信息show interface type slot/number

显示路由信息show ip router

4.拷贝命令

用于IOS及CONFIG的备份和升级

5.网络命令

任务命令

登录远程主机telnet hostname|IP address

网络侦测ping hostname|IP address

路由跟踪Trace hostname|IP address

6.基本设置命令

任务命令

全局设置config terminal

设置访问用户及密码username username password password

设置特权密码enable secret password

设置Cisco思科路由器名hostname name

设置静态路由ip route destination subnet-mask next-hop

启动IP路由ip routing

启动IPX路由Ipx routing

端口设置interface type slot/number

设置IP地址ip address address subnet-mask

设置IPX网络Ipx network network

激活端口no shutdown

物理线路设置line type number

启动登录进程login [local|tacacs server]

设置登录密码password password

本文描述了如何进行思科路由器的基本设置,基本的命令操作以及常用命令进行操作和总体的.设置,并讲述了一些基本的服务设置。

四、总体设置

在router#特权命令状态下,可以用setup对Cisco思科路由器进行总体设计,利用这个设计过程可以省略手工设置的烦琐。但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。

进入设置对话过程后,Cisco思科路由器首先会显示一些提示信息:

--- System Configuration Dialog ---

At any point you may enter a question mark '?' for help.

Use ctrl-c to abort configuration dialog at any prompt.

Default settings are in square brackets '[]'.

这是告诉你在设置对话过程中的任何地方都可以键入“?”得到系统的帮助,按ctrl-c可以退出设置过程,缺省设置将显示在‘[]’中。然后Cisco思科路由器会问是否进入设置对话:

Would you like to enter the initial configuration dialog? [yes]:

如果按y或回车,Cisco思科路由器就会进入设置对话过程。首先你可以看到各端口当前的状况:

First, would you like to see the current interface summary? [yes]:

Any interface listed with OK? value "NO" does not have a valid configuration

InterfaceIP-AddressOK?MethodStatusProtocol

Serial0unassignedNOunsetupup

……………………………

然后,Cisco思科路由器就开始全局参数的设置:

Configuring global parameters:

1.设置Cisco思科路由器名:

Enter host name [Router]:

2.设置进入特权状态的密文(secret),此密文在设置以后不会以明文方式显示:

The enable secret is a one-way cryptographic secret used

instead of the enable password when it exists.

Enter enable secret: cisco

3.设置进入特权状态的密码(password),此密码只在没有密文时起作用,并且在设置以后会以明文方式显示:

The enable password is used when there is no enable secret

and when using older software and some boot images.

Enter enable password: pass

4.设置虚拟终端访问时的密码:

Enter virtual terminal password: cisco

5.询问是否要设置Cisco思科路由器支持的各种网络协议:

Configure SNMP Network Management? [yes]:

Configure DECnet? [no]:

Configure AppleTalk? [no]:

Configure IPX? [no]:

Configure IP? [yes]:

Configure IGRP routing? [yes]:

Configure RIP routing? [no]:

………

6.如果配置的是拨号访问服务器,系统还会设置异步口的参数:

Configure Async lines? [yes]:]

1)设置线路的最高速度:

Async line speed [9600]:

2)是否使用硬件流控:

Configure for HW flow control? [yes]:

3)是否设置modem:

Configure for modems? [yes/no]: yes

4)是否使用默认的modem命令:

Configure for default chat script? [yes]:

5)是否设置异步口的PPP参数:

Configure for Dial-in IP SLIP/PPP access? [no]: yes

6)是否使用动态IP地址:

Configure for Dynamic IP addresses? [yes]:

7)是否使用缺省IP地址:

Configure Default IP addresses? [no]: yes

是否使用TCP头压缩

Configure for TCP Header Compression? [yes]:

9)是否在异步口上使用路由表更新:

Configure for routing updates on async links? [no]: y

10)是否设置异步口上的其它协议。接下来,系统会对每个接口进行参数的设置。

1.Configuring interface Ethernet0:

1)是否使用此接口:

Is this interface in use? [yes]:

2)是否设置此接口的IP参数:

Configure IP on this interface? [yes]:

3)设置接口的IP地址:

IP address for this interface: 192.168.162.2

4)设置接口的IP子网掩码:

Number of bits in subnet field [0]:

Class C network is 192.168.162.0, 0 subnet bits; mask is /24

在设置完所有接口的参数后,系统会把整个设置对话过程的结果显示出来:

The following configuration command script was created:

hostname Router

enable secret 5 $W5Oh$p6J7tIgRMBOIKVXVG53Uh1

enable password pass

…………

请注意在enable secret后面显示的是乱码,而enable password后面显示的是设置的内容。就是说,secret密码的优先级比较高,在两个密码都设了的情况下,secret密码起作用。

显示结束后,系统会问是否使用这个设置:

Use this configuration? [yes/no]: yes

如果回答yes,系统就会把设置的结果存入Cisco思科路由器的NVRAM中,然后结束设置对话过程,使Cisco思科路由器开始正常的工作。

五、广域网协议设置

PPP

PPP(Point-to-Point Protocol)是SLIP(Serial Line IP protocol)的继承者,它提供了跨过同步和异步电路实现Cisco思科路由器到Cisco思科路由器(router-to-router)和主机到网络(host-to-network)的连接。

CHAP(Challenge Handshake Authentication Protocol)和PAP(Password Authentication Protocol) (PAP)通常被用于在PPP封装的串行线路上提供安全性认证。使用CHAP和PAP认证,每个Cisco思科路由器通过名字来识别,可以防止未经授权的访问。

任务命令

设置PPP封装encapsulation ppp1

设置认证方法ppp authentication {chap | chap pap | pap chap | pap} [if-needed] [list-name | default] [callin]

指定口令username name password secret

设置DCE端线路速度clockrate speed

;

❺ Cisco基础配置命令#注释

R1(config)#banner motd # 提示信息,#(分界符)

设置console密码

R1(config)#line console 0 进入console 0

R1(config-line)#login 允许登陆

R1(config-line)#password cisco 设置密码

R1(config-line)#logging synchronous 使光标还原到原来的位置,重新显示被覆盖的命令里

R1(config-line)#exec-timeout 0 0 阻止会话退出(前1个0单位是“分钟”,后1个0单位是“秒”)

设置特权密码

#enable password cisco 设置明文密码cisco(进特权模式密码)

#service password-encryption 加密上面的明文密码

#enable secret cisco1 设置密文密码cisco1(进特权模式密码)

当明文密码和密文密码同时存在时,密码密码的优先级要高于明文密码

R1(config)#line vty 0 4 设置虚拟终端 允许0~4共5个用户同时登陆

R1(config-line)#password cisco 设置明文密码cisco

R1(config-line)#login local 登陆采用本地密码验证

R1(config)# running-config startup-config 保存配置

R1#show startup-config 查看NVRAM里面的配置

R1#reload 重新启动

R1(config)#interface ethernet 0 进入接口模式

R1(config-if)#description Telecom 提示信息

R1(config-if)#ip add 10.10.10.1 255.255.255.0

R1#show interfaces serial 1 查看接口状态,如果封装协议不同会显示一端接口up,另一端接口down

R1#show interfaces serial 0

R1#show controller serial 0 查看哪一端是DCE或DTE

R1(config)#interface serial 0 进入子接口

R1(config-if)#clock rate 64000 必须在DCE端配置,两个路由器之间通讯必须配置时钟同步

R1(config-if)#no shutdown 开启端口

R1#show cdp 思科专有发现协议CDP,发现直接相邻的设备

entry 详细信息 show cdp entry *

interface 接口

neighbors 邻居

traffic 接口数据包情况汇总

R1(config)#no cdp run 所有接口取消CDP

R1(config)#interface serial 0 假如我想只关掉serial 0接口的CDP协议,进入接口

R1(config-if)#no cdp enable 关闭这个接口CDP

Router>en 进特权模式

Router#conf t 进全局模式

Router(config)#line con 0 进console口

Router(config-line)#logg sy 光标跟随不覆盖命令

Router(config-line)#exec-t 0 0 会话永不超时

Router(config-line)#exi 退回上层

Router(config)#no ip domain-lo 取消域名解析

Router(config)#host R1 重命名路由器名称

创建VLAN

SW#vlan database 进入vlan模式

SW(vlan)#vlan 2 name cisco 创建vlan2并命名为cisco

SW(config)#int fa 0/2 在全局模式下进入快速以太网接口2

SW(config-if)#switchport mode access 定义端口为访问接口模式(接口模式分为"trunk"主干接口和访问接口)

SW(config-if)#switchport access vlan 2 将端口2加入到vlan2中

SW(config-if)#no shutdown

Trunk配置

SW#vlan database

SW#conf t

SW(config)#int fa 0/1

SW(config-if)#switchport mode trunk 定义端口为主干接口模式

SW(config-if)#switchport trunk encapsulation dot1q 封装dot1q协议

SW(config-if)#no shutdown

Telnet相关命令

Router#show session 查看连接的是哪台设备

Router#show user 查看登录的用户

RouterB# X 先按Ctrl+Shift+6然后再按X就切换到路由A上面

RouterA#show session

RouterA#resume 1 返回到路由器B上面

RouterB# disconnect 断开连接

RouterA#clear line 0 清除远端设备建立的会话

show version ! 检查配置寄存器的值

show flash ! 检查Flash中的ISO

show startup-config ! 检查NVRAM中的启动配置文件

show running-config ! 检查RAM中的文件

Router#erase startup-config 删除NVRAM中的配置文件

Router(config)#config-register 0x2101 修改寄存器的值(0x2102 正常的值,0x2142 跳过配置文件,0x2101 进入迷你ios)

Router# running-config startup-config 保存配置文件

Router#write 保存配置文件(全程保存配置)

cisco2600、3600等新系列路由器密码破解

1.启动路由器,60秒内按下CTRL+break键

2.rommon>confreg 0x2142 配置启动时不引导配置文件

3.rommon>reset 重启

4.router# startup-config running-config 将NVRAM里面的配置文件拷贝到内存中(进特权模式操作)

5.router(config)#no enable secrect 取消特权密码

6.router(config-line)#no password 取消vty密码

7.router# running-config startup 保存

8.router(config)#config-register 0x2102

配置VTP

SW#vlan database

SW(vlan)#vtp server VTP服务器端,另一台交换机设置为client客户端

SW(vlan)#vtp domain cisco 设置VTP域名为cisco ,客户端同样设置

SW(vlan)#vtp password cisco 设置密码为cisco ,客户端同样设置

❻ 思科配置命令详细介绍

思科配置命令详细介绍

对于刚想学计算机网络技术的朋友,首先接触的就是思科路由器,下面是我给大家带来的最详细的CISCO路由器配置命令及方法:

第一章 路由器配置基础

一、基本设置方式

二、命令状态

三、设置对话过程

四、常用命令

五、配置IP寻址

六、配置静态路由

第二章 广域网协议设置

一、HDLC

二、PPP

三、X.25

四、Frame Relay

五、ISDN

六、PSTN

第三章 路由协议设置

一、RIP协议

二、IGRP协议

三、OSPF协议

四、重新分配路由

五、IPX协议设置

第四章 服务质量及访问控制

一、协议优先级设置

二、队列定制

三、访问控制

第五章 虚拟局域网(VLAN)路由

一、虚拟局域网(VLAN)

二、交换机间链路(ISL)协议

三、虚拟局域网(VLAN)路由实例

第一章:路由器配置基础

一、基本设置方式

一般来说,可以用5种方式来设置路由器:

1.Console口接终端或运行终端仿真软件的微机;

2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;

3.通过Ethernet上的TFTP服务器;

4.通过Ethernet上的TELNET程序;

5.通过Ethernet上的SNMP网管工作站。

但路由器的第一次设置必须通过第一种方式进行,此时终端的硬件设置如下:

波特率 :9600

数据位 :8

停止位 :1

奇偶校验: 无

二、命令状态

1. router>

路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容。

2. router#

在router>提示符下键入enable,路由器进入特权命令状态router#,这时不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。

3. router(config)#

在router#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。

4. router(config-if)#; router(config-line)#; router(config-router)#;…

路由器处于局部设置状态,这时可以设置路由器某个局部的参数。

5. >

路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。

设置对话状态

这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状态,这时可通过对话方式对路由器进行设置。

三、设置对话过程

显示提示信息

全局参数的设置

接口参数的设置

显示结果

利用设置对话过程可以避免手工输入命令的烦琐,但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。

进入设置对话过程后,路由器首先会显示一些提示信息:

--- System Configuration Dialog ---

At any point you may enter a question mark '?' for help.

Use ctrl-c to abort configuration dialog at any prompt.

Default settings are in square brackets '[]'.

这是告诉你在设置对话过程中的任何地方都可以键入“?”得到系统的帮助,按ctrl-c可以退出设置过程,缺省设置将显示在‘[]’中。然后路由器会问是否进入设置对话:

Would you like to enter the initial configuration dialog? [yes]:

如果按y或回车,路由器就会进入设置对话过程。首先你可以看到各端口当前的状况:

First, would you like to see the current interface summary? [yes]:

Any interface listed with OK? value "NO" does not have a valid configuration

Interface IP-Address OK? Method Status Protocol

Ethernet0 unassigned NO unset up up

Serial0 unassigned NO unset up up

……… ……… … …… … …

然后,路由器就开始全局参数的设置:

Configuring global parameters:

1.设置路由器名:

Enter host name [Router]:

2.设置进入特权状态的密文(secret),此密文在设置以后不会以明文方式显示:

The enable secret is a one-way cryptographic secret used

instead of the enable password when it exists.

Enter enable secret: cisco

3.设置进入特权状态的密码(password),此密码只在没有密文时起作用,并且在设置以后会以明文方式显示:

The enable password is used when there is no enable secret

and when using older software and some boot images.

Enter enable password: pass

4.设置虚拟终端访问时的密码:

Enter virtual terminal password: cisco

5.询问是否要设置路由器支持的各种网络协议:

Configure SNMP Network Management? [yes]:

Configure DECnet? [no]:

Configure AppleTalk? [no]:

Configure IPX? [no]:

Configure IP? [yes]:

Configure IGRP routing? [yes]:

Configure RIP routing? [no]:

………

6.如果配置的是拨号访问服务器,系统还会设置异步口的参数:

Configure Async lines? [yes]:

1) 设置线路的最高速度:

Async line speed [9600]:

2) 是否使用硬件流控:

Configure for HW flow control? [yes]:

3) 是否设置modem:

Configure for modems? [yes/no]: yes

4) 是否使用默认的modem命令:

Configure for default chat s cript? [yes]:

5) 是否设置异步口的PPP参数:

Configure for Dial-in IP SLIP/PPP access? [no]: yes

6) 是否使用动态IP地址:

Configure for Dynamic IP addresses? [yes]:

7) 是否使用缺省IP地址:

Configure Default IP addresses? [no]: yes

8) 是否使用TCP头压缩:

Configure for TCP Header Compression? [yes]:

9) 是否在异步口上使用路由表更新:

Configure for routing updates on async links? [no]: y

10) 是否设置异步口上的其它协议。

接下来,系统会对每个接口进行参数的设置。

1.Configuring interface Ethernet0:

1) 是否使用此接口:

Is this interface in use? [yes]:

2) 是否设置此接口的IP参数:

Configure IP on this interface? [yes]:

3) 设置接口的IP地址:

IP address for this interface: 192.168.162.2

4) 设置接口的IP子网掩码:

Number of bits in subnet field [0]:

Class C network is 192.168.162.0, 0 subnet bits; mask is /24

在设置完所有接口的参数后,系统会把整个设置对话过程的结果显示出来:

The following configuration command s cript was created:

hostname Router

enable secret 5 $1$W5Oh$p6J7tIgRMBOIKVXVG53Uh1

enable password pass

…………

请注意在enable secret后面显示的是乱码,而enable password后面显示的是设置的内容。

显示结束后,系统会问是否使用这个设置:

Use this configuration? [yes/no]: yes

如果回答yes,系统就会把设置的结果存入路由器的NVRAM中,然后结束设置对话过程,使路由器开始正常的工作。

四、常用命令

1. 帮助

在IOS操作中,无论任何状态和位置,都可以键入“?”得到系统的帮助。

2. 改变命令状态

任务 命令

进入特权命令状态 enable

退出特权命令状态 disable

进入设置对话状态 setup

进入全局设置状态 config terminal

退出全局设置状态 end

进入端口设置状态 interface type slot/number

进入子端口设置状态 interface type number.subinterface [point-to-point | multipoint]

进入线路设置状态 line type slot/number

进入路由设置状态 router protocol

退出局部设置状态 exit

3. 显示命令

任务 命令

查看版本及引导信息 show version

查看运行设置 show running-config

查看开机设置 show startup-config

显示端口信息 show interface type slot/number

显示路由信息 show ip router

4. 拷贝命令

用于IOS及CONFIG的备份和升级

5. 网络命令

任务 命令

登录远程主机 telnet hostname|IP address

网络侦测 ping hostname|IP address

路由跟踪 trace hostname|IP address

6. 基本设置命令

任务 命令

全局设置 config terminal

设置访问用户及密码 username username password password

设置特权密码 enable secret password

设置路由器名 hostname name

设置静态路由 ip route destination subnet-mask next-hop

启动IP路由 ip routing

启动IPX路由 ipx routing

端口设置 interface type slot/number

设置IP地址 ip address address subnet-mask

设置IPX网络 ipx network network

激活端口 no shutdown

物理线路设置 line type number

启动登录进程 login [local|tacacs server]

设置登录密码 password password

五、配置IP寻址

1. IP地址分类

IP地址分为网络地址和主机地址二个部分,A类地址前8位为网络地址,后24位为主机地址,B类地址16位为网络地址,后16位为主机地址,C类地址前24位为网络地址,后8位为主机地址,网络地址范围如下表所示:

种类 网络地址范围

A 1.0.0.0 到126.0.0.0有效 0.0.0.0 和127.0.0.0保留

B 128.1.0.0到191.254.0.0有效 128.0.0.0和191.255.0.0保留

C 192.0.1.0 到223.255.254.0有效 192.0.0.0和223.255.255.0保留

D 224.0.0.0到239.255.255.255用于多点广播

E 240.0.0.0到255.255.255.254保留 255.255.255.255用于广播

2. 分配接口IP地址

任务 命令

接口设置 interface type slot/number

为接口设置IP地址 ip address ip-address mask

掩玛(mask)用于识别IP地址中的网络地址位数,IP地址(ip-address)和掩码(mask)相与即得到网络地址。

3. 使用可变长的子网掩码

通过使用可变长的子网掩码可以让位于不同接口的同一网络编号的网络使用不同的掩码,这样可以节省IP地址,充分利用有效的IP地址空间。

如下图所示:

Router1和Router2的E0端口均使用了C类地址192.1.0.0作为网络地址,Router1的E0的网络地址为192.1.0.128, 掩码为255.255.255.192, Router2的E0的网络地址为192.1.0.64,掩码为255.255.255.192,这样就将一个C类网络地址分配给了二个网,既划分了二个子网,起到了节约地址的作用。

4. 使用网络地址翻译(NAT)

NAT(Network Address Translation)起到将内部私有地址翻译成外部合法的全局地址的功能,它使得不具有合法IP地址的用户可以通过NAT访问到外部Internet.

当建立内部网的时候,建议使用以下地址组用于主机,这些地址是由Network Working Group(RFC 1918)保留用于私有网络地址分配的`.

?; Class A:10.1.1.1 to 10.254.254.254

?; Class B:172.16.1.1 to 172.31.254.254

?; Class C:192.168.1.1 to 192.168.254.254

命令描述如下:

任务 命令

定义一个标准访问列表 access-list access-list-number permit source [source-wildcard]

定义一个全局地址池 ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length} [type rotary]

建立动态地址翻译 ip nat inside source {list {access-list-number | name} pool name [overload] | static local-ip global-ip}

指定内部和外部端口 ip nat {inside | outside}

如下图所示,

路由器的Ethernet 0端口为inside端口,即此端口连接内部网络,并且此端口所连接的网络应该被翻译,Serial 0端口为outside端口,其拥有合法IP地址(由NIC或服务提供商所分配的合法的IP地址),来自网络10.1.1.0/24的主机将从IP地址池 c2501中选择一个地址作为自己的合法地址,经由Serial 0口访问Internet。命令ip nat inside source list 2 pool c2501 overload中的参数overload,将允许多个内部地址使用相同的全局地址(一个合法IP地址,它是由NIC或服务提供商所分配的地址)。命令 ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192定义了全局地址的范围。

设置如下:

ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192

interface Ethernet 0

ip address 10.1.1.1 255.255.255.0

ip nat inside

!

interface Serial 0

ip address 202.200.10.5 255.255.255.252

ip nat outside

!

ip route 0.0.0.0 0.0.0.0 Serial 0

access-list 2 permit 10.0.0.0 0.0.0.255

! Dynamic NAT

!

ip nat inside source list 2 pool c2501 overload

line console 0

exec-timeout 0 0

!

line vty 0 4

end

六、配置静态路由

通过配置静态路由,用户可以人为地指定对某一网络访问时所要经过的路径,在网络结构比较简单,且一般到达某一网络所经过的路径唯一的情况下采用静态路由。

任务 命令

建立静态路由 ip route prefix mask {address | interface} [distance] [tag tag] [permanent]

Prefix :所要到达的目的网络

mask :子网掩码

address :下一个跳的IP地址,即相邻路由器的端口地址。

interface :本地网络接口

distance :管理距离(可选)

tag tag :tag值(可选)

permanent :指定此路由即使该端口关掉也不被移掉。

以下在Router1上设置了访问192.1.0.64/26这个网下一跳地址为192.200.10.6,即当有目的地址属于 192.1.0.64/26的网络范围的数据报,应将其路由到地址为192.200.10.6的相邻路由器。在Router3上设置了访问 192.1.0.128/26及192.200.10.4/30这二个网下一跳地址为192.1.0.65。由于在Router1上端口Serial 0地址为192.200.10.5,192.200.10.4/30这个网属于直连的网,已经存在访问192.200.10.4/30的路径,所以不需要在Router1上添加静态路由。

Router1:

ip route 192.1.0.64 255.255.255.192 192.200.10.6

Router3:

ip route 192.1.0.128 255.255.255.192 192.1.0.65

ip route 192.200.10.4 255.255.255.252 192.1.0.65

同时由于路由器Router3除了与路由器Router2相连外,不再与其他路由器相连,所以也可以为它赋予一条默认路由以代替以上的二条静态路由,

ip route 0.0.0.0 0.0.0.0 192.1.0.65

即只要没有在路由表里找到去特定目的地址的路径,则数据均被路由到地址为192.1.0.65的相邻路由器。

;

❼ cisco交换机安全配置设定命令

cisco交换机安全配置设定命令大全

思科交换机的安全怎么设置,下面为大家分交换机安全设置的配置命令,希望对同学们学习思科交换机有所帮助!

一、交换机访问控制安全配置

1、对交换机特权模式设置密码尽量采用加密和md5 hash方式

switch(config)#enable secret 5 pass_string

其中 0 Specifies an UNENCRYPTED password will follow

5 Specifies an ENCRYPTED secret will follow

建议不要采用enable password pass_sting密码,破解及其容易!

2、设置对交换机明文密码自动进行加密隐藏

switch(config)#service password-encryption

3、为提高交换机管理的灵活性,建议权限分级管理并建立多用户

switch(config)#enable secret level 7 5 pass_string7 /7级用户进入特权模式的密码

switch(config)#enable secret 5 pass_string15 /15级用户进入特权模式的密码

switch(config)#username userA privilege 7 secret 5 pass_userA

switch(config)#username userB privilege 15 secret 5 pass_userB

/为7级,15级用户设置用户名和密码,Cisco privilege level分为0-15级,级别越高权限越大

switch(config)#privilege exec level 7 commands

/为7级用户设置可执行的命令,其中commands可以根据分配给用户的权限自行定义

4、本地console口访问安全配置

switch(config)#line console 0

switch(config-line)#exec-timeout 5 0 /设置不执行命令操作的超时时间,单位为分钟和秒

switch(config-line)#logging synchronous

/强制对弹出的干扰日志信息进行回车换行,使用户输入的命令连续可见

设置登录console口进行密码验证

方式(1):本地认证

switch(config-line)#password 7 pass_sting /设置加密密码

switch(config-line)#login /启用登录验证

方式(2):本地AAA认证

switch(config)#aaa new-model /启用AAA认证

switch(config)#aaa authentication login console-in group acsserver local

enable

/设置认证列表console-in优先依次为ACS Server,local用户名和密码,enable特权密码

switch(config)#line console 0

switch(config-line)# login authentication console-in

/调用authentication设置的console-in列表

5、远程vty访问控制安全配置

switch(config)#access-list 18 permit host x.x.x.x

/设置标准访问控制列表定义可远程访问的PC主机

switch(config)#aaa authentication login vty-in group acsserver local

enable

/设置认证列表vty-in, 优先依次为ACS Server,local用户名和密码,enable特权密码

switch(config)#aaa authorization commands 7 vty-in group acsserver local

if-authenticated

/为7级用户定义vty-in授权列表,优先依次为ACS Server,local授权

switch(config)#aaa authorization commands 15 vty-in group acsserver local

if-authenticated

/为15级用户定义vty-in授权列表,优先依次为ACS Server,local授权

switch(config)#line vty 0 15

switch(config-line)#access-class 18 in /在线路模式下调用前面定义的标准ACL 18

switch(config-line)#exec-timeout 5 0 /设置不执行命令操作的超时时间,单位为分钟和秒

switch(config-line)#authorization commands 7 vty-in /调用设置的授权列表vty-in

switch(config-line)#authorization commands 15 vty-in

switch(config-line)#logging synchronous

/强制对弹出的干扰日志信息进行回车换行,使用户输入的命令连续可见

switch(config-line)#login authentication vty-in

/调用authentication设置的vty-in列表

switch(config-line)#transport input ssh

/有Telnet协议不安全,仅允许通过ssh协议进行远程登录管理

6、AAA安全配置

switch(config)#aaa group server tacacs+ acsserver /设置AAA服务器组名

switch(config-sg-tacacs+)#server x.x.x.x /设置AAA服务器组成员服务器ip

switch(config-sg-tacacs+)#server x.x.x.x

switch(config-sg-tacacs+)#exit

switch(config)# tacacs-server key paa_string /设置同tacacs-server服务器通信的密钥

二、交换机网络服务安全配置

禁用不需要的各种服务协议

switch(config)#no service pad

switch(config)#no service finger

switch(config)#no service tcp-small-servers

switch(config)#no service udp-small-servers

switch(config)#no service config

switch(config)#no service ftp

switch(config)#no ip http server

switch(config)#no ip http secure-server

/关闭http,https远程web管理服务,默认cisco交换机是启用的

三、交换机防攻击安全加固配置

MAC Flooding(泛洪)和Spoofing(欺骗)攻击

预防方法:有效配置交换机port-security

STP攻击

预防方法:有效配置root guard,bpguard,bpfilter

VLAN,DTP攻击

预防方法:设置专用的native vlan;不要的接口shut或将端口模式改为access

DHCP攻击

预防方法:设置dhcp snooping

ARP攻击

预防方法:在启用dhcp snooping功能下配置DAI和port-security在级联上层交换机的trunk下

switch(config)#int gi x/x/x

switch(config-if)#sw mode trunk

switch(config-if)#sw trunk encaps dot1q

switch(config-if)#sw trunk allowed vlan x-x

switch(config-if)#spanning-tree guard loop

/启用环路保护功能,启用loop guard时自动关闭root guard

接终端用户的端口上设定

switch(config)#int gi x/x/x

switch(config-if)#spanning-tree portfast

/在STP中交换机端口有5个状态:disable、blocking、listening、learning、forwarding,只有处于forwarding状态的端口才可以发送数据。但需经过从blocking-->listening

15s,listening-->learning 15s,learning-->forwarding 20s

共计50s的时间,启用portfast后将直接从blocking-->forwarding状态,这样大大缩短了等待的时间。

说明:portfast仅适用于连接终端或服务器的交换机端口,不能在连接交换机的端口上使用!

switch(config-if)#spanning-tree guard root

/当一端口启用了root

guard功能后,当它收到了一个比根网桥优先值更优的.BPDU包,则它会立即阻塞该端口,使之不能形成环路等情况。这个端口特性是动态的,当没有收到更优的包时,则此端口又会自己变成转发状态了。

switch(config-if)#spanning-tree bpfilter enable

/当启用bpfilter功能时,该端口将丢弃所有的bp包,可能影响网络拓扑的稳定性并造成网络环路

switch(config-if)#spanning-tree bpguard enable

/当启用bpguard功能的交换机端口接收到bp时,会立即将该端口置为error-disabled状态而无法转发数据,进而避免了网络环路!

注意:同时启用bpguard与bpfilter时,bpfilter优先级较高,bpguard将失效!

广播、组播风暴控制设定

switch(config-if)#storm-control broadcast level 10 /设定广播的阀值为10%

switch(config-if)#storm-control multicast level 10 /设定组播的阀值为10%

switch(config-if)#storm-control action shutdown / Shutdown this interface

if a storm occurs

or switch(config-if)#storm-control action trap / Send SNMP trap if a storm

❽ 思科IPSec基本命令

思科IPSec基本命令汇总

“Internet 协议安全性 (IPSec)”是一种开放标准的框架结构,通过使用加密的安全服务以确保在 Internet 协议 (IP) 网络上进行保密而安全的通讯。那么思科怎么配置IPSec呢?配置命令如何?下面跟我一起来看看吧!

一、IPSec一些基本命令。

R1(config)#crypto ?

dynamic-map Specify a dynamic crypto map template

//创建或修改一个动态加密映射表

ipsec Configure IPSEC policy

//创建IPSec安全策略

isakmp Configure ISAKMP policy

//创建IKE策略

key Long term key operations

//为路由器的SSH加密会话产生加密密钥。后面接数值,是key molus size,单位为bit

map Enter a crypto map

//创建或修改一个普通加密映射表

Router(config)#crypto dynamic-map ?

WORD Dynamic crypto map template tag

//WORD为动态加密映射表名

Router(config)#crypto ipsec ?

security-association Security association parameters

// ipsec安全关联存活期,也可不配置,在map里指定即可

transform-set Define transform and settings

//定义一个ipsec变换集合(安全协议和算法的一个可行组合)

Router(config)#crypto isakmp ?

client Set client configuration policy

//建立地址池

enable Enable ISAKMP

//启动IKE策略,默认是启动的

key Set pre-shared key for remote peer

//设置密钥

policy Set policy for an ISAKMP protection suite

//设置IKE策略的优先级

Router(config)#crypto key ?

generate Generate new keys

//生成新的密钥

zeroize Remove keys

//移除密钥

Router(config)#crypto map ?

WORD Crypto map tag

//WORD为map表名

二、一些重要命令。

Router(config)#crypto isakmp policy ?

<1-10000> Priority of protection suite

//设置IKE策略,policy后面跟1-10000的数字,这些数字代表策略的优先级。

Router(config)#crypto isakmp policy 100//进入IKE策略配置模式,以便做下面的配置

Router(config-isakmp)#encryption ?//设置采用的加密方式,有以下三种

3des Three key triple DES

aes AES - Advanced Encryption Standard

des DES - Data Encryption Standard (56 bit keys).

Router(config-isakmp)#hash ? //采用的散列算法,MD5为160位,sha为128位。

md5 Message Digest 5

sha Secure Hash Standard

Router(config-isakmp)#authentication pre-share//采用预共享密钥的认证方式

Router(config-isakmp)#group ?//指定密钥的位数,越往下安全性越高,但加密速度越慢

1 Diffie-Hellman group 1

2 Diffie-Hellman group 2

5 Diffie-Hellman group 5

Router(config-isakmp)#lifetime ? //指定安全关联生存期,为60-86400秒

<60-86400> lifetime in seconds

Router(config)#crypto isakmp key *** address XXX.XXX.XXX.XXX

//设置IKE交换的密钥,***表示密钥组成,XXX.XXX.XXX.XXX表示对方的IP地址

Router(config)#crypto ipsec transform-set zx ?

//设置IPsec交换集,设置加密方式和认证方式,zx是交换集名称,可以自己设置,两端的名字也可不一样,但其他参数要一致。

ah-md5-hmac AH-HMAC-MD5 transform

ah-sha-hmac AH-HMAC-SHA transform

esp-3des ESP transform using 3DES(EDE) cipher (168 bits)

esp-aes ESP transform using AES cipher

esp-des ESP transform using DES cipher (56 bits)

esp-md5-hmac ESP transform using HMAC-MD5 auth

esp-sha-hmac ESP transform using HMAC-SHA auth

例:Router(config)#crypto ipsec transform-set zx esp-des esp-md5-hmac

Router(config)#crypto map map_zx 100 ipsec-isakmp

//建立加密映射表,zx为表名,可以自己定义,100为优先级(可选范围1-65535),如果有多个表,数字越小的越优先工作。

Router(config-crypto-map)#match address ?//用ACL来定义加密的通信

<100-199> IP access-list number

WORD Access-list name

Router(config-crypto-map)#set ?

peer Allowed Encryption/Decryption peer.//标识对方路由器IP地址

pfs Specify pfs settings//指定上面定义的密钥长度,即group

security-association Security association parameters//指定安全关联的生存期

transform-set Specify list of transform sets in priority order

//指定加密图使用的IPSEC交换集

router(config-if)# crypto map zx

//进入路由器的指定接口,应用加密图到接口,zx为加密图名。

三、一个配置实验。

实验拓扑图:

1.R1上的配置。

Router>enable

Router#config terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1

//配置IKE策略

R1(config)#crypto isakmp enable

R1(config)#crypto isakmp policy 100

R1(config-isakmp)#encryption des

R1(config-isakmp)#hash md5

R1(config-isakmp)#authentication pre-share

R1(config-isakmp)#group 1

R1(config-isakmp)#lifetime 86400

R1(config-isakmp)#exit

//配置IKE密钥

R1(config)#crypto isakmp key 123456 address 10.1.1.2

//创建IPSec交换集

R1(config)#crypto ipsec transform-set zx esp-des esp-md5-hmac

//创建映射加密图

R1(config)#crypto map zx_map 100 ipsec-isakmp

R1(config-crypto-map)#match address 111

R1(config-crypto-map)#set peer 10.1.1.2

R1(config-crypto-map)#set transform-set zx

R1(config-crypto-map)#set security-association lifetime seconds 86400

R1(config-crypto-map)#set pfs group1

R1(config-crypto-map)#exit

//配置ACL

R1(config)#access-list 111 permit ip 192.168.1.10 0.0.0.255 192.168.2.10 0.0.0.255

//应用加密图到接口

R1(config)#interface s1/0

R1(config-if)#crypto map zx_map

2.R2上的`配置。

与R1的配置基本相同,只需要更改下面几条命令:

R1(config)#crypto isakmp key 123456 address 10.1.1.1

R1(config-crypto-map)#set peer 10.1.1.1

R1(config)#access-list 111 permit ip 192.168.2.10 0.0.0.255 192.168.1.10 0.0.0.255

3.实验调试。

在R1和R2上分别使用下面的命令,查看配置信息。

R1#show crypto ipsec ?

sa IPSEC SA table

transform-set Crypto transform sets

R1#show crypto isakmp ?

policy Show ISAKMP protection suite policy

sa Show ISAKMP Security Associations

四、相关知识点。

对称加密或私有密钥加密:加密解密使用相同的私钥

DES--数据加密标准 data encryption standard

3DES--3倍数据加密标准 triple data encryption standard

AES--高级加密标准 advanced encryption standard

一些技术提供验证:

MAC--消息验证码 message authentication code

HMAC--散列消息验证码 hash-based message authentication code

MD5和SHA是提供验证的散列函数

对称加密被用于大容量数据,因为非对称加密站用大量cpu资源

非对称或公共密钥加密:

RSA rivest-shamir-adelman

用公钥加密,私钥解密。公钥是公开的,但只有私钥的拥有者才能解密

两个散列常用算法:

HMAC-MD5 使用128位的共享私有密钥

HMAC-SHA-I 使用160位的私有密钥

ESP协议:用来提供机密性,数据源验证,无连接完整性和反重放服务,并且通过防止流量分析来限制流量的机密性,这些服务以来于SA建立和实现时的选择。

加密是有DES或3DES算法完成。可选的验证和数据完整性由HMAC,keyed SHA-I或MD5提供

IKE--internet密钥交换:他提供IPSEC对等体验证,协商IPSEC密钥和协商IPSEC安全关联

实现IKE的组件

1:des,3des 用来加密的方式

2:Diffie-Hellman 基于公共密钥的加密协议允许对方在不安全的信道上建立公共密钥,在IKE中被用来建立会话密钥。group 1表示768位,group 2表示1024位

3:MD5,SHA--验证数据包的散列算法。RAS签名--基于公钥加密系统

;

❾ 思科交换机常用的100个命令

思科交换机常用的100个命令

在思科交换机上的命令有哪些?哪些命令最实用,你知道吗?下面我为大家分享最常用的思科交换机基本命令,希望能帮助到大家!

1:进入特权模式enable

switch> enable

switch#

2:进入全局配置模式configure terminal

switch> enable

switch#c onfigure terminal

switch(conf)#

3:交换机命名hostname aptech2950 以aptech2950 为例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch-2950

aptech2950(conf)#

4:配置使能口令enable password cisco 以cisco 为例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch2950

aptech2950(conf)# enable password cisco

5:配置使能密码enable secret ciscolab 以cicsolab 为例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch2950

aptech2950(conf)# enable secret ciscolab

6:设置虚拟局域网vlan 1 interface vlan 1

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch2950

aptech2950(conf)# interface vlan 1

aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩



aptech2950(conf-if)#no shut 是配置处于运行中

aptech2950(conf-if)#exit

aptech2950(conf)#ip default-gateway 192.168.254 设置网关地址

7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch2950

aptech2950(conf)# interface fastehernet 0/17

aptech2950(conf-if)#

8:查看命令show

switch> enable

switch# show version 察看系统中的所有版本信息

show interface vlan 1 查看交换机有关ip 协议的配置信息

show running-configure 查看交换机当前起作用的配置信息

show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息

show mac-address-table 查看mac 地址表

show mac-address-table aging-time 查看mac 地址表自动老化时间

9:交换机恢复出厂默认恢复命令

switch> enable

switch# erase startup-configure

switch# reload

10:双工模式设置

switch> enable

switch#c onfigure terminal

switch2950(conf)#hostname aptch-2950

aptech2950(conf)# interface fastehernet 0/17 以17 端口为例

aptech2950(conf-if)#plex full/half/auto 有full , half, auto 三个可选



11:cdp 相关命令

switch> enable

switch# show cdp 查看设备的cdp 全局配置信息

show cdp interface fastethernet 0/17 查看17 端口的cdp 配置信息

show cdp traffic 查看有关cdp 包的统计信息

show cdp nerghbors 列出与设备相连的cisco 设备

12:csico2950 的密码恢复

拔下交换机电源线。

用手按着交换机的MODE 键,插上电源线

在switch:后执行flash_ini 命令:switch: flash_ini

查看flash 中的文件: switch: dir flash:

把“config.text”文件改名为“config.old”: switch: rename flash: config.text flash: config.old

执行boot: switch: boot

交换机进入是否进入配置的对话,执行no :

进入特权模式察看flash 里的文件: show flash :

把“config.old”文件改名为“config.text”: switch: rename flash: config.old flash: config.text

把“ config.text ” 拷入系统的“ running-configure ”: flash: config.text system :

running-configure

把配置模式重新设置密码存盘,密码恢复成功。

13:交换机telnet 远程登录设置:

switch>en

switch#c onfigure terminal

switch(conf)#hostname aptech-2950

aptech2950(conf)#enable password cisco 以cisco 为特权模式密码

aptech2950(conf)#interface fastethernet 0/1 以17 端口为telnet 远程登录端口

aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0

aptech2950(conf-if)#no shut

aptech2950(conf-if)#exit

aptech2950(conf)line vty 0 4 设置0-4 个用户可以telnet 远程登陆

aptech2950(conf-line)#login

aptech2950(conf-line)#password edge 以edge 为远程登录的用户密码

主机设置:

ip 192.168.1.2 主机的ip 必须和交换机端口的地址在同一网络



netmask 255.255.255.0

gate-way 192.168.1.1 网关地址是交换机端口地址

运行:

telnet 192.168.1.1

进入telnet 远程登录界面

password : edge

aptech2950>en

password: cisco

aptech#

14:交换机配置的重新载入和保存

设置完成交换机的配置后:

aptech2950(conf)#reload

是否保存(y/n) y: 保存设置信息n:不保存设置信息

1.在基于IOS 的.交换机上设置主机名/系统名:

switch(config)# hostname hostname

在基于CLI 的交换机上设置主机名/系统名:

switch(enable) set system name name-string

2.在基于IOS 的交换机上设置登录口令:

switch(config)# enable password level 1 password

在基于CLI 的交换机上设置登录口令:

switch(enable) set password

switch(enable) set enalbepass

3.在基于IOS 的交换机上设置远程访问:

switch(config)# interface vlan 1

switch(config-if)# ip address ip-address netmask

switch(config-if)# ip default-gateway ip-address

在基于CLI 的交换机上设置远程访问:

switch(enable) set interface sc0 ip-address netmask broadcast-address

switch(enable) set interface sc0 vlan

switch(enable) set ip route default gateway

4.在基于IOS 的交换机上启用和浏览CDP 信息:

switch(config-if)# cdp enable

switch(config-if)# no cdp enable

为了查看Cisco 邻接设备的CDP 通告信息:

switch# show cdp interface [type modle/port]

switch# show cdp neighbors [type mole/port] [detail]

在基于CLI 的交换机上启用和浏览CDP 信息:

switch(enable) set cdp {enable|disable} mole/port

为了查看Cisco 邻接设备的CDP 通告信息:

switch(enable) show cdp neighbors[mole/port] [vlan|plex|capabilities|detail]

5.基于IOS 的交换机的端口描述:

switch(config-if)# description description-string

基于CLI 的交换机的端口描述:

switch(enable)set port name mole/number description-string

6.在基于IOS 的交换机上设置端口速度:

阅读全文

与cisco基本命令相关的资料

热点内容
dvd光盘存储汉子算法 浏览:757
苹果邮件无法连接服务器地址 浏览:963
phpffmpeg转码 浏览:671
长沙好玩的解压项目 浏览:145
专属学情分析报告是什么app 浏览:564
php工程部署 浏览:833
android全屏透明 浏览:737
阿里云服务器已开通怎么办 浏览:803
光遇为什么登录时服务器已满 浏览:302
PDF分析 浏览:485
h3c光纤全工半全工设置命令 浏览:143
公司法pdf下载 浏览:382
linuxmarkdown 浏览:350
华为手机怎么多选文件夹 浏览:683
如何取消命令方块指令 浏览:350
风翼app为什么进不去了 浏览:778
im4java压缩图片 浏览:362
数据查询网站源码 浏览:150
伊克塞尔文档怎么进行加密 浏览:892
app转账是什么 浏览:163