IOS主要模式
模式 描述 提示符
用戶執行模式 路由器受限檢查,遠程訪問 Router>
特權執行模式 路由器的詳細檢查:調試和測試,文件處理,遠程訪問 Router#
全局配置模式 全局配置命令 Router(config)#
其他配置模式 特定的服務和接口配置 Router(config-mode)#
IOS功能和命令總結:
用戶執行模式:
enable——用戶進入特權執行模式
特權執行模式:
copy running-config startup-config——用於將活動配置復制到NVRAM;
copy startup-config running-config——用於將NVRAM中配置的配置復制到內存;
erase startup-configuration——用於刪除NVRAM個跳;
tracerouteIP地址——用於追蹤通向該地址的每一跳;#若從Windows計算機執行追蹤,使用tracert
show interfaces——用於顯示設備上所有接口的統計信息;
show ip interface brief——驗證交換機接口狀態
show clock——用於顯示路由器中設置的時間
show version——用於顯示當前加載的IOS版本以及硬件和設備信息;
show arp——用於顯示設備的ARP表;
show startup-config——用於顯示保存在NVRAM中的配置;
show running-config——用於顯示當前的運行配置文件的內容;
show ip interfaces——用於顯示路由器上的所有接口IP統計信息;
configure terminal——用於進入終端配置模式;
終端配置模式:
hostname hostname——用於為設備分配主機名;
enable password password——用於設置未加密的使能命令;
enable secret password——用於設置強加密的使能命令;
service password-encryption——用於加密顯示除使能加密口令外的所有口令;
banner motd# message#——用於設置當日消息標語;
line console 0——用於進入控制台線路配置模式;
line vty 0 4——用於進入虛擬終端(Telnet)線路配置模式;
interfaces interface_name ——用於進入接口配置模式;
線路配置模式:
login——用於啟動登錄時的口令檢查;
password password——用於設置線路口令;
接口配置模式:
ip address ip_address netmask ——用於設置接口IP地址和子網掩碼;
description description ——用於設置接口描述;
clock rate value——用於設置DCE設備的時鍾頻率;
no shutdown ——用於打開接口;
shutdown ——出於管理目的關閉接口
配置路由器以太網接口:
——路由器以太網接口用作局域網中直接連接到路由器網絡中的終端設備的網關。每個以太網接口必須擁有一個IP地址和一個子網掩碼才能路由IP數據包。
配置以太網接口:
Router>
Router>enable #進入特權模式
Router#config t #進入全局模式
Router(config)#interface FastEthernet 0/0 #進入接口配置模式
Router(config-if)#ip address 192.168.10.11 255.255.255.0 #指定接口IP地址和子網掩碼
Router(config-if)#no shutdown #啟動f0/0接口
Router(config-if)#exit #退出接口配置模式
Router(config)#exit #退出全局模式
Router#disable #退出特權模式
Router>
配置路由器串行接口
串行接口用於通過廣域網連接達到遠程站點或ISP處的路由器。
Router>enable
Router#config t
Router(config)#interface serial 2/0
Router(config-if)#ip address 192.168.20.100 255.255.255.0
Router(config-if)#clock rate 56000#如果連接了DCE電纜,則設置時鍾頻率;如果連接DTE電纜,則跳過此步驟。
Router(config-if)#no shutdown
Router(config-if)#description Connects to main switch in Building A #配置接口描述
交換機接口配置:
交換機的接口默認啟動的。
Switch>enable
Switch#configure terminal
Switch(config)#interface FastEthernet 0/1
Switch(config-if)#description To TAM switch
Switch(config-if)#exit
Switch(config)#hostname Flour_Bluff
Flour_Bluff(config)#exit
Flour_Bluff#
要管理交換機,需要為其分配地址。交換機的地址被分配給稱為虛擬局域網接口(VLAN)的虛擬接口,大多數情況下,該接口為VLAN1,該接口與路由器的物理接口相似,需要通過
no shutdown命令啟動此接口。
Flour_Bluff#config t
Flour_Bluff(config)#interface vlan 1
Flour_Bluff(config-if)#ip address 192.168.2.10 255.255.255.0
Flour_Bluff(config-if)#no shutdown
Flour_Bluff(config)#ip default-gateway 192.168.1.1 #交換機需要一個網關才能與本地網絡之外的設備通信
Flour_Bluff(config)#exit
Flour_Bluff#
