萬盛學電腦網

 萬盛學電腦網 >> 網絡應用技術 >> 應用教程 >> 常用路由器配置命令集錦

常用路由器配置命令集錦

   1、進入特權模式、全局配置模式、接口配置模式、虛擬終端配置模式、RIP路由協議配置模式

  Router > enable

  Password :

  Router #

  Router # configure terminal

  Router (config) #

  Router (config) # int f0/12

  Router (config-if) #

  Router (config) # line vty 0 15

  Router (config-line) #

  Router (config) # router rip

  Router (config-router) #

  2、配置遠程登錄密碼

  Router (config) # line vty 0 15

  Router (config-line) # password 7 isncgyx

  3、拷貝配置文件到TFTP Server

  Router # write network

  4、拷貝running-config 到TFTP Server

  Router # copy running-config tftp:

  5、拷貝bootflash 中的配置文件到TFTP Server

  Router # copy bootflash : tftp :

  6、從TFTP Server 拷貝配置文件到路由器

  Router # copy tftp : running-config

  7、將TFTP Server 上的配置文件拷貝到bootflash

  Router # copy tftp : bootflash :

  8、配置路由器的主機名

  Router (config) #hostname Router-isnc

  9、配置超級用戶口令

  Router (config) # enable secret isncgyx

  10、設置系統時鐘

  Router # calendar set 11:30:00 16 october 2011

  11、保存配置

  Router # write memory

  Router # write network tftp

  12、刪除配置

  Router # write erase

  13、基本檢測命令(telnet、ping、trace)

  Router > telnet paris/221.4.8.1

  Router > ping 192.168.201.64

  Router > trace 210.38.160.5

  Router > traceroute www.yourtion.com

  14、查看flash、系統時鐘、軟硬件版本、路由器配置、查看路由表、IP路由協議的詳細信息

  Router > show flash

  Router > sh clock

  Router > sh version

  Router # sh configuration

  Router # sh ip route

  Router # sh ip protocols

  15、配置接口描述信息

  Router (config-if) # description To-JiaYing University

  16、配置接口帶寬

  Router (config-if) # bandwidth 2500,000

  17、配置接口的IP地址

  Router (config-if) # ip address 202.112.7.249 255.255.255.252

  18、接口的開啟與關閉

  Router (config-if) # shutdown/no shutdown

  19、不作ARP代理

  Router (config-if) # duplex ful

  l# no ip directed-broadcast

  # no ip proxy-arp

  20、配置異步串行接口

  Router (config) # interface a1

  Router (config-if) # ip unnumbered ethernet0

  Router (config-if) # encapsulation ppp

  Router (config-if) # async default ip address 202.112.7.129

  Router (config-if) # async dynamic routing

  Router (config-if) # async mode interactive

  Router (config-if) # no shutdown

  Router (config-if) # exit

  Router (config) # exit

  Router (config) #

  21、配置高速同步串行接口

  Router (config) # interface s1/1

  Router (config-if) # description To-shenzhen

  Router (config-if) # bandwidth 2048

  Router (config-if) # ip address 212.112.41.81 255.255.255.252

  Router (config-if) # encapsulation hdlc

  Router (config-if) # no ip directed-broadcast

  Router (config-if) # no ip proxy-arp

  22、配置POS接口

  Router (config) # interface POS3/0

  Router (config-if) # description To TianJingDaXue

  Router (config-if) # bandwidth 2500,000

  Router (config-if) # ip address 212.12.37.18 255.255.255.252

  Router (config-if) # crc 32

  Router (config-if) # pos framing sdh

  Router (config-if) # no ip directed-broadcast

  Router (config-if) # pos flag s1 s0 2

  23、loopback 接口的配置

  Router (config) # int loopback 0

  Router (config-if) # ip address 192.167.167.9 255.255.255.255

  Router (config-if) # no ip route-cache

  Router (config-if) # no ip mroute-cache

  24、配置靜態路由

  Router (config) # ip route 192.65.96.0 255.255.240.0 222.112.37.1(靜態路由的配置)

  25、進入RIP配置模式

  Router (config) # router rip

  26、設置參與RIP協議的網絡地址

  Router (config-router) # network 159.105.0.0

  27、配置RIP的被動接口

  Router (config-router) # passive-interface ethernet 0

  28、配置RIP的路由過濾

  Router (config) # access-list 12 deny any

  Router (config) # router rip

  Router (config-router) # distribute-list 12 in ethernet0

  29、配置RIP的管理距離

  Router (config-router) # distance 50

  30、配置RIP的鄰居路由器

  Router (config-router) # neighbor 202.112.7.2

  31、配置單個IP地址參與OSPF

  Router (config) # router ospf 63

  Router (config-router) # network 131.107.25.1 0.0.0.0 area 0

  32、網絡地址參與OSPF

  Router (config-router) # network 133.181.0.0 0.0.255.255 area 0

  33、定義參與OSPF的子網地址

  Router (config-router) # area 0 range 212.37.123.0 255.255.255.0

  34、配置被動接口(包括路由器和第三層交換機的配置)

  Router (config-router) # passive-interface Ethernet 0

  Router (config-router) # passive-interface vlan37

  35、配置路由過濾

  Router (config) # access-list 12 deny any

  Router (config) # router ospf 63

  Router (config-router) # distribute-list 12 in serial 0

  36、配置管理距離

  Router (config-router) # distance 10

  37、配置OSPF引入外部路由的花費值

  Router (config-router) # redistribute metric 100

  38、配置引入外部路由時缺省的標記值

  Router (config-router) # redistribute tag 10

  39、配置引入外部路由時缺省的外部路由類型

  Router (config-router) # redistribute connected metric-type 1 subnets

  40、配置IP地址池的名稱

  Router (config) # ip dhcp pool ttt/234

copyright © 萬盛學電腦網 all rights reserved