首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >EIGRP路由问题

EIGRP路由问题
EN

Network Engineering用户
提问于 2018-08-16 06:13:48
回答 2查看 816关注 0票数 1

我对EIGRP有个问题。但是首先,下面是拓扑结构:

我做过EIGRP路由,但这有点奇怪。PC0 -> PC1可以ping,PC3 -> PC2可以ping。但是,我不能平PC0 -> PC2,PC0 -> PC3。这也发生在PC1上。以下是我所有的路由器配置:

-ROUTER0 0-

代码语言:javascript
复制
interface FastEthernet0/0
 ip address 10.10.0.1 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 10.10.3.1 255.255.255.252
!
interface FastEthernet0/1
 ip address 192.168.1.254 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 10
 network 10.0.0.0
 network 192.168.0.0
 network 192.168.1.0
 network 192.168.2.0
 network 192.168.3.0
 network 192.168.4.0
 auto-summary
!
ip classless
ip route 192.168.0.0 255.255.255.0 FastEthernet0/1 
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

-ROUTER1 1-

代码语言:javascript
复制
interface FastEthernet0/0
 ip address 10.10.0.2 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/0.30
 encapsulation dot1Q 30
 ip address 10.10.1.1 255.255.255.252
!
interface FastEthernet0/1
 ip address 192.168.2.254 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 10
 network 10.0.0.0
 network 192.168.0.0
 network 192.168.1.0
 network 192.168.2.0
 network 192.168.3.0
 network 192.168.4.0
 auto-summary
!
ip classless
ip route 192.168.0.0 255.255.255.0 FastEthernet0/1 
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

-ROUTER2 2-

代码语言:javascript
复制
interface FastEthernet0/0
 ip address 10.10.2.1 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/0.30
 encapsulation dot1Q 30
 ip address 10.10.1.2 255.255.255.252
!
interface FastEthernet0/1
 ip address 192.168.3.254 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 1
 auto-summary
!
router eigrp 10
 network 10.0.0.0
 network 192.168.0.0
 network 192.168.1.0
 network 192.168.2.0
 network 192.168.3.0
 network 192.168.4.0
 auto-summary
!
ip classless
ip route 192.168.0.0 255.255.255.0 FastEthernet0/1 
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

-ROUTER3 3-

代码语言:javascript
复制
interface FastEthernet0/0
 ip address 10.10.2.2 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 10.10.3.2 255.255.255.252
!
interface FastEthernet0/1
 ip address 192.168.4.254 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 10
 network 10.0.0.0
 network 192.168.0.0
 network 192.168.1.0
 network 192.168.2.0
 network 192.168.3.0
 network 192.168.4.0
 auto-summary
!
ip classless
ip route 192.168.0.0 255.255.255.0 FastEthernet0/1 
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

看来路线到了。但有人知道为什么会这样吗?谢谢。

EN

回答 2

Network Engineering用户

回答已采纳

发布于 2018-08-17 18:33:17

我已经创建了与图像显示的相同的拓扑结构,并将您的信任放入路由器,并且我能够从PC0中选择所有的PC。所有PC都有与路由器Fa0/1接口相同的/24网络中的IP地址,并且都将默认网关设置为路由器的IP (192.168.x.254)。

猫3560的配置:

代码语言:javascript
复制
interface FastEthernet0/1
 switchport trunk allowed vlan 1,20
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/2
 switchport trunk allowed vlan 1,30
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/3
 switchport trunk allowed vlan 1,30
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface FastEthernet0/4
 switchport trunk allowed vlan 1,20
 switchport trunk encapsulation dot1q
 switchport mode trunk
!

此外,我还在交换机上创建了VLAN:

代码语言:javascript
复制
Switch(config)# vlan 20
Switch(config)# vlan 30

平评结果:

代码语言:javascript
复制
C:\>ping 192.168.2.1

Pinging 192.168.2.1 with 32 bytes of data:

Request timed out.
Reply from 192.168.2.1: bytes=32 time<1ms TTL=126
Reply from 192.168.2.1: bytes=32 time<1ms TTL=126

