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从新获取网卡参数,
选择名为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模拟器中时钟的配置。现实环境中不须要。
第五步:排除网络层接口的故障
检查R1,R2,R3各个接口的IP地址,子网掩码,端口状态是否正常。各直链接口能够相互ping痛
第六步:排除网络层路由协议故障
经过查看路由表,邻居表,和路由协议发现故障并排除
第七步:测试
第八步:保存配置记录文档