要求:R2只配置一条DLCI到R1,R3只配置一条DLCI到R1
基本配置
R1
interface Loopback0
ip address 1.1.1.1 255.255.255.0
ip ospf network point-to-point
interface Serial1/0
ip address 123.1.1.1 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
no arp frame-relay
frame-relay map ip 123.1.1.3 103 broadcast
frame-relay map ip 123.1.1.2 102 broadcast
no frame-relay inverse-arp
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 123.1.1.0 0.0.0.255 area 0
neighbor 123.1.1.2 NBMA下需要手动指定邻居
neighbor 123.1.1.3
R2
interface Loopback0
ip address 2.2.2.2 255.255.255.0
ip ospf network point-to-point
interface Serial1/0
ip address 123.1.1.2 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
no arp frame-relay
frame-relay map ip 123.1.1.1 201 broadcast
no frame-relay inverse-arp
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 123.1.1.0 0.0.0.255 area 0
R3
interface Loopback0
ip address 3.3.3.3 255.255.255.0
ip ospf network point-to-point
interface Serial1/0
ip address 123.1.1.3 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
no arp frame-relay
frame-relay map ip 123.1.1.1 301 broadcast
no frame-relay inverse-arp
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.0 0.0.0.255 area 0
network 123.1.1.0 0.0.0.255 area 0
讨论这样的配置出现的情况
1 DR问题
此时R1作为HUB,必须要为DR,因为,邻居关系中R2只和R1做邻接,R3只和R1邻接,所以R2和R3之间没有邻接关系,如果R1不是DR,那么R2和R3就没有办法学习到对方的路由。
所以为了确保R1一直是DR,可以配置R2R3的接口优先级为0
R2(config-if)#ip ospf priority 0
R2(config-if)#ip ospf priority 0
2 R2R3通信问题
可以看到所有路由都学习到了,但是R2R3却无法ping通,可以看到R2去往R3 3.3.3.3的路由下一跳是123.1.1.3,这个地址在二层帧中继DLCI中没有配置,所以二层不知道如何封装,所以没有办法传递出去。R3去往2.2.2.2也是同理。
附:R1上发布默认路由是没有用的,因为有精确路由存在
解决办法:
方法1 R3上加一条DLCI frame map ip 123.1.1.2 301 b, 指向R2的地址和去R1的DLCI
R2上加一条DLCI frame map ip 123.1.1.3 201 b, 指向R3的地址和去R1的DLCI
配置完成后,全网互通。
方法2
a R2R3改成PTP, R1接口改成PTM (PTP不行),还需要更改hello时间此时R2R3使用环回口可以ping通,但是直接接口依旧不通,包可以到,但是对方主接口没有DLCI号,所以没有办法封装(帧中继的封装是更具发送包的目的地址来封装) 配置之前默认的网络类型是NBMA,所以R1收到ping包默认其他路由器也可以收到,所以不转发。现在改成点到多点,R1就会转发。
R1(config-if)#int s1/0
R1(config-if)#ip ospf network point-to-multipoint
R1(config-if)#ip ospf hello-interval 10 PTP和broadcast默认都是10s
R2(config-if)#ip ospf network point-to-point
R3(config-if)#ip ospf network point-to-point
R2#ping 3.3.3.3 source 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!
*Mar 1 01:10:58.195: %SYS-5-CONFIG_I: Configured from console by console!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/52/80 ms
R2#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
b把R2R3接口类型改成PTM,这是所有的都可以ping通,路由表发生改变,多了32位的主机路由.
R2(config-if)#ip ospf network point-to-multipoint
R2(config-if)#ip ospf network point-to-multipoint
R1(config-if)#no ip ospf hello-interval 10 并且恢复R1上的hello间隔
配置完成之后可以发现,在点到多点的环境里,每张路由表度增加了2条明细路由,这是点到多点的特性
之后就可以全网ping通