路由器的簡單配置

Router#con
redis

Router#conf網絡

Router#configure  t負載均衡

Enter configuration commands, one per line.  End with CNTL/Z.ide

Router(config)#hostname R1oop

R1(config)#exit性能

R1#學習

R1#ter測試

R1#terminal  history  size  ?url

<0-256>  Size of history bufferspa

R1#terminal  history  size  20

R1#show  history

enable

conf t

conf

con

configure  t

conf t

terminal  history  size  20

show  history

R1#termi

R1#terminal  no  hist

R1#terminal  no  history

R1#ter

R1#terminal  history

R1#clock  ?

set  Set the time and date

R1#clock  set 22:28:00  3  june  2013

R1#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#clock ?

initialize   Initialize system clock on restart

save         backup of clock with NVRAM

summer-time  Configure summer (daylight savings) time

timezone     Configure time zone

R1(config)#clock timez

R1(config)#clock timezone ?

WORD  name of time zone

R1(config)#clock timezone  GMT +8

R1(config)#inter

R1(config)#interface ser

R1(config)#interface serial  1/1

R1(config-if)#exit

R1(config)#int

R1(config)#inter s1/1

R1(config-if)#ip  add

R1(config-if)#ip  address 12.1.1.1  255.255.255.0

R1(config-if)#no  shutdo

R1(config-if)#no  shutdown

R1(config-if)#end

R1#show  ip  interface brief

R2(config-if)#do  show  ip  inter  brief

R2(config-if)#do ping 12.1.1.1

R2(config)#line vty 0 4

R2(config-line)#pas

R2(config-line)#password  123

R2(config-line)#log

R2(config-line)#login

####R2(config)#enable password  456

R2(config)#enable secret   789

R2(config)#exit

R2#show  running-config

R2#conf  t

Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#enable ?

last-resort  Define enable action if no TACACS servers respond

password     Assign the privileged level password

secret       Assign the privileged level secret

use-tacacs   Use TACACS to check enable passwords

R2(config)#enable se

R2(config)#enable secret cisco

R2#exit   ##退出R1遠程登陸R2

R1#telnet  12.1.1.2

路由器後面的AUX是鏈接貓modern經過撥號電話號碼遠程配置路由器的(當不給***,不給internet,不給QQ遠程的狀況下使用的)旁邊的是連交換機的接口的

前言:在網上搜集了很多資料,最後摸到答案,但願爲遇到一樣問題的同窗提供一種解決方案,節約你們學習時間。

課程段:劉貝斯老師《網絡工程師教程》2-8——2-11課程

環境:win7 32位

問題:在該課程指導下dynamips用本機ping R1,ping不通,即第一次ping R1 F0/0:192.168.1.1及S1/1:12.1.1.1。

解決方案:

一、右鍵計算機管理——設備管理器——右鍵計算機名——添加過期硬件——安裝我手動...——網絡適配器——Microsoft(左欄)-Microsoft Loopback Adapter——安裝完成

二、重啓計算機,確認在網絡鏈接裏看到Microsoft Loopback Adapter的本地鏈接,說明安裝成功。

三、在CCNA dynamips從新獲取網卡參數,

spacer.gif

選擇名爲MS LoopBack Driver' on local host的網卡參數,並按照視頻教程從新粘貼到指定位置保存。(注意:CMD下getmac命令也能夠得到網卡參數,但此參數略有差別需修改,建議直接用軟件提供的批處理程序得到網卡參數)

四、在網絡鏈接原來真實網卡本地鏈接中選擇自動獲取IP,在Microsft Loopback Adapter的本地鏈接中按教程設置相應IP。

五、按照教程和拓撲圖完成實驗配置,在完成R1的配置後便可嘗試ping F0/0:192.168.1.1及S1/1:12.1.1.1,祝你成功。

start R1

idlepc get R1

idlepc save R1 db

stop R1

R1

en

conf t

int f0/0

ip add 192.168.1.1 255.255.255.0

no sh

int s1/1

ip add 12.1.1.1 255.255.255.0

no sh

end

conf t

ip route 23.1.1.0 255.255.255.0 12.1.1.2

ip route 3.3.3.0 255.255.255.0 12.1.1.2

end

R2

en

conf t

int s1/0

ip add 12.1.1.2 255.255.255.0

no sh

int s1/1

ip add 23.1.1.2 255.255.255.0

no sh

end

conf t

ip route 192.168.1.0 255.255.255.0 12.1.1.1

