我试图从路由器1192.168.4.1/30( 192.168.4.1 )平另一个路由器(路由器2192.168.4.5/30)。我甚至把最后一扇门放进了最后的通道,但没有成功。我的路由逻辑哪里出错了?
1号干线:
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
no ip cef
no ipv6 cef
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
ip address 192.168.4.5 255.255.255.252
duplex auto
speed auto
!
interface GigabitEthernet0/1
ip address 192.168.3.1 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 192.168.5.0 255.255.255.0 192.168.4.1
ip route 0.0.0.0 0.0.0.0 192.168.4.1
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end路由器2:
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
no ip cef
no ipv6 cef
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
ip address 192.168.4.1 255.255.255.252
duplex auto
speed auto
!
interface GigabitEthernet0/1
ip address 192.168.5.1 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end发布于 2017-02-19 22:54:03
问题是,您有两个不同的网络:192.168.4.0/30和192.168.4.4/30。要从一个网络到另一个网络,你需要通过路由器。路由器1不知道192.168.4.0/30网络在哪里。路由器2不知道192.168.4.4/30网络在哪里。
你需要在两个路由器之间建立一个共同的网络。这就是为什么您使用/30或31网络进行点对点链接。这两个网络大小中的每一个都有两个可用的地址,您可以在链路的每一端指定每个路由器一个地址。
路由器通过三种方式学习路由:
在路由器1上静态配置路由的缺陷是,路由器1不知道192.168.4.1在哪里,也不知道如何将流量发送给它。路由器2还需要知道如何返回路由器1网络。
发布于 2017-02-20 10:04:44
从配置。您可以检查下一跳ip地址4.1由于配置错误的子网ip地址而无法从路由器1到达,如果两个路由器是点到点连接的。第二,反向静态路由没有在路由器2配置。
发布于 2021-01-20 13:15:22
根据所提供的配置,它是直接连接的网络,不需要手动静态路由配置。当网络直接连接时,在layer3设备中自动创建路由。
此外,使用的子网掩码是255.255.255.252,只有两个使用ip地址192.168.4.1和192.168.4.2,ip地址。192.168.4.1和192.168.4.5不属于/30子网。使用/28子网建立连接。
https://networkengineering.stackexchange.com/questions/39075
复制相似问题