network basic commands

IOS basic operation commands
1. Introduction
Cisco's Internetwork Operating System (IOS: Internetwork Operating System), IOS configuration is usually carried out through a text-based command line interface.
2. Operation mode
1. User mode:
R1> #You
can usually view statistical information
R1>logout #Exit
user mode

2. Privileged mode
R1>enable
R1#
#Enter privileged mode, which is entered from user mode. Used to view and modify routers.
R1#disable #Exit
privileged mode

3. Global configuration mode R1#configure terminal R1(config)
# #Enter global mode, which is entered from privileged mode. Once modified, it will affect the entire network.

Either R1#config t simplified command or R#configure can enter global configuration mode.

R1(config)#exit #Exit
the global configuration mode, or use the shortcut key ctrl+z

Help commands and command completion
R1#conf #Press the tab key
R1#configure t #Press the tab key
R1#configure terminal Complete all commands as configure terminal

Set the clock:
R1#clock set 11:40:55 21 apr 2018

View time settings:
R1#show clock

Support shortcut
Ctrl+u Delete from the cursor position to the beginning of the line
Ctrl+u Move the cursor to the beginning of the line
Ctrl+e Move the watermark to the end of the line
View terminal configuration and number of saved historical commands: R1#show terminal
View historical commands: R1# show history
modifies the number of saved history commands: R1#terminal history size 50 Changes the original default 10 to 50. It is not recommended and takes up resources.
View basic routing information: R1#show version

3. Password management of routers and switches:
1. Set the host name: Change the host name from R1 to R2
R1>en
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#hostname R2
R2(config)#
2. Set the login prompt information
(1) Define the date information registration
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
R1(config)#banner motd i Delimiter, can be any character between two i's
Enter TEXT message. End with the character 'i'.
Abcdefjhklmnopqrstuvwxyz i
R1(config)#exit
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1 #coye run start Save the running-config to start
R1#reload restart the router
(2) Define the login information This function is not implemented on the simulator
R(config)#banner login u
Ccccccccccccccccccc
U
R1(config)#exit
R1#
R1#copy run start
3. Set the password
router password
interface password, you cannot enter any command, you need to enter
1) console port password
local interface, so you can manage without password
2) virtual interface password
a) telnet password
b) ssh password
3) aux interface
privileged password: After logging in, execute the enalbe command, and the Conf t enable secret password
is required to enter the privileged password mode

1) Set the privileged mode password
R1(config)#enable password 123 #Set the privileged non-password (plain text)
R1(config)#enable screct 456 #Set the privileged encrypted password (encryption)
2) Set the console port login password
R1(config) #line console 0
R1(config-line)# #Indicates entering console mode
R1(config-line)#password 123 #Set the password to 123
R1(config-line)#login #Enable password check
R1(config-line)# exec-timeout 0 0 #In interface mode, set the timeout time for the session, 0 0 is never timeout

R1(config-line)#logging synchronous #Block console information and avoid closing command input
3) Set telnet login password
R1(config)#line vty 0 15
R1(config-line)#password 123
R1(config-line) #login
#Telnet login is not secure, please avoid using
R1(config-line)#line vty 0 15
R1(config-line)#no login #Allow
telnet to log in without password (insecure, not allowed)

4) Password encryption
passwords except R1(config)#enable secret 456 passwords are encrypted and stored, and other passwords are stored in plain text. You can
view R1(config)#service password-encryption through: R1(config)#show running-config
R1(config)#service password-encryption #Yes Turn on the encryption service, all passwords will be saved in ciphertext