ip route 3.3.3.0 255.255.255.0 23.1.1.3

end

R3

en

conf t

int s1/0

ip add 23.1.1.3 255.255.255.0

no sh

int lo0

ip add 3.3.3.3 255.255.255.0

no sh

end

conf t

ip route 192.168.1.0 255.255.255.0 23.1.1.2

ip route 12.1.1.0 255.255.255.0 23.1.1.2

end

----------------------------------------------------------------------------------------------

en

conf t

host R1

int f0/0

ip add 192.168.1.1  255.255.255.0

no shut

int s1/1

ip add 12.1.1.1  255.255.255.0

no shut

en

conf t

host R2

int s1/0

ip add 12.1.1.2  255.255.255.0

no shut

int s1/1

ip add 23.1.1.2  255.255.255.0

no shut

en

conf t

host R3

int s1/0

ip add 23.1.1.3  255.255.255.0

no shut

int lo0

ip add 3.3.3.3  255.255.255.0

R2#debug  ip  icmp

R2#conf t

R2#ip  route 192.168.1.0  255.255.255.0  12.1.1.1

R2#no  debug  ip  icmp

R1#conf t

R1#ip  route  23.1.1.0 255.255.255.0  12.1.1.2

R3#ip  route  192.168.1.0  255.255.255.0  23.1.1.2

R1#ip  route  3.3.3.0 255.255.255.0  12.1.1.2

R2#ip  route  3.3.3.0 255.255.255.0  23.1.1.3

R1#en

conf t

int f0/0

ip add 192.168.1.1  255.255.255.0

no shut

route#copy  runing-config  tftp   (下載配置文件到cisco  TFTP  Server裏)

192.168.1.2

r1

route#copy  tftp  running-config

192.168.1.2

r1

R1#ping

Protocol [ip]:

Target IP address: 23.1.1.3

Repeat count [5]:

Datagram size [100]:

Timeout in seconds [2]:

Extended commands [n]: y

Source address or interface: 192.168.1.1

Type of service [0]:

Set DF bit in IP header? [no]:

Validate reply data? [no]:

Data pattern [0xABCD]:

Loose, Strict, Record, Timestamp, Verbose[none]:

Sweep range of sizes [n]:

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 23.1.1.3, timeout is 2 seconds:

Packet sent with a source address of 192.168.1.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 12/31/44 ms

R1#

或者讓r1的s1/1能夠ping通3.3.3.3就增長r1的s1/1的路由在R3上

R3>enable

R3#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R3(config)#ip  route  12.1.1.0  255.255.255.0  23.1.1.2

##############################################################

R1>enable

R1#show cdp  nei

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID

R2               Ser 1/1            154          R        7206VXR   Ser 1/0

R1#show cdp

Global CDP information:

Sending CDP packets every 60 seconds

Sending a holdtime value of 180 seconds

Sending CDPv2 advertisements is  enabled

R1#enable

R1#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#cdp ?

advertise-v2      CDP sends version-2 advertisements

holdtime          Specify the holdtime (in sec) to be sent in packets

log               Log messages generated by CDP

run               Enable CDP

source-interface  Insert the interface's IP in all CDP packets

timer             Specify rate (in sec) at which CDP packets are sent

R1(config)#cdp  timer

R1(config)#cdp  timer  10

R1(config)#cdp  hol

R1(config)#cdp  holdtime  100

R1(config)#do show cdp

Global CDP information:

Sending CDP packets every 10 seconds

Sending a holdtime value of 100 seconds

Sending CDPv2 advertisements is  enabled

R1(config)#

R1#show ip inter  brief

R1(config)#inter  fa0/0

R1(config-if)#no  shut


en

conf t

host R1

no cdp run              ##影響實驗

inter f0/0

ip add 13.1.1.1 255.255.255.0

no shut

inter s1/1

ip add 12.1.1.1 255.255.255.0

no shut

inter lo 0

ip add 1.1.1.1 255.255.255.0

end

conf t

router rip

net 1.0.0.0

net 12.0.0.0

net 13.0.0.0

en

conf t

host R2

no cdp run

inter s1/0

ip add 12.1.1.2 255.255.255.0

no shut

inter s1/1

ip add 23.1.1.2 255.255.255.0

no shut

inter lo 0

ip add 2.2.2.2 255.255.255.0

end

conf t

router rip

net 2.0.0.0

net 12.0.0.0

net 23.0.0.0

en

conf t

host R3

no cdp run

inter f0/0

