RS的IOS系统的模式区分
“>”:普通用户模式
“#”:特权模式
全局配置模式
接口配置模式
路由协议配置模式
“>”:输入enable 进入特权模式
“#”:输入configure terminal 进入全局配置模式(全局配置模式具有最高权限,可以对这个设备做任何操作)
hostname xx,修改设备主机名
?获取命令帮助信息
terminal length ?查看帮助。一次显示多少内容的帮助
Switch>terminal length 0
设置为0,一次性将所有内容显示
Switch>?
Exec commands:
access-enable Create a temporary Access-List entry
access-profile Apply user-profile to interface
clear Reset functions
connect Open a terminal connection
crypto Encryption related commands.
disable Turn off privileged commands
disconnect Disconnect an existing network connection
do-exec Mode-independent “do-exec” prefix support
enable Turn on privileged commands
ethernet Ethernet parameters
exit Exit from the EXEC
help Description of the interactive help system
lat Open a lat connection
lock Lock the terminal
login Log in as a particular user
logout Exit from the EXEC
mrinfo Request neighbor and version information from a multicast
router
mstat Show statistics after multiple multicast traceroutes
mtrace Trace reverse multicast path from destination to source
name-connection Name an existing network connection
pad Open a X.29 PAD connection
ping Send echo messages
ppp Start IETF Point-to-Point Protocol (PPP)
release Release a resource
renew Renew a resource
resume Resume an active network connection
rlogin Open an rlogin connection
routing-context Routing Context
set Set system parameter (not config)
show Show running system information
slip Start Serial-line IP (SLIP)
ssh Open a secure shell client connection
systat Display information about terminal lines
tclquit Quit Tool Command Language shell
telnet Open a telnet connection
terminal Set terminal line parameters
tn3270 Open a tn3270 connection
traceroute Trace route to destination
tunnel Open a tunnel connection
udptn Open an udptn connection
where List active connections
x28 Become an X.28 PAD
x3 Set X.3 parameters on PAD
xremote Enter XRemote mode
Switch>
Switch>enable
Switch#
进入特权模式
Switch#disable
Switch>
特权模式回到用户模式
Switch#logout
任何模式下logout,exit,quit,直接退出系统
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
用户模式->特权模式->全局配置模式
Switch(config)#^Z
Switch#
*Apr 29 19:41:33.583: %SYS-5-CONFIG_I: Configured from console by console
Switch#
Ctrl+z,或exit或end退出全局配置模式
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname ccna^Z
ccna#
*Apr 29 19:44:49.912: %SYS-5-CONFIG_I: Configured from console by console
ccna#
Ctrl+z前面有命令,会先执行命令,再退出全局配置模式
ccna#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
ccna(config)#hostname sw
ccna#
*Apr 29 19:46:25.462: %SYS-5-CONFIG_I: Configured from console by console
ccna#
Ctrl+c前面有命令,不会执行命令,直接退出全局配置模式
ccna#aa bb cc dd
Ctrl+w一次删除一个参数
Ctrl+u或Ctrl+x直接删除整行
Ctrl+a将光标跳到行首
Ctrl+e将光标跳到行尾
Ctrl+shift+6立即终止当前操作
sw#clock set ?
hh:mm:ss Current Time
sw#clock set 19:51:00 ?
<1-31> Day of the month
MONTH Month of the year
sw#clock set 19:51:00 29 ?
MONTH Month of the year
sw#clock set 19:51:00 29 April ?
<1993-2035> Year
sw#clock set 19:51:00 29 April 2019
sw#
*Apr 29 17:51:00.000: %SYS-6-CLOCKUPDATE: System clock has been updated from 21:52:30 EET Mon Apr 29 2019 to 19:51:00 EET Mon Apr 29 2019, configured from console by console.
sw#
clock set特权模式下修改时间
sw(config)#clock timezone UTC +8
sw(config)#
Apr 29 17:53:56.545: %SYS-6-CLOCKUPDATE: System clock has been updated from 19:53:56 EET Mon Apr 29 2019 to 01:53:56 UTC Tue Apr 30 2019, configured from console by console.
sw(config)#
clock timezone全局配置模式下修改时区
cisco IOS 配置文件
Running configuration:存放在易失性存储中的配置文件,正在内存中的运行的配置
Startup configuration:存放在非易失性存储中的配置文件,重启设备依旧存在的配置
RAM:易失性存储,即为内存
NVRAM:非易失性存储,即为类似磁盘
sw>enable
sw#show running-config
Building configuration…
Current configuration : 728 bytes
!
! Last configuration change at 02:03:57 UTC Tue Apr 30 2019
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname sw
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone UTC 8 0
查看内存中的配置(易失性存储)
在设备上做的操作会立即生效,配置是保存在内存中的,但还没有保存到磁盘。
sw#show startup-config
startup-config is not present
sw#
查看启动配置(非易失性存储)
目前设备的磁盘配置文件上还没有内容。
一旦设备断电或者重启,那么会从启动配置文件中读取相关配置,因此,需要将内存中的配置保存到startup configuration中。
保存内存中配置到非易失性存储
第一种方式
sw#copy running-config startup-config
Destination filename [startup-config]?
Building configuration…
Compressed configuration from 788 bytes to 548 bytes[OK]
sw#
sw#show startup-config
Using 548 out of 524288 bytes, uncompressed size = 788 bytes
!
! Last configuration change at 02:03:57 UTC Tue Apr 30 2019
! NVRAM config last updated at 03:28:41 UTC Tue Apr 30 2019
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname sw
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone UTC 8 0
!
!
!
–More–
此时startup configuration中有内容了。
第二种方式
sw#write
Building configuration…
Compressed configuration from 788 bytes to 546 bytes[OK]
sw#
将非易失性存储(startup configuration中配置擦除)配置擦除
3种方式:
sw#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
sw#
Apr 29 19:31:41.243: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
sw#
sw#erase nvram:
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
sw#
Apr 29 19:33:22.897: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
sw#
sw#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
sw#
Apr 29 19:33:52.925: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
sw#
查看接口摘要信息
sw>enable
sw#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset up up
Ethernet0/3 unassigned YES unset up up
sw#
进入接口配置模式
sw#configure terminal
sw(config)#interface e0/0
sw(config-if)#shutdown
sw(config-if)#end
sw#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset administratively down down
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset up up
Ethernet0/3 unassigned YES unset up up
sw#
sw(config-if)#no shutdown
sw#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset up up
Ethernet0/3 unassigned YES unset up up
sw#
查看接口详细信息
sw#show interfaces e0/0
Ethernet0/0 is up, line protocol is up (connected)
Hardware is AmdP2, address is aabb.cc00.1000 (bia aabb.cc00.1000)
MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Auto-duplex, Auto-speed, media type is unknown
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output 00:00:01, output hang never
Last clearing of “show interface” counters never
Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/0 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts (0 multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
18864 packets output, 1403676 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
sw#
半双工:同一时刻,只能一个发一个收,不能同时收发。
全双工:同一时刻,可以同时进行收发操作。