4. SSH login
1) Set the username and domain name
R1(config)#hostname sc
SC(config)#ip domain-name lamp
Modify the hostname and domain name, when generating the secret key, you need to use
# must set the router time
2) Generate the encryption key
R1(config)#hostname sc
sc(config)#ip domain-name lamp
sc(config)#cr
sc(config)#crypto key generate rsa general-keys modulus 1024 #Use
rsa encryption to generate a 1024-bit secret key, if the key If the number of bits is less than 468, the 2-generation ssh protocol cannot be used. DSA
3) Set login password
sc(config)#aaa new-model #Enable AAA (authentication, authorization and accounting) mode
sc(config)#username cisco password cisco #Set username and password
4) Set timeout, Number of failures, version
sc(config)#ip ssh time-out 120 #Set the timeout time
sc(config)#ip ssh authentication-retries 5 #Set the maximum failure
sc(config)#ip ssh version 2 #Set the ssh version to SSH2
5) Set the connection line -----------------------? The line vty 0 998 line is not found in the simulator
SC(config)#line vty 0 988
Sc(config-line)#transport input SSH
#transport input SSH telnet #After
logging in remotely, you cannot log in to the privileged mode without setting a password in the privileged mode

Fourth, router interface operation
1. View the interface:
Router0#show running-config
2. Select the interface, it will enter the interface configuration mode
Router(config)#interface?
Dot11Radio Dot11 interface #Wireless network card interface
Ethernet IEEE 802.3 #Ethernet interface
FastEthernet FastEthernet IEEE 802.3 #Fast Ethernet interface
GigabitEthernet GigabitEthernet IEEE 802.3z #Gigabit Ethernet interface
Loopback Loopback interface #Loopback interface
Serial Serial #Serial interface
Tunnel Tunnel interface #Tunnel interface
Virtual-Template Virtual Template interface #Virtual analog interface
Vlan Catalyst Vlans #vlan interface
range interface range command #Interface range

sc(config)#interface fastEthernet0/1 #Enter the fast Ethernet interface 0/0, where 0 represents the slot and 1 represents the port
sc(config-if)#
#Some interfaces will be described by 0/0/1, and 0 represents the router itself, 0 represents slot, 1 represents port
3, interface description
sc(config)#int f0/1
sc(config-if)#description caiwu route #describe which router this interface is connected to
4. The do command is In global mode, you need to scan the line and add do before the command in privileged mode to execute. For example, R1(config)#do show run
5. Activate the interface, the interface is closed by default, you need to activate
R1(config)#interface fastEthernet 0/0
sc(config)#interface f0/0
sc(config-if)#no shutdown
6. Assign an IP address to the interface
sc(config)#in f0/0
sc(config-if)#ip address 192.168.1.1 255.255.255.0
sc(config-if)#
7. The clock frequency
is generally controlled by the server operator . The clock frequency is only valid for routers connected by serial ports. The serial ports are used for old-fashioned WAN connections, mainly using E1 network (bandwidth 2.048Mbps). Now basically replaced with optical fiber.
If the serial port is Seria, the clock frequency needs to be configured on the DCE (data communication) side, but not on the DTE (data terminal equipment) side. In the experiment, use serial port to connect two routes, you need to configure the clock frequency on the DCE port.

Check the s1/0/0 or s1/1/0 interface, you can see that the router's interface is the DTE or DCE side
R#show controllers s1/1/0

The DCE side needs to configure the clock frequency unit bit/s
R2(config)#int s1/1/0
R2(config-if)#clock rate 64000
5. Save and delete
1. Save the configuration
Router0#copy running-config startup-config
# running-config is the running configuration, which is stored in DRAM and will be lost after restarting. Executing this command will copy running-config to startup-config. Startup-config is the startup configuration, which is saved in NVRAM and takes effect permanently.
Router0#show startup-config #View the startup configuration
2. Delete the configuration
Router# erase startup-config
Router#show startup-config
Startup-config is not present
Router#reload Restart the router
6. View the verification configuration
1, ping ip to test whether the ip address Unobstructed
2. Traceroute domain name or IP test routing path
3, Telnet IP or domain name port remote management, or probe port
4. View interface parameters and configuration
Router0#show interfaces ?
Router0#show interfacesf0/0 5.Clear
the interface counter
Router0# clear counters f0/0
6. View IP information
router0#show ip interface 7.Check
the ip address and status of all interfaces
Router0#show ip interface brief 8.Check
the protocols on all interfaces #Can
be used to query the status of each port and the configured IP address
Router #show protocols

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324934897&siteId=291194637