ip add 13.1.1.3 255.255.255.0

no shut

inter s1/0

ip add 23.1.1.3 255.255.255.0

no shut

inter lo 0

ip add 3.3.3.3 255.255.255.0

end

conf t

router rip

net 3.0.0.0

net 13.0.0.0

net 23.0.0.0

R1>en

R1#debug  ip  icmp

R1#debug  ip  rip

R1#no  debug  ip  rip

R1#show   interface  f0/0  #看接口信息

R1#show  ip  interface  f0/0

split  horizon  is  enabled   #打開了水平分割

R1#conf t

R1(config)#router  rip

R1(config-router)#passive-interface   lo0  #關閉lo0口的更新發送,減小資源的浪費

R1(config)#no  ip  split-horizon   #關閉水平分割

R1#no  debug  ip  rip

R1#ping  23.1.1.2

R1#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#router  rip

R1(config-router)#timer  basic  40  240 0  320

R1(config-router)#no  ip  cef              ##關閉快速交換,啓用了進程交換,實現了負載均衡

R1#show ip   protocols

修改rip定時器的默認值

基本命令格式:失效定時器時間<刷新定時器時間

timers  basic  更新定時器時間  失效定時器時間   抑制定時器時間  刷新定時器時間

timer  basic  40  240  0  320

int  f0/0

ip  add  192.168.1.1  255.255.255.0

no  shut

int  s1/1

ip  unnumberd  f0/0  #IP地址的借用

no  shut

ip  route

ip  route   192.168.2.0  255.255.255.0  s1/1   ##s1/1爲本地路由器的接口

##############################################################

//實際項目工程中,多用這種方法

router rip

net 12.0.0.0

defaulet-information originate  //聲明R2是默認路由的起源,這樣R2就會向其餘RIP路由器,宣告本身是默認路由

exit

ip route 0.0.0.0 0.0.0.0 23.1.1.3   ##下一個路由器的接口IP

router rip

net 12.0.0.0

net 193.1.1.0

exit

ip route 193.1.2.0 255.255.255.0 21.1.1.2  130   ##浮動靜態路由,當專線down掉時候用這個靜態路由

###################################################################

en

conf t

host R1

int f0/0

ip add 192.168.1.1 255.255.255.0

no shut

int s1/1

ip unnumbered f0/0                  #借用f0/0的地址

no shut

exit

ip route 192.168.2.0 255.255.255.0 s1/1     ##s1/1是本路由器的接口,192.168.2.0是對端的ip地址

en

conf t

host R2

int f0/0

ip add 192.168.2.1 255.255.255.0

no shut

int s1/0

ip unnumbered f0/0

no shut

exit

ip route 192.168.1.0 255.255.255.0 s1/0

router rip

version 2

net 192.168.1.0

router rip

ver 2

net 12.0.0.0

net 192.168.1.0

no auto-summary   ##關閉自動彙總,路由器不通能夠用

R1上使用手工彙總

int s1/1

ip summary-address rip 192.168.1.0 255.255.255.192   ###rip的手動彙總

en

conf t

host R1

int s1/1

ip add 12.1.1.1 255.255.255.0

no shut

int lo0

ip add 192.168.1.1 255.255.255.0

router rip

ver 2

net 12.0.0.0

net 192.168.1.0

exit

key chain ccna

key 1

key-string cisco                                ###接口2端的密碼要同樣否則不通

int s1/1                                              ###

ip rip authentication mode md5

ip rip authentication key-chain ccna

###########################

router rip

ver 2

net 12.0.0.0

net 192.168.2.0

exit

key chain ccna

key 1

key-string cisco

int s1/0

ip rip authentication mode md5

ip rip authentication key-chain ccna

####################################################

把show   running-config的配置信息複製-粘貼到路由器裏

en

conf t

複製--粘貼show  running-config的配置

show  cdp  nei

ping  直連端口的IP再ping迴環地址和其餘IP看看是否會通

show ip  inter  brief 看接口IP和協議有沒有up起來

show   ip  pro看看協議正確嗎

R2(config)#router  rip

R2(config-router)#ver

R2(config-router)#version  2              ##改過來版本2

R2(config-router)#do show  ip  pro

###################

router eigrp 100

network 12.1.1.0 0.0.0.255

net 21.1.1.1 0.0.0.255

net 1.1.1.0 0.0.0.255

router eigrp 100

network 0.0.0.0

int s1/0

ip add 125.1.1.2 255.255.255.0 secondary

