路由器的一些常用的命令和配置

1.路由器的模式
Router>用戶模式
Router#特權模式
Router(config)#配置模式
Router(config-if)#    接口模式
Router(config)#interface f0/0.1  進入子接口
Router(config-subif)#    子接口模式
Router(config-line)#      進行線模式
Router(config-router)#     路由配置模式

2.配置靜態路由條目
Router(config)# ip route 192.168.10.0 255.255.255.0 192.168.9.2     /192.168.10.0網段及掩碼需要經過相鄰路由器接口的IP地址

3.配置默認路由
Router B(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2     /所以外出的數據包如果找不到路由表目均找192.168.2.2接口。
 
4.配置路由控制檯密碼
teacher(config)#line console 0
teacher(config-line)#login
teacher(config-line)password cisco

teacher(config)#enable password cisco          /配置特權模式密碼
teacher(config)#enable secret 1234            /配置加密保存的密碼
teacher(config)#service password-encryption  / 對所有密碼加密
 
5.配置控制檯會話時間
teacher(config)#line console 0
teacher(config-line)exec-timeout 0 0
 
6.配置控制檯輸出日誌同步
teacher(config)#line console 0
teacher(config-line)#logging synchronous
 
7.路由密碼恢復
(1)進入ROM Monitor 模式
(2)修改配置寄存器的值,啓動是繞過 startup-config文件
    rommon1>confreg ox2140
    rommon2>reset
 (3)用startup-config覆蓋running-config
     ROuter#copy starup-config running-config
     修改密碼
     Router(config)#enable password cisco
 (4)修改配置寄存器的值
    Router(config)#config-register ox2102
 
 
 8.動態路由配置
 (1)截斷超時
 (2)打開接口
 (3)爲接口設置IP 地址
 Router(config)#interface f0/0
 Router(config-if)#ip address 192.168.1.1
  Router(configif)#no shutdown
  (4)啓動RIP進程,並宣告主網絡號
  Router(config)#router rip
  Router(config-router)#network 192.68.1.0
 
  9.單臂路由配置
  Router(config)#interface f0/0.1
  router(config-subif)#encapsolution dotlq 1 :子接口封裝dot1q針對的是VLAN1
  Router(config-subif)#ip address 192.168.1.1 255.255.255.0  :設置VLAN的網關地址
 
   Router(config)#interface f0/0.2
   router(config-subif)# encapsolution dotlq 2  子網接口封裝do1q針對的是VLAN2
   Router(config-subif)# 192.168.2.1  255.255.255.0 :設置VLAN2的網關地址
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章