路由器常用配置命令
配置路由器的方法:Console 端口配置、Telnet遠程登錄配置。
路由器配置模式。
1. 用戶模式。Router>
2. 特權模式。Router># 。用戶模式下輸入enable即可。
3. 全局配置模式。Router(config)# 。特權模式下輸入 configure terminal即可。
3.1 Router(config-if)# 接口配置
3.2 Router(config-line)# 線路配置
3.3 Router(config-router)# 路由配置
在任何一種模式下,用“exit”返回到上一級模式;用“end”直接返回到特權模式。
一些簡單命令示例。仿真軟件:Cisco Packet Tracer。
Router>
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet 0/1
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Router(config-if)#exit
Router(config)#hostname cc_router
cc_router(config)#exit
cc_router#
%SYS-5-CONFIG_I: Configured from console by console
cc_router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/1
cc_router#
-------------------------------------------------------------------------------------------------------------------------------------------
保存設置
對於配置文件來說,參數值run表示存放在DRAM中的配置。start表示存放在NVRAM中的配置。所有的配置命令隻要鍵入後馬上存在DRAM並運行,但掉電後會馬上丟失。而NVRAM中配置隻有在重新啟動之後才會被複製到DRAM中運行,掉電後不會丟失,因此,必須養成好的配置習慣。在確認配置正確無誤後將配置文件複製到NVRAM中去。其命令為
copy run start
ip access-group 命令將已定義的access-list用在某一個接口的in或則out方向。
最後更新:2017-04-03 08:26:17