一、EIGRP基本配置实例
(1)网络拓扑
(2)配置过程及配置代码
R0
!Router>
en
!Router
conf t
!Router(config)
no ip domain-lookup
hostname R0
!配置端口
int g0/0
ip addr 192.168.1.2 255.255.255.252
no shut
exit
int s0/0/0
ip addr 192.168.2.2 255.255.255.252
no shut
exit
!配置EIGRP
route eigrp 323
network 192.168.1.0
network 192.168.2.0
no auto-summary
exit
R1
!Router>
en
!Router
conf t
!Router(config)
no ip domain-lookup
hostname R1
!配置端口
int g0/0
ip addr 192.168.1.1 255.255.255.252
no shut
exit
int g0/1
ip addr 192.168.3.1 255.255.255.252
no shut
exit
int g0/2
ip addr 10.0.1.254 255.255.255.0
no shut
exit
!配置EIGRP
route eigrp 323
network 192.168.1.0
network 192.168.3.0
network 10.0.1.0
no auto-summary
exit
R2
!Router>
en
!Router
conf t
!Router(config)
no ip domain-lookup
hostname R2
!配置端口
int g0/1
ip addr 192.168.3.2 255.255.255.252
no shut
exit
int s0/0/1
ip addr 192.168.4.1 255.255.255.252
no shut
exit
!配置EIGRP
route eigrp 323
network 192.168.3.0
network 192.168.4.0
no auto-summary
exit
R3
!Router>
en
!Router
conf t
!Router(config)
no ip domain-lookup
hostname R3
!配置端口
int s0/0/0
ip addr 192.168.2.1 255.255.255.252
no shut
exit
int s0/0/1
ip addr 192.168.4.2 255.255.255.252
no shut
exit
int g0/2
ip addr 10.0.2.254 255.255.255.0
no shut
exit
!配置EIGRP
route eigrp 323
network 192.168.2.0
network 192.168.4.0
network 10.0.2.0
no auto-summary
exit
(3)配置结果验证及查看
R0
show ip eigrp neighbors
show ip eigrp topology
show ip route
R1
show ip eigrp neighbors
show ip eigrp topology
show ip route
R2
show ip eigrp neighbors
show ip eigrp topology
show ip route
R3
show ip eigrp neighbors
show ip eigrp topology
show ip route
(4)连通性测试
PC1->PC2
二、小型园区网 EIGRP 的配置
(1)网络拓扑
(2)配置过程及过程
R1(DTE)
!Router>
en
!Router
conf t
!Router(config)
no ip domain-lookup
hostname R1
!配置端口
int s0/0/0
encapsulation ppp
ip addr 200.200.12.1 255.255.255.0
ip nat outside
no shut
exit
int g0/1
ip addr 192.168.12.1 255.255.255.0
ip nat inside
no shut
exit
int g0/2
ip addr 192.168.13.1 255.255.255.0
ip nat inside
no shut
exit
!配置默认路由
ip route 0.0.0.0 0.0.0.0 200.200.12.2
!配置 EIGRP
router eigrp 103
redistribute static
network 192.168.12.0
network 192.168.13.0
no auto-summary
exit
!配置 NAT
access-list 1 permit 192.168.0.0 0.0.255.255
ip nat pool pool1 200.200.12.10 200.200.12.15 netmask 255.255.255.0
ip nat inside source list 1 pool pool1
R2(DCE)
!Router>
en
!Router
conf t
!Router(config)
no ip domain-lookup
hostname R2
!配置端口
int s0/0/0
clock rate 2000000
encapsulation ppp
ip addr 200.200.12.2 255.255.255.0
no shut
exit
int loopback 0
ip addr 10.1.1.1 255.255.255.0
no shut
exit
SW1
!Switch>
en
!Switch
conf t
!Switch(config)
no ip domain-lookup
hostname SW1
!配置 VLAN
vlan 2
exit
vlan 3
exit
vlan 6
exit
!配置 VLAN IP
int vlan 2
ip addr 192.168.2.254 255.255.255.0
exit
int vlan 3
ip addr 192.168.3.254 255.255.255.0
exit
int vlan 6
ip addr 192.168.12.2 255.255.255.0
exit
!开启三层路由功能
ip routing
!配置三层路由聚合链路
int range f0/23-24
no switchport
channel-group 1 mode desirable
no ip addr
exit
int port-channel 1
ip addr 192.168.23.1 255.255.255.0
no shut
exit
!配置端口
int f0/1
switchport mode access
switchport access vlan 6
no shut
exit
int f0/2
switchport mode access
switchport access vlan 2
no shut
exit
int f0/3
switchport mode access
switchport access vlan 3
no shut
exit
!配置 EIGRP
router eigrp 103
network 192.168.2.0
network 192.168.3.0
network 192.168.12.0
network 192.168.23.0
no auto-summary
exit
SW2
!Switch>
en
!Switch
conf t
!Switch(config)
no ip domain-lookup
hostname SW2
!配置 VLAN
vlan 4
exit
vlan 5
exit
vlan 7
exit
!配置 VLAN IP
int vlan 4
ip addr 192.168.4.254 255.255.255.0
exit
int vlan 5
ip addr 192.168.5.254 255.255.255.0
exit
int vlan 7
ip addr 192.168.13.2 255.255.255.0
exit
!开启三层路由功能
ip routing
!配置三层路由聚合链路
int range f0/23-24
no switchport
channel-group 1 mode desirable
no ip addr
exit
int port-channel 1
ip addr 192.168.23.2 255.255.255.0
no shut
exit
!配置端口
int f0/2
switchport mode access
switchport access vlan 7
no shut
exit
int f0/4
switchport mode access
switchport access vlan 4
no shut
exit
int f0/5
switchport mode access
switchport access vlan 5
no shut
exit
!配置 EIGRP
router eigrp 103
network 192.168.4.0
network 192.168.5.0
network 192.168.13.0
network 192.168.23.0
no auto-summary
exit
(3)配置结果验证及查看
R1
show ip eigrp neighbors
show ip eigrp topology
show running-config
show ip route
R2
show ip route
SW1
show ip int br
show running-config
show ip route
SW2
show ip int br
show running-config
show ip route
(4)连通性测试
内网
PC2->PC3
PC2->PC4
PC2->PC5
外网
PC2->Loopback0
三、总结与体会
(1)、EIGRP 和 RIP、OSPF 路由协议的关系?
答:
三种路由协议均属于内部网关协议。
三种类型的动态路由协议分别采用不同的算法,RIP采用的算法是距离矢量算法、OSPF采用的算法是链路状态算法(SPF)、EIGRP所采用的算法是平衡混合算法。
RIP路由协议:内部网关协议,基于UDP协议,端口号为520。
OSPF路由协议:内部网关协议,基于TCP/IP协议,端口号为89,区域概念有:主干区、标准区、存根区、完全存根区(Cisco概念)、不完全存根区、完全不完全存根区(Cisco概念)。
EIGRP路由协议:增强内部网关路由协议,结合了链路状态和距离矢量型路由选择协议的优点,基于TCP/IP协议,端口号为88。
(2)、如果有多条通过目的网络的路径,EIGRP 路由表中最后保留几个通往此目的网络的下一跳及路由条目?
答:
当有多条通过目的网络的路径时,会进行可行性条件(FC)判断:通告距离(AD)< 可行距离(FD),在满足可行性条件(FC)的网络路径中,选取通告距离(AD)最短的两条路径,第一条作为下一跳的路径,即后继(Successor),第二条作为可行后继(Feasible Successor),即备用路径,如果有通告距离(AD)相同的路径,则一起选为后续(Successor)作为等价负载均衡,所以EIGRP路由表中最后保留二个通往此目的网络的下一跳,即后继(Successor)和可行后继(Feasible Successor),其中后继(Successor)会写入路由表中,而可行后继则会作为备用路由写入拓扑表中。
(3)、在非 Cisco 品牌的路由设备中能配置 EIGRP 协议吗?
答:
EIGRP是Cisco公司的私有协议(2013年已经公有化)。
(4)、对比一下 EIGRP 比 RIP 和 OSPF 更灵活和更合理的地方。
答:
EIGRP路由协议结合了链路状态和距离矢量型路由选择协议的优点。
|