基礎命令練習

1.模式

Router> //用戶模式

Router# //特權模式(也叫enable 模式)

Router(config-if)# //接口模式

Router(config-router)# //router 模式

Router(config-line)# //line 模式

Router(config-subif)# //子接口模式

 

2.模式切換

Router> //用戶模式

Router>enable //在用戶模式敲入enable 進入特權模式(也叫enable 模式)

Router#disable //在特權模式敲入disable 退出到用戶模式

 

Router>enable //在用戶模式敲入enable 進入特權模式

Router#configure terminal //在特權模式敲入configure terminal 進入到配置模式

Router(config)#interface ethernet 0/0 //在配置模式敲入interface+接口類型+接口編號進入接口模式

Router(config-if)#exit //敲入exit 退出接口模式

 

Router(config)#router rip //敲入“router + 路由協議進入router 模式

Router(config-router)#exit //退出router 模式

 

Router(config)#line console 0 //進入line 模式

Router(config-line)#end //line 模式退出(任何時候敲入end 會退出到特權模式)

 

Router#conf t

Router(config)#interface ethernet 0/0.1 //進入子接口模式

Router(config-subif)#end //任何時候敲入end 會退出到特權模式

Router#

 

2.爲路由器定義名稱

router(config)#hostname xxx(xxx 爲我們定義的名稱)

Router(config)#host fxh

fxh(config)#定義路由器的名稱爲FXH,那麼對路由器定義名稱,是爲了區別我們所操作所有設備的不同.

 

3.爲路由器添加特權密碼

router(config)#enable password ssssss 爲我們定義的明文密碼)

router(config)#enable secret cisco (cisco 爲我們定義的密文密碼)

 

4.不執行 DNS 解析

router(config)#no ip domain-lookup (這條命令的作用是:當我們在執行命令錯誤的時候,路由器會認爲這條命令沒有錯誤,它只是一個域名的形式,那麼他會給你解析,這樣,很浪費我們寶貴的時間

5.配置路由器,使得控制檯端口不會中止你的連接。

router(config-line)#exec-timeout 0

我們在長時間不去操作路由器的時候,我們的路由器會自動的終止與我們的對話連接,跳轉到非連接狀態,這時候,我們還需要輸入enable 密碼重新登陸,從某種意義上來講是對安全性得到了保證,但是對我們的操作是十分的不方便的。

6.配置路由器,使得路由器發送的控制檯屏幕的消息不會附加到命令行中

router(config)#line console 0

router(config-line)# logging synchronous

 

7.配置路由器,使得當登陸控制臺端口的時候顯示一個標題

router(config)#banner motd

Enter TEXT message. End with the character 'm'. 在這裏M 是我們結束時候輸入的結束控制字符,你最好找一個特殊的作爲結束,例如~等等。Xxxxxxx(是我們定義的信息)

 

8..console 口的配置

Router(config)#line console 0

Router(config-line)#password [password] //設置con口登錄密碼

Router(config-line)#login

Router(config-line)#exit

9. VTY 口的配置

Router(config)#line vty 0 4 //不同設備或不同IOS可能數量不同

Router(config-line)#password [password]

Router(config-line)#login

Router(config-line)#exit

10. 配置以太網口

Router#conf t

Router(config)#int E0

Router(config-if)#ip address 192.168.1.1 255.255.255.0 //配置IP地址

Router(config-if)#no shutdown //激活該接口

11. 配置串行接口(需要配置時鐘頻率)

Router#conf t

Router(config)#int S0

Router(config-if)#clock rate 64000 // DCE設備配置時鐘,DTE設備不用配置

Router(config-if)#ip address 192.168.1.1 255.255.255.0 //配置IP地址

Router(config-if)#no shutdown

12. 配置接口描述信息:

Router(config-if)#description link to stsd

13. 配置主機名與IP地址映射:

Router(config)#ip host stsd 192.168.113.1

Ping stsd = ping 192.168.113.1

14 清除路由器啓動配置:

Rotuer#erase startup-config

15. 保存路由器當前配置:

Router#copy running-config startup-config 或者 Routerwrite

 

二:常用show命令

查看路由器版本

Router#show version

查看路由器flash

Router#show flash:

查看歷史命令記錄

Router#show history

查看接口物理相關信息

Router#show interfaces s0/0

查看接口協議相關信息

Router#show ip int s0/0

查看接口簡要信息

Router#show ip int brief

查看路由器啓動配置文件

Router#show running-config

查看路由器運行配置文件

Router#show running-config

查看當前登錄的所有用戶

Router#show users

查看路由器ARP

Router#show arp

三:路由器模式詳解

用戶模式

Router>

特權模式

Router#

全局配置模式

Router(config)#

接口模式

Router(config-if)#

子接口模式

Router(config-subif)#

線路配置模式

Router(config-line)#

路由配置模式

Router(config-router)#

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章