思科交换机路由命令
如果您是路由器设置和使用的新手,本文思科交换机路由命令将为您提供详细的设置方法和使用技巧,让您快速上手。
本文内容目录一览:
- 1、Cisco路由器配置命令
- 2、Cisco常用的路由器交换机配置命令
- 3、思科路由器查看路由表命令
- 4、思科交换机路由器命令
- 5、cisco 三层交换机开启路由功能的命令是什么?
- 6、思科交换机怎么配置默认路由
Cisco路由器配置命令
Cisco路由器配置命令大全
为方便考生复习思科路由器的配置,以下是我为大家整理的Cisco路由器配置命令,欢迎阅读与收藏。
1. switch配置命令
(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 设置控制台会话超时为0
service 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 保存信息到NVRAM
erase startup-config 清除NVRAM中的配置信息
show ip interface brief 查看接口的谪要信息
banner motd # +信息 + # 配置路由器或交换机的描素信息
description+信息 配置接口听描素信息
vlan database 进入VLAN数据库模式
vlan +vlan号+ 名称 创建VLAN
switchport 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号 删除VLAN
show spamming-tree vlan +vlan号 查看VLA怕生成树议
2. 路由器配置命令
ip route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由
show ip route 查看路由表
show protocols 显示出所有的被动路由协议和接口上哪些协议被设置
show ip protocols 显示了被配置在路由器上的路由选择协议, 同时给出了在路由选择协议中使用的定时器等信息
router rip 激活RIP协议
路由器的几个基本命令:
Routerenable 进入特权模式
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
------------------
r11show 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 size0-256设置命令缓冲区大小,0 : 代表不缓存
r11#copy 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密码
Cisco常用的路由器交换机配置命令
cisco制造的路由器设备、交换机和其他设备承载了全世界80%的互联网通信,成为硅谷中新经济的传奇,那么你了解Cisco常用的路由器交换机配置命令吗?下面是我整理的一些关于Cisco常用的路由器交换机配置命令的相关资料,供你参考。
Cisco常用的路由器支持的命令:
路由器显示命令:
router#show run ;显示配置信息
router#show interface ;显示接口信息
router#show ip route ;显示路由信息
router#show cdp nei ;显示邻居信息
router#reload ;重新起动
路由器口令设置:
routerenable ;进入特权模式
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#copy running-config startup-config ;保存配置
router#copy running-config tftp ;保存配置到tftp
router#copy startup-config tftp ;开机配置存到tftp
router#copy tftp flash: ;下传文件到flash
router#copy tftp startup-config ;下载配置文件
ROM状态:
Ctrl+Break ;进入ROM监控状态
rommonconfreg 0x2142 ;跳过配置文件
rommonconfreg 0x2102 ;恢复配置文件
rommonreset ;重新引导
rommoncopy xmodem: flash: ;从console传输文件
rommonIP_ADDRESS=10.65.1.2 ;设置路由器IP
rommonIP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码
rommonTFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP
rommonTFTP_FILE=c2600.bin ;指定下载的文件
rommontftpdnld ;从tftp下载
rommondir flash: ;查看闪存内容
rommonboot ;引导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)# ;接口状态
交换机口令设置:
switchenable ;进入特权模式
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 ;查看指定端口信息
思科路由器查看路由表命令
思科路由器查看路由表的命令为Router #show ip route。
在路由器全局配置模式下,输入show ip route命令,这时屏幕会出现许多的路由表的详细信息,例如目的地址、子网掩码 、网关、明文显示的密码、PC端口的一些详细信息等。
思科(Cisco)路由器是一个集成多业务路由器,福利综合服务网络路由器,以及获得回报的网络路由器。思科公司是全球领先的网络解决方案供应商,依靠自身的技术和对网络经济模式的深刻理解,思科成为了网络应用的成功实践者之一。
扩展资料:
思科路由器优势:
系统方法开始于单一永续平台,如思科(Cisco)集成多业务路由器。系统方法相结合的内部及其相互之间的智能服务,包装,编织语音,安全,路由和应用服务结合起来,使程序更加自动化和智能化。
结果普遍安全的网络和应用,对数据,语音更高的服务质量和视频流量,提高时间效率,更好地利用网络资源。
随着集成多业务路由器,思科(Cisco)提供了一个全面的,未来需求的解决方案,最大限度地减少网络中断,并确保进入最关键业务应用。思科(Cisco)对性能结合新的基础设施服务的重点是使公司创造网络更聪明,更有弹性,可靠。
参考资料来源:百度百科-思科(Cisco)路由器
思科交换机路由器命令
no ip domain lookup #打下不存在的指令,不用等待查找直接错误返回。
username cisco password cisco #设置用户名和密码
enable secret cisco #设置enable密码
line console 0 #console口
logging syn #输出同步
exec-time 0 0 #空闲超时配置
end
line vty 0 4 #telnet 线程 0-4
login local
exec-time 30 #空闲超时配置
end
alias exec a show ip route #模式下 敲 a 回车后 效果等价于show ip route
alias exec b show ip inter brief #模式下 敲 a 回车后 效果等价于show ip inter brief
alias exec c show running-config
alias exec d show vlan bri
alias exec e show cdp neibor
cisco 三层交换机开启路由功能的命令是什么?
三层交换机开启路由功能的命令是:
Switchen
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#no ip domain-loo
Switch(config)#ip routing
Switch(config)#int vlan
Switch(config)#int vlan 10(这个是你的第一个VLAN)
Switch(config-if)#ip add A.B.C.D(这里要写成网关地址)
Switch(config-if)#int vlan 20(这里是你的第二个VLAN)
Switch(config-if)#ip add A.B.C.D(这里要写成网关地址)
如果不写这些,你的接口都是access接口,没有ip地址,开了也没有用,因为找不到网关,整个3层交换上也没有个ip,所以不可能会出现路由。
思科交换机怎么配置默认路由
1、首先,打开思科模拟器软件,连接三台交换机的连接线,将所有交换机互相连接起来,一台当服务器,一台当客户机,另外一台当透明模式。
2、把三台交换机的配置清除干净,重启交换机。
3、配置S3 为VTP transparent,配置命令是:S3#vlan database。
4、配置S2 为VTP client,配置命令是:S2(config)#vtp mode client,Setting device to VTP CLIENT mode.S2(config)#vtp domain VTP-TEST。
5、在S1 上创建VLAN,检查S2、S3 上的VLAN 信息。
6、查看VTP 信息,查看交换机的vtp详细信息和版本等信息。
路由器是家庭和办公室网络的核心,通过学习这些技巧和方法,您将能够轻松设置和管理您的网络。