R1#show ip  protocols

Routing Protocol is "eigrp 100"

EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0    ###默認是k1=k3=1,  k2=k4=k5=0

EIGRP maximum hopcount 100

R1# conf t

R1(config)#router eigrp  100

R1(config-router)#metric  weights 0 1 0 0 0 0

R1(config-router)#metric  weights 0 1 0 1 0 0

R1#show  ip  eigrp  neighbors

eigrp排錯:鏈路接口的IP地址,AS號是否匹配,不能配置被動接口

show  inter  f0/0

show  ip  route

R1#show  ip  eigrp  topology  #eigrp的拓撲表

P 2.0.0.0/8, 1 successors, FD is 156160  ##

via 21.1.1.2 (##156160/128256), FastEthernet0/0

via 12.1.1.2 (2297856/128256), Serial1/1

R1#show  ip  eigrp  topology  all-links             #RD<FD

R1#show   ip  eigrp  topology

P 23.0.0.0/8, 1 successors, FD is 2172416

via 13.1.1.3 (2172416/2169856), FastEthernet0/0     2172416

via 12.1.1.2 (2681856/2169856), Serial1/1                2681856

R1#conf t

R1(config)#router  eigrp  100         ##100=AS號

R1(config-router)#variance  2         ###2=2681856/2172416

R1#show   ip  route   ##能夠看到有2條負載均衡的線路了

注意:eigrp次要路由要寫進路由表要知足2個條件

1.度量值<N*FD    2.RD<FD

N=2=2681856/2172416

###########################################################

eigrp的自動彙總

R2(config-if)#router eigrp 100

R2(config-router)#net 0.0.0.0

R2(config-router)#router  eigrp  100

R2(config-router)#passive-interface  default     ##把路由器2上的接口所有設置爲被動接口

R2(config-router)#no passive-interface  s1/0    ##這個不是迴環接口打開這個接口

eigrp手動彙總

R2#conf t

R2(config)#router  eigrp   100

R2(config-router)#no  auto-summary       ##關閉自動彙總

R2(config)#router  eigrp  100

R2(config-router)#exit

R2(config)#inter  s1/0

R2(config-if)#ip  summary-address  eigrp  100  2.2.0.0  255.255.254.0   ###手動彙總

eigrp的外部路由

router eigrp 100

redistribute connected

ip route 0.0.0.0 0.0.0.0 1.1.1.2    ###1.1.1.2是ISP的路由器地址公網的

router eigrp 100

redistribute static

####################################

eigrp的驗證

en

conf t

key chain test          #祕鑰的名字

key 1                       #1把鑰匙

key-string cisco      #祕鑰的密碼

int s1/1

ip authentication key-chain eigrp 100 test    #匹配key  chain  test密鑰

ip authentication mode eigrp 100 md5         #md5驗證祕鑰

#########################################

eigrp性能調整

R1(config-if)#do  show  ip  inter  brief      ###查看有哪些起來的接口

R1(config-if)#do show  inter  s1/1            ###查看具體的接口帶寬多少

R1#conf t

R1(config)#inter  s1/1

R1(config-if)#ip  bandwidth-percent  eigrp  100 5     ###調整使用帶寬的50%,100是AS號

#########################################

eigrp排錯思路

show  ip  pro   #路由協議,AS號,K值不匹配,物理層的鏈接

show ip   eigrp  nei

show  ip  inter  brief

conf t

inter s1/1

no  ip  add 23.1.1.3 255.255.255.0   #刪除接口IP地址

接口起來了就不須要no  shut接口了

##############################

show ip  inter  brief

conf t

router  ospf  1   #1隨便其餘路由器不同也能夠

network 12.1.1.0 0.0.0.255  area 0  #直鏈接口必須在同一個區域中

network 123.1.1.1  0.0.0.0  area 0

int  f0/0

ip add 123.1.1.2  255.255.255.0

no shut

router  ospf  1   #不須要切到配置conf t模式接口模式也能夠直接配置ospf協議

network  0.0.0.0 0.0.0.0  area 0  #全部接口都配置到ospf就0.0.0.0就能夠了

int  lo0

ip add 3.3.3.3 255.255.255.0  #環回口不須要no shut

router ospf 3

network 3.3.3.3  255.255.255.0  area 0  #255.255.255.0也能夠正着寫,不須要寫反掩碼

do  show  ip  inter brief    #看端口狀態和協議狀態

do  show ip  protocals      ##看運行的協議

#############################################

show ip  route

show ip  ospf/eigrp  nei

do show ip  ospf  inter f0/0

do show ip  ospf  database   #三臺路由器的數據鏈路表都是同樣的

##############################################

do  show  ip  protocols    ##看ospf 3

conf t

router ospf  3

router-id  5.5.5.5                 #修改router-id號

do clear ip ospf  process  #重啓ospf的進程

回答y

do show  ip pro

################################################

int f0/0

ip ospf  priority 0 #將其餘路由器的優先級設爲0,這樣子優先級爲0的路由器就不參與DR和BDR的選舉了

#################################################

show ip inter  f0/0 #看實際帶寬

ospf的默認默認參考帶寬是100MB/S

修改這個值:R1(config-router)#auto-cost reference-bandwidth  10000

哪麼計算公式也要改成:10000MB/S除以實際帶寬(取整,結果小於0時取1)

在同一個OSPF/area網絡中,修改了一臺路由器默認帶寬,其餘也要修改

###################################################

ospf的明文驗證

debug  ip  ospf  packet

no debug  ip  ospf  packet

aut:2 爲md5驗證

conf t

inter f0/0

ip ospf  authentication-key cisco   #明文驗證密碼是cisco

exit

router ospf 1

area 0 authentication   #0是明文驗證

exit

inter s1/1

ip ospf  authentication-key cisco  #在同一個area就不須要area 0 authentication

do  show ip  ospf nei

####################################################

ospf的MD5驗證

int  f0/0

no ip ospf authentication-k

ip ospf  message-digest-key  1 md5  cisco

int  s1/1

no ip ospf authentication-k

ip ospf  message-digest-key  1 md5  cisco

exit

router ospf 1

area 0 authentication   message-digest

#####################################################

ospf的默認路由

inter lo0

ip  add  1.1.1.1  255.255.255.0

exit

ip  route 0.0.0.0  0.0.0.0  lo0

router ospf 1

default-information  originate

do show ip  route    #能夠看到學到的默認路由

#######################################################

ospf排錯

en

erase  startup-config   #(回車)刪除路由器的預存配置

conf t

R1(config)#int l0

R1(config-if)#ip  add 10.10.0.1  255.255.252.0    #環回口ip配置錯誤

int  s1/0       #do  show ip  inter brief協議down看直連的下一個路由器的接口

no shut

R1

do  show ip  route

do  show  ip  pro

router  ospf 1

no  network 10.10.0.0  0.0.7.255  area 0

net 10.10.0.0  0.0.3.255  area 0

show  ip  ospf  nei

show  ip  ospf  nei

show  ip  route

default-information  originate  #宣告默認路由

default-information  originate  #宣告默認路由

do ping

10.10.4.1  #目的IP地址

擴展y

10.10.0.1  #源IP地址

R2

show ip  pro

router ospf 1

no passive-interface  s1/0

passive-interface  l0      #l0=loopback0修改環回口爲被動接口

show ip  pro

do show ip  route

do show ip  route

R3

show  ip  route

show  ip  ospf nei

第一步:連線,刪除路由器預存配置文件,重啓路由器

 

1.連線

根據圖中拓撲進行連線,可是咱們使用的是模擬機架,這個工做就省去了。

 

2.清除每臺路由器的配置

在實際環境中,每臺路由器可能已經有了配置文件了,須要咱們刪除已經有的配置文件,而後重啓路由。由於咱們用的模擬路由器也不存在這個問題。

 

實際環境中,刪除路由器配置方法

命令:erase startup-config

 

 

第二步:裝入路由器的預配置

 

第三步:排除物理層故障

1.根據拓撲圖,檢查路由器的連線是否正常。由於使用的是模擬機架,因此確定正常。

2.檢查線纜類型

 

第四步:排除數據鏈路層故障

1.檢查串行線路兩端封裝協議是否一致。目前爲止咱們沒有介紹過封裝協議,因此這個地方不會有錯,串行接口默認使用的是HDLC封裝。

2.參加CCNA考試的同窗要檢查packet tracer模擬器中時鐘的配置。現實環境中不須要。

 

第五步:排除網絡層接口的故障

檢查R1R2R3各個接口的IP地址,子網掩碼,端口狀態是否正常。各直鏈接口能夠相互ping

 

第六步:排除網絡層路由協議故障

經過查看路由表,鄰居表,和路由協議發現故障並排除

 

第七步:測試

 

第八步:保存配置記錄文檔

相關文章
相關標籤/搜索