Ping statistics for 192.168.2.1:
    Packets: Sent = 3, Received = 2, Lost = 1 (34% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.3.1

Pinging 192.168.3.1 with 32 bytes of data:

Request timed out.
Reply from 192.168.3.1: bytes=32 time<1ms TTL=125
Reply from 192.168.3.1: bytes=32 time<1ms TTL=125

Ping statistics for 192.168.3.1:
    Packets: Sent = 3, Received = 2, Lost = 1 (34% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Control-C
^C
C:\>ping 192.168.4.1

Pinging 192.168.4.1 with 32 bytes of data:

Request timed out.
Reply from 192.168.4.1: bytes=32 time<1ms TTL=126
Reply from 192.168.4.1: bytes=32 time=1ms TTL=126

Ping statistics for 192.168.4.1:
    Packets: Sent = 3, Received = 2, Lost = 1 (34% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

Control-C
^C
票数 2
EN

Network Engineering用户

发布于 2018-08-18 09:10:27

在再次查看网络图并考虑了OP获得的提示(“子接口”)之后,我想我现在看到了它的意义所在。

这一答案假定:

  • Cat3560将不参与路由。
  • Cat3560只是有一组VLANs,每个都可以模拟从一个路由器到另一个路由器的点点链路,几乎就像它们之间有一个直接的电缆一样。
  • 10.10.x.0/30子网用于这些点对点链接。

有一个替代的设置,也解决了挑战,但需要L3切换(可能是EIGRP,为了好玩)也运行在Cat3560上。我更喜欢这种选择,但挑战似乎是双重的:在Cat3560上使用VLAN进行L2交换,以及(动态)路由器上带有子接口的路由,因此我们将为此而努力。

这将需要交换机上的一些VLAN:

代码语言:javascript
复制
vlan 10
 name R0-to-R1

vlan 20
 name R0-to-R3

vlan 30
 name R3-to-R2

vlan 40
 name R2-to-R1

并将VLAN选择性地映射到路由器连接到的4个交换机端口:

代码语言:javascript
复制
int f0/1
 description Router0 fa0/0
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 spanning-tree portfast trunk

int f0/2
 description Router1 fa0/0
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport trunk allowed vlan 10,40
 spanning-tree portfast trunk

int f0/3
 description Router2 fa0/0
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport trunk allowed vlan 30,40
 spanning-tree portfast trunk

int f0/4
 description Router3 fa0/0
 switchport trunk encapsulation dot1q
 switchport mode trunk
 switchport trunk allowed vlan 20,30
 spanning-tree portfast trunk

请注意:从技术上讲,没有必要在交换机端口上设置switchport trunk allowed vlan...。创建VLAN并将端口设置为mode trunk就足够了。在维护良好的环境中,在给定的开关端口上定义哪个(一组) VLAN(s)是可接受的,这是很好的实践。

然后,在每个路由器上,你需要

  • 局域网接口192.168.x.0/24。我将为路由器选择.1。有些人更喜欢子网(.254)中的最后一个地址--这只是一个特定环境的品味、指导方针和操作实践的问题。
  • WAN端的两个子接口,由VLAN标记分隔
  • 一个不错的EIGRP设置,请参阅命令片段中的注释。

我将给出一个路由器的示例--其他路由器将留给读者作为练习。

代码语言:javascript
复制
!=========
!ROUTER 0
!========

int f0/0
 description Switch0 fast0/1

int f0/0.10
 description Router1 fast0/0.10 (via VLAN 10)
 enapsulation dot1q 10
 ip adress 10.10.0.1 255.255.255.252

int f0/0.20
 description Router3 fast0/0.20 (via VLAN 20)
 encapsulation dot1q 20
 ip adress 10.10.3.1 255.255.255.252

int fa0/1
 description LAN to PC0
 ip address 192.168.1.1 255.255.255.0


router eigrp 1
!
! Summarization is for large networks with multiple hierarchies and
! tiers of routing. 
! It just creates obstacles for a novice. Leave it off. (almost) always.
!
 no auto-summary 
!
! for the sake of clarity, add the to-be-EIGRP-activated 
! interfaces with the host wildcard mask. 
! in EIGRP, the network statements just define a filter list of IP adresses. 
! Interfaces on the router that have an address matching the 
! filter will be enanbled for EIGRP.
!   
 network 192.168.1.1 0.0.0.0
 network 10.10.0.1 0.0.0.0
 network 10.10.3.1 0.0.0.0
!
!
! good practice (optional): Don't be looking for EIGRP neighbors 
! in "client subnets", where there won't be any. 
! Make all interfaces passive, then explicitely enable 
! the (sub)interfaces that will actually have to speak EIGRP 
! to potential neighbors.
!
! YES, it is actually correct and valid to have the LAN 
! side enabled for EIGRP, but then leave it passive.

 passive-interface default
 no passive-interface fast0/0.10
 no passive-interface fast0/0.20
票数 2
EN
页面原文内容由Network Engineering提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://networkengineering.stackexchange.com/questions/52604

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档