1. 计算机命令:
PCA login: root ;使用root用户password: linux ;口令是linux
# shutdown -h now ;同init 0 关机
# logout
# login
# ifconfig ;显示IP地址
# ifconfig eth0
# ifconfig eht0
# route add 0.0.0.0 gw
# route del 0.0.0.0 gw
# route add default gw
# route del default gw
# route ;显示网关
# ping
# telnet
2. 交换机支持的命令:
交换机基本状态:
switch: ;交换机的ROM状态rommon> ;路由器的ROM状态
hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态
交换机口令设置:
switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname
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
交换机设置IP地址:
switch(config)#interface vlan 1 ;进入vlan 1
switch(config-if)#ip address
switch(config)#ip default-gateway
交换机显示命令:
switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息
switch#show int f0/0 ;查看指定端口信息3. 路由器支持的命令:
路由器显示命令:
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-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
router(config-if)#ip address
router(config-if)#int f0/0.1 ;进入子接口
router(config-subif.1)#ip address
router(config-subif.1)#encapsulation dot1q
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监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset ;重新引导rommon>copy xmodem:
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
router(config-if)#ip access-group
例1:
router(config)#access-list 1 deny host 10.65.1.1
router(config)#access-list 1 permit any
router(config)#int f0/0
router(config-if)#ip access-group 4 in
例2:
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/1
router(config-if)#ip access-group 4 in
扩展访问控制列表:
access-list
例1:
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
例2:
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] <私有IP><公网IP> [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
RouterA(config)#int s0
RouterA(config-if)#ppp authentication {chap|pap}
4.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全局地址。
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 startup 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协议
network +直连网段发布直连网段
interface lookback 0 激活逻辑接口
passive-interface +接口类型+接口号配置接口为被动模式
debug ip +协议动态查看路由更新信息
undebug all 关闭所有DEBUG信息
router eigrp +as号激活EIGRP路由协议
network +网段+子网掩码发布直连网段
show ip eigrp neighbors 查看邻居表
show ip eigrp topology 查看拓扑表
show ip eigrp traffic 查看发送包数量
router ospf +process-ID 激活OSPF协议
network+直连网段+area+区域号发布直连网段
show ip ospf 显示OSPF的进程号和ROUTER-ID
encapsulation+封装格式更改封装格式
no ip admain-lookup 关闭路由器的域名查找
ip routing 在三层交换机上启用路由功能
show user 查看SW的在线用户
clear line +线路号清除线路
3. 三层交换机配置命令
配置一组二层端口
configure terminal 进入配置状态
nterface range {port-range} 进入组配置状态
配置三层端口
configure terminal 进入配置状态
interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port- channel port-channel-number} 进入端口配置状态
no switchport 把物理端口变成三层口
ip address ip_address subnet_mask 配置IP地址和掩码
no shutdown 激活端口
例:
Switch(config)# interface gigabitethernet0/2
Switch(config-if)# no switchport
Switch(config-if)# ip address 192.20.135.21 255.255.255.0
Switch(config-if)# no shutdown
配置VLAN
configure terminal 进入配置状态
vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN 号或旧的来进行修改
。
name vlan-name 可选)输入一个VLAN名,如果没有配置VLAN名,缺省的名字是VLAN号前面用0填满
的4位数,如VLAN0004是VLAN4的缺省名字
mtu mtu-size (可选) 改变MTU大小
例
Switch# configure terminal
Switch(config)# vlan 20
Switch(config-vlan)# name test20
Switch(config-vlan)# end
或
Switch# vlan database
Switch(vlan)# vlan 20 name test20
Switch(vlan)# exit
将端口分配给一个VLAN
configure terminal 进入配置状态
interface interface-id 进入要分配的端口
switchport mode access 定义二层口
switchport access vlan vlan-id 把端口分配给某一VLAN
例
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fastethernet0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 2
Switch(config-if)# end
Switch#
配置VLAN trunk
configure terminal 进入配置状态
interface interface-Id 进入端口配置状态
switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封装ISL 或802.1Q 或
自动协商
switchport mode {dynamic {auto | desirable} | trunk} 配置二层trunk模式。dynamic auto—自动协商是否成为trunk
dynamic desirable—把端口设置为trunk如果对方端口是trunk, desirable, 配置Native VLAN
(802.1q)
或自动模式,trunk—设置端口为强制的trunk方式,而不理会对方端口是否为trunk
switchport access vlan vlan-id 可选) 指定一个缺省VLAN, 如果此端口不再是trunk
switchport trunk native vlan vlan-id 指定802.1Q native VLAN号
例:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fastethernet0/4
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# end
定义TRUNK允许的VLAN
configure terminal子进入配置状态
interface interface-id 进入端口配置
switchport mode trunk 配置二层口为trunk
switchport trunk allowed vlan {add | all | except | remove} vlan-list可选) 配置trunk 允
许的VLAN.使用add, all, except, remove关健字
no switchport trunk allowed vlan 允许所有VLAN通过
例
Switch(config)# interface fastethernet0/1
Switch(config-if)# switchport trunk allowed vlan remove 2
Switch(config-if)# end
配置Native VLAN(802.1q)
configure terminal 进入配置状态
interface interface-id 进入配置成802.1qtrunk的端口
switchport trunk native vlan vlan-Id 配置native VLAN号
no switchport trunk native vlan 端口配置命令回到缺省的状态
配置基于端口权值的负载均衡
configure terminal 进入Switch 1配置状态
vtp domain domain-name 配置VTP域
vtp mode server 将Switch 1配置成VTP server.
show vtp status 验证VTP的配置
show vlan 验证VLAN
configure terminal 进入配置状态
interface fastethernet 0/1 进入F0/1端口
switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封装
switchport mode trunk 配置成trunk
show interfaces fastethernet0/1 switchport 验证VLAN配置
按以上步骤对想要负载均衡的接口进行配置
在另一个交换机上进行此配置
show vlan 当trunk已经起来,在switch2上验证已经学到相的vlan配置configure terminal 在Switch 1上进入配置状态
interface fastethernet0/1 进入要配置的端口
spanning-tree vlan 8 port-priority 10 将端口权值10赋与VLAN 8.
spanning-tree vlan 9 port-priority 10 将端口权值10赋与VLAN 9.
spanning-tree vlan 10 port-priority 10 将端口权值10赋与VLAN 10.
interface fastethernet0/2 进入F0/2
spanning-tree vlan 3 port-priority 10 将端口权值10赋与VLAN 3.
spanning-tree vlan 4 port-priority 10 将端口权值10赋与VLAN 4
spanning-tree vlan 5 port-priority 10 将端口权值10赋与VLAN 5
spanning-tree vlan 6 port-priority 10 将端口权值10赋与VLAN 10
end 退出
show running-config 验证配置
copy running-config startup-config 保存配置
配置STP路径值的负载均衡
Trunk1走VLAN8-10,Trunk2走VLAN2-4
configure terminal 进入Switch 1配置状态
interface fastethernet 0/1 进入F0/1
switchport trunk encapsulation {isl | dot1q | negotiate}配置封装
switchport mode trunk 配置Trunk,缺省是ISL封装
exit 退回
在F0/2口上重复2-4步骤
exit 退回
show running-config 验证配置
show vlan验证switch1 已经学到Vlan
configure terminal 进入配置状态
interface fastethernet 0/1 进入F0/1
spanning-tree vlan 2 cost 30 设置Vlan2生成树路径值为30
spanning-tree vlan 3 cost 30 设置Vlan3生成树路径值为30
spanning-tree vlan 4 cost 30 设置Vlan4生成树路径值为30
end 退出
在switch1的F0/2上重复9-11步骤设置VLAN8,9,10生成树路径值为30 end 退出
show running-config 验证配置
copy running-config startup-config 保存配置
补充:CISCO命令集——路由选择协议及排障
*ip route命令
Router(config)# ip route <目录网络或子网号> [子网掩码] <下一路由器IP地址| 从本地出口
的地址> [管理距离0~255,默认为1]
(注:静态地址配置)
*ip default-network命令
Router(config)# ip default-network <目标网络号>
(注:配合路由协使用,用其中的一个动态路由号作默认路由配置) Router(config)# ip route 0.0.0.0 0.0.0.0 <下一路由器IP地址| 从本地出口的地址> (注:只有一个公网地址时,在出口路由器上的配置)
*内部路由选择协议
*使用router和network命令
Router(config)# router <路由协议rip | igrp | eigrp | ospf | is-is等> [自主系统号] Router(config-router)# network <直接相连的要用此路由协议的网络号>
Router(config-router)# network <直接相连的要用此路由协议的网络号> *路由信息协议RIP
Router(config)# router rip
Router(config-router)# network <直接相连的要用rip协议的有类别网络号> Router# show ip protocols
Router# show ip route
Router# debug ip rip
*内部网关路由协议IGRP
Router(config)# router igrp <自主系统号>
Router(config-router)# network <直接相连的要用igrp协议的有类别网络号> Router# show ip interface
Router# show ip protocols
Router# show ip route
Router# debug ip rip
*排除网络故障
排除网络故障的一个总体模型
Router# ping <有故障的主机| 有故障的IP地址>
Router# show ip route
Router# show interface <有故障的接口>
Router# show run
*IP的故故障排除
检查可用的路由
Router# show ip route <有故障的IP地址>
27.4.4 跟踪路由(Tracing the Route)
SUN-A> traceroute <有故障的主机| 有故障的IP地址>
C:\windows\> winipcfg
C:\windows\> ipconfig
C:\windows\> ipconfig / all
C:\windows\> tracert <有故障的主机| 有故障的IP地址>
使用扩展的ping来跟踪连接性
Router# ping
*其它可能的故障
一个地址解析(ARP)的故障
Router# show arp
Router# show interface <有故障的接口>
C:\windows\> arp -a
SUN-A> arp –a
验证终端系统的路由表
C:\windows\> netstat –rn
C:\windows\> route –f add 0.0.0.0 mask 0.0.0.0 <需要添加入的网关地址> C:\windows\> route [–f ] [[print | add | delete | change] [destination] [mask netmask] [gateway]]
C:\windows\> route add mask <网络掩码> <网关ip地址>
C:\windows\> route delete mask <网络掩码> <网关ip地址>
C:\windows\> nbtstat <相应的参数>
SUN-A> netstat -rn路由器
CISCO命令全集-思科命令汇总 视图模式介绍: 普通视图router> 特权视图router# /在普通模式下输入enable 全局视图router(config)# /在特权模式下输入config t 接口视图router(config-if)# /在全局模式下输入int 接口名称例如int s0或int e0 路由协议视图router(config-route)# /在全局模式下输入router 动态路由协议名称 1、基本配置: router>enable /进入特权模式 router#conf t /进入全局配置模式 router(config)# hostname xxx /设置设备名称就好像给我们的计算机起个名字 router(config)#enable password /设置特权口令 router(config)#no ip domain lookup /不允许路由器缺省使用DNS解析命令 router(config)# Service password-encrypt /对所有在路由器上输入的口令进行暗文加密 router(config)#line vty 0 4 /进入设置telnet服务模式 router(config-line)#password xxx /设置telnet的密码 router(config-line)#login /使能可以登陆 router(config)#line con 0 /进入控制口的服务模式 router(config-line)#password xxx /要设置console的密码 router(config-line)#login /使能可以登陆 2、接口配置: router(config)#int s0 /进入接口配置模式serial 0 端口配置(如果是模块化的路由器前面加上槽位编号,例如serial0/0 代表这个路由器的0槽位上的第一个接口) router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码
第一篇、熟悉界面 一、设备的选择与连接 在界面的左下角一块区域,这里有许多种类的硬件设备,从左至右,从上到下依次为路由器、交换机、集线器、无线设备、设备之间的连线(Connections)、终端设备、仿真广域网、Custom Made Devices(自定义设备)下面着重讲一下“Connections”,用鼠标点一下它之后,在右边你会看到各种类型的线,依次为Automatically Choose Connection Type(自动选线,万能的,一般不建议使用,除非你真的不知道设备之间该用什么线)、控制线、直通线、交叉线、光纤、电话线、同轴电缆、DCE、DTE。其中DCE和DTE是用于路由器之间的连线,实际当中,你需要把DCE和一台路由器相连,DTE和另一台设备相连。而在这里,你只需选一根就是了,若你选了DCE这一根线,则和这根线先连的路由器为DCE,配置该路由器时需配置时钟哦。交叉线只在路由器和电脑直接相连,或交换机和交换机之间相连时才会用到。 注释:那么Custom Made Devices设备是做什么的呢?通过实验发现当我们用鼠标单击不放开左键把位于第一行的第一个设备也就是Router中的任意一个拖到工作区,然后再拖一个然后我们尝试用串行线Serial DTE连接两个路由器时发现,他们之间是不会正常连接的,原因是这两个设备初始化对然虽然都是模块化的,但是没有添加,比如多个串口等等。那么,这个Custom Made Devices设备就比较好了,他会自动添加一些“必须设备的”,在实验环境下每次选择设备就不用手动添加所需设备了,使用起来很方便,除非你想添加“用户自定义设备”里没有的设备再添加也不迟。 当你需要用哪个设备的时候,先用鼠标单击一下它,然后在中央的工作区域点一下就OK了,或者直接用鼠标摁住这个设备把它拖上去。连线你就选中一种线,然后就在要连接的线的设备上点一下,选接口,再点另一设备,选接口就OK了。注意,接口可不能乱选哦。连接好线后,你可以把鼠标指针移到该连线上,你就会线两端的接口类型和名称哦,配置的时候要用到它。 二、对设备进行编辑在右边有一个区域,如图1.2所示,从上到下依次为选定/取消、移动(总体移动,移动某一设备,直接拖动它就可以了)、Place Note(先选中)、删除、Inspect (选中后,在路由器、PC机上可看到各种表,如路由表等)、simple PPD、complex。
思科交换机常用命令大全 1.1 用户模式与特权模式 用户模式:可以使用一些基本的查询命令 特权模式:可以对交换机进行相关的配置 进入特权模式命令:Switch>enable 退出特权模式命令:Switch#exit 启用命令查询:? 时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求) 显示信息命令:Switch#show 可选参数 注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数 查看交换机配置: Switch#show running-config 保存交换机配置:Switch#copy running-config startup-config Switch#wr 查看端口信息:Switch#show interface 查看MAC地址表:Switch#show mac-address-table 查看交换机CPU的状态信息:Switch#show processes 1.2 全局配置模式 进入全局配置模式:Switch#configure terminal
主机名修改:Switch(config)#hostname 主机名(自选参数) 特权模式进入密码: Switch(config)#enable secret 密码(自选参数) 取消特权模式密码:Switch(config)#no enable secret 取消主机名设置: Switch(config)#no hostname 退出配置模式: Switch(config)#exit 需要特别注意的是在配置模式中无法使用show命令,如果要使用 的话show前必须加do和空格,例如:do show * 指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数(VLAN号)root primary 例如: Switch(config)#spanning-tree vlan 1 root primary 需要注意的是:设置根交换机是基于VLAN的 关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN 号) 例如: Switch(config)#no spanning-tree vlan 1 1.3 接口配置模式 进入接口配置模式:Switch(config)#interface 端口名称(可选参数) 启用端口:Switch(config-if)#no shutdown 停用端口:Switch(config-if)#shutdown 进入同种类型多端口配置:Switch(config)# interface range fastethernet 0/1-5 进入不同类型多端口配置:Switch(config)#interface range fastethernet 0/1-5,gigabitethernet 0/1-2
命令要在一行内打完,窗体可以自动拉大。Aux口这个版本暂不支持。 支持三级Switch网络,需要路由时支持两级Switch。 设置的主机名中不要含有空格。F2、F3键清屏(为了方便而加) Ctrl+P 历史命令,建议使用方向键。 Ctrl+z 回根, 建议使用end命令 Ctrl+Break 路由器进入ROM监控状态。交换机清除特权密码。 双击设备进入终端操作 单击设备的接口可以实现画线 单击画有线的接口可以删除连线 在指定的设备按下鼠标右键可以删除设备。 在指定的设备按下鼠标左键可以实现移动。 按Tab键,可以得到命令全称。 键入"?"可以得到当前状态下的命令帮助。 接收的作业名固定为当前目录下的sim.txt。 系统的配置文件是:sim.ini。 计算测验得分中,ping PCA->PCB;5 表示ping通得5分, SWAf6=2;5表示交换机SwitchA的f0/6在vlan 2时得5分。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PCA login: root ;使用root用户password: linux ;口令是linux # shutdown -h now ;同init 0 关机 # logout # login # ifconfig ;显示IP地址 # ifconfig eth0
Cisco的命令大全 序号/类别基于ios的交换机命令基于CLI的交换机命令 1.设置主机名/系统名 switch(config)# hostname "hostname" switch(enable) set sys tem name name-string 2.设置登录口令 switch(config)# enable password level 1 password switch(enable) set password switch(enable) set enalbepass 3.设置远程访问 switch(config)# inte***ce vlan 1 switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gateway ip-address switch(enable) set inte***ce s c0 ip-address netmask broadcast-address switch(enable) set inte***ce sc0 vlan switch(enable) set ip route default gateway 4.启用和浏览CDP信息 switch(config-if)# cdp enable switch(config-if)# no cdp enable switch(enable) set cdp {enable|disable} module /port 5.查看Cisco邻接设备的CDP通告 switch# show cdp inte***ce [type modle/port] switch# show cdp neighbors [type module/port] [detail] switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 6.端口描述 switch(config-if)#description escription-string switch(enable)set p ort name module/number description-string 7.设置端口速度 switch(config-if)# speed{10|100|auto} switch(enable) set port s peed moudle/number {10|100|auto} switch(enable) set port speed moudle/number {4|16|auto} 8.设置以太网的链路模式 switch(config-if)# duplex {auto|full|half} switch(enabl e) set port duplex module/number {full|half 9.配置静态VLAN switch# vlan database switch(vlan)# vlan vlan-num name vla switch(vlan)# exit switch# configure teriminal switch(config)#inte***ce inte***ce module/number switch(config-if)# switchport mode access switch(config-if)# switchport access vlan vlan-num switch(config-if)# end switch(enable) set vlan vlan-num [name name] switch(enable) set vlan vlan-num mod-num/port-list 10.配置VLAN中继线 switch(config)# inte***ce inte***ce mod/port
Cisco路由器配置 *注意事项: 1.需要将镜像文件放到Gns3安装文件同一目录下 2.注意路由器用户名后面的模式(Ra>、Ra#、Ra
二、在Cisco上配置SSH的相关命令和说明: Ra#config terminal Ra(config)#ip domain-name https://www.doczj.com/doc/ac10522718.html, <配置一个域名> Ra(config)#crypto key generate rsa general-keys modulus 1024<生成一个rsa算法的密钥,密钥为1024位> (提示:在Cisoc中rsa支持360-2048位,该算法的原理是:主机将自己的公用密钥分发给相关的客户机,客户机在访问主机时则使用该主机的公开密钥来加密数据,主机则使用自己的私有的密钥来解密数据,从而实现主机密钥认证,确定客户机的可靠身份。) Ra(config)#ip ssh time 120 <设置ssh时间为120秒> Ra(config)#ip ssh authentication 4<设置ssh认证重复次数为4,可以在0-5之间选择> Ra(config)#line vty 0 4 <进入vty模式> Ra(config-line)#transport input ssh telnet <设置vty的登录模式为ssh、telnet,默认情况下是all即允许所有登录> Ra(config-line)#login Ra(config-line)#exit Ra(config)#aaa new-model Ra(config)#aaa authentication login default local <启用aaa认证,设置在本地服务器上进行认证> Ra(config)#username cisco privilege 15 secret hkgt123 <创建一个用户cisco级别为15并设置其加密密码为hkgt123用于SSH客户端登录> 修改登陆超时限制时间和登陆重复次数可以不修改 如果要把超时限定改为180秒,则应该用:Ra(config)# ip ssh time-out 180 如果要把重试次数改成5次,则应该用:Ra(config)# ip ssh authentication-retries 5 这样SSH的CISCO设置就完成了。 登陆: Ra#ssh -l登陆ssh用户名 IP地址
思科交换机路由器命令 大全 YUKI was compiled on the morning of December 16, 2020
1. 交换机支持的命令:交换机基本状态: 交换机口令设置: 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 ;设置登录口令 xxswitch#exit ;返回命令 交换机VLAN设置:
switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端 口1switch(config-if)#switchport access vlan 2 ; 当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config- if)#switchport trunk allowed vlan 1,2 ;设置允许 的vlanswitch(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> 用户模式 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 配置交换机端口ip和子网掩码 aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 设置网关地址 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
怎么在思科模拟器配置交换机V T P 交换机除了能够连接同种类型的网络之外,还可以在不同类型的网络(如以太网和快速以太网)之间起到 互连作用。在思科模拟器上怎么配置交换机V T P?V T P被组织成管理域(V T P D o m a i n),V T P可以分为三种模式:服务器模式(S e r v e r),客户机模式(C l i e n t),透明模式,下面我们来看看配置方法 方法步骤 1、首先,打开思科模拟器软件,连接三台交换机的连接线,将所有交换机互相连接起来,一台当服务器,一台当客户机,另外一台当透明模式。 2、把三台交换机的配置清除干净,重启交换机,配置命令为: S1#d e l e t e f l a s h:v l a n.d a t S1#e r a s e s t a r t u p-c o n f i g S1#r e l o a d 配置S1为V T P s e r v e r,配置命令为: 复制内容到剪贴板 S1(c o n f i g)#v t p m o d e s e r v e r 3、配置S3为V T P t r a n s p a r e n t,配置命令是:
S3#v l a n d a t a b a s e S3(v l a n)#v t p t r a n s p a r e n t S3(v l a n)#v t p p a s s w o r d c i s c o(配置交换机的密码) S e t t i n g d e v i c e V L A N d a t a b a s e p a s s w o r d t o c i s c o 4、配置S2为V T P c l i e n t,配置命令是: S2(c o n f i g)#v t p m o d e c l i e n t S e t t i n g d e v i c e t o V T P C L I E N T m o d e. S2(c o n f i g)#v t p d o m a i n V T P-T E S T D o m a i n n a m e a l r e a d y s e t t o V T P-T E S T. S2(c o n f i g)#v t p p a s s w o r d c i s c o 5、在S1上创建V L A N,检查S2、S3上的V L A N信息,配置命令是: S1(c o n f i g)#v l a n2 S1(c o n f i g)#v l a n3 查看s1,s2,s3的V L A N配置信息。命令是: S1#s h o w v l a n S2#s h o w v l a n S3#s h o w v l a n 6、查看V T P信息,查看交换机的v t p详细信息和版本等信息:
三层交换机基日常本操作和维护 1、设置系统名称 ZXR10>-----普通用户模式 ZXR10#------特权模式 ZXR10(config)#--------全局模式 ZXR10(config)#interface fastethernet 0/1 //进入交换机fei_0/1口 ZXR10(config-if)#-------------子接口模式 ZXR10>enable //进入特权模式 ZXR10#configure terminal //进入全局配置模式 ZXR10(config)#hostname ZTE //对系统性命名为ZTE ZTE(config) #exit //退出用exit命令 2、设置系统日期和时间 ZXR10#clock set 15:52:35 apr 18 2011 //特权模式下 验证方法:-----注:思科模拟器上没有月份显示,用???代替 ZXR10#show clock-------显示设备当前的系统时间 3、设置设备特权模式密码 ZXR10(config)#enable secret zte //密文enable密码 ZXR10(config)#enable password zte //明文 验证方法: ZXR10(config)#exit ZXR10#exit 按回车键 ZXR10>输入enable Password:输入你的enable 密码。 4、设置登录标志 banner motd c //Set Message of the Day banner Enter TEXT message. End with the character 'c'. Hello world!! c ) 验证: ZXR10(config)#exit ZXR10#exit 按回车键 出现: Hello world!!--------欢迎语 ZXR10> 5、设置telnet登陆模拟器交换路由设备 拓扑图 远程登录时所端口连接设备及Telnet ??switch(config-line)可以设置通过console
思科交换机基本配置实例讲解
目录 1、基本概念介绍............................................... 2、密码、登陆等基本配置....................................... 3、CISCO设备端口配置详解...................................... 4、VLAN的规划及配置........................................... 4.1核心交换机的相关配置..................................... 4.2接入交换机的相关配置..................................... 5、配置交换机的路由功能....................................... 6、配置交换机的DHCP功能...................................... 7、常用排错命令...............................................
1、基本概念介绍 IOS: 互联网操作系统,也就是交换机和路由器中用的操作系统VLAN: 虚拟lan VTP: VLAN TRUNK PROTOCOL DHCP: 动态主机配置协议 ACL:访问控制列表 三层交换机:具有三层路由转发能力的交换机 本教程中“#”后的蓝色文字为注释内容。 2、密码、登陆等基本配置 本节介绍的内容为cisco路由器或者交换机的基本配置,在目前版本的cisco交换机或路由器上的这些命令是通用的。本教程用的是cisco的模拟器做的介绍,一些具体的端口显示或许与你们实际的设备不符,但这并不影响基本配置命令的执行。 Cisco 3640 (R4700) processor (revision 0xFF) with 124928K/6144K bytes of memory. Processor board ID 00000000 R4700 CPU at 100MHz, Implementation 33, Rev 1.2
IP地址范围:77. . ./8 借位范围9~16 密集区地址块,划分为不同的子网红色号5个 77.1.0.0/16 宿舍 分为5个vlan 77.1.001*****.0/19 网关:77.1.63.254 Vlan号:10 掩码:255.255.224.0 地址池IP段:77.1.32.1~77.63.253 网络号:77.1.32.0 77.1.010*****.0/19 网关:77.1.95.254 Vlan号:20 地址池IP段:77.1.64.1~77.1.95.253 网络号:77.1.64.0 77.1.011*****.0/19 网关:77.1.127.254 Vlan号:30 地址池IP段:77.1.96.1~77.1.127.253 网络号:77.1.96.0 77.1.100*****.0/19 网关:77.1.159.254 Vlan号:40 地址池IP段:77.1.128.1~77.1.159.253 网络号:77.1.128.0 77.1.101*****.0/19 网关:77.1.191.254 Vlan号:50 地址池IP段:77.1.160.1~77.1.191.253 网络号:77.1.160.0 77.1.110*****.0/19 网关:77.1.223.254 Vlan号:60 放置DHCP服务器和DNS服务器 网络号:77.1.192.0 注意:实验中的DNS服务器设置为192.168.1.1 在SDomlan中配置Vlan口 Switch>en Switch#conf t Switch(config)#hostname SDomlan SDomlan#vlan SDomlan#vlan database SDomlan(vlan)#vlan 10 VLAN 10 added: Name: VLAN0010 SDomlan(vlan)#vlan 20 VLAN 20 added:
Switch#conf t Switch(config)#vlan 10 Switch(config-vlan)#ex Switch(config)#int rang f0/1-5 Switch(config-if-range)#sw acc vlan 10 Switch(config-if-range)#ex Switch(config)#int f0/24 Switch(config-if)#sw mode trunk Switch(config)#int rang f0/23-24 Switch(config-if-range)#channel-group 1 mode on Switch(config-if-range)#ex Switch(config)#int port-channel 1 Switch(config-if)#sw mode trunk 远程登陆交换机:
Switch(config-if)#ip add 1.1.1.1 255.255.255.0(IP地址要和远程登陆的客户机在同一个网段) Switch(config-if)#no sh Switch(config-if)#ex Switch(config)#line vty 0 Switch(config-line)#password zlr Switch(config-line)#exit Switch(config)#enable secret 123 Switch(config)#ex Switch(config)#vlan 10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#ex Switch(config)#int rang f0/23-24 Switch(config-if-range)#sw trunk encapsulation dot1q
?配置用户user1,密码为digitalchina,使用此用户名的用户群为普通用户,不可以进入特权模式 –Router#config Router_config#username user1 password digitalchina –Router_config#aaa authentication for_login login local –Router_config#line console 0 –Router_config_line#login authentication for_login –Router_config_line# –Router_config#enable password digitalchina level 15 实训五十八HDLC封装 ?RouterA配置 ?指定封装协议为HDLC协议 –RouterA_config#interface serial 2/0 –RouterA_config_s2/0#encapsulation hdlc ?指定接口的IP地址以及子网掩码 –RouterA_config_s2/0#ip address 11.1.1.1 255.255.255.0 –RouterA_config_s2/0#no shut ?RouterB配置 –Router_config#interface serial 1/0
–Router_config_s1/0#encapsulation hdlc –Router_config_s1/0#ip address 11.1.1.2 255.255.255.0 –指定此端口(DCE端)的内时钟信号频率 –Router_config_s1/0#physical-layer speed 64000 端口状态察看 ?Router#show interface serial 2/0 ?Serial2/0 is up, line protocol is up ?。。。。 ?Encapsulation prototol HDLC, link check interval is 10 sec 使用PAP验证的配置 ?RouterA配置 –RouterA#config –RouterA_config#username RouterB_pap password digitallchinaB –RouterA_config#interface serial 2/0 –RouterA_config_s2/0#encapsulation ppp –RouterA_config_s2/0#ppp authentication pap –RouterA_config_s2/0#ppp pap sent-username RouterA_pap digitalchinaA –RouterA_config_s2/0#ip address 192.168.2.1 255.255.255.0
思科交换机路由器命令大全 交换机命令: switch> 用户模式 1:进入特权模式 enable switch> enable switch# 2:进入全局配置模式 configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名 hostname aptech2950 以aptech2950为例 switch> enable switch#configure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令 enable password cisco 以cisco为例 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码 enable secret ciscolab 以cicsolab为例--设置禁用IP地址解析特性,设置启用消息同步特性 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab aptech2950(conf)#no ip domain-lookup -----设置禁用IP 地址解析特性 aptech2950(conf)#logging synchronous -----设置启用消息同步特性 aptech2950(conf)#interface range fastethernet0/1-20
思科模拟器配置命令 Document number:PBGCG-0857-BTDO-0089-PTT1998
相同VLAN间的通信: Switch0与Switch1配置命令相同: Switch#conf t Switch(config)#vlan 10 Switch(config-vlan)#ex Switch(config)#int rang f0/1-5 Switch(config-if-range)#sw acc vlan 10 Switch(config-if-range)#ex Switch(config)#int f0/24 Switch(config-if)#sw mode trunk 配置聚合口:(聚合口的成员口类型要一致) Switch0与Switch1配置命令相同: Switch(config)#int rang f0/23-24 Switch(config-if-range)#channel-group 1 mode on Switch(config-if-range)#ex Switch(config)#int port-channel 1 Switch(config-if)#sw mode trunk 远程登陆交换机:
Switch(config)#int vlan 1 Switch(config-if)#ip add (IP地址要和远程登陆的客户机在同一个网段) Switch(config-if)#no sh Switch(config-if)#ex Switch(config)#line vty 0 Switch(config-line)#password zlr Switch(config-line)#exit Switch(config)#enable secret 123 Switch(config)#ex 三层交换机不同VLAN间的通信: 三层交换机配置: Switch(config)#vlan 10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#ex Switch(config)#int rang f0/23-24 Switch(config-if-range)#sw trunk encapsulation dot1q
cisco命令大全解释、注释 Dynamips作为一款十分优秀的Cisco路由器模拟软件,实验模拟效果远比Boson NetSim更加真实可信。Boson NetSim是对IOS命令行的模拟,而Dynamips是通过在计算机中构建运行IOS的虚拟机来真正运行IOS实现对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的密码