N
N
Nik2019-07-03 09:48:28
Cisco
Nik, 2019-07-03 09:48:28

How to configure Default Route forwarding on OSPF?

I'm testing the topology on GNS3 before entering the product.
In general, the task is to get 0.0.0.0 to the kernel via ospf, as I understand how to do (default-route originate). I didn’t understand how to do it so that when the provider’s link fails, I don’t announce the default route? So that on the core the default route changes from 253 to 252 or vice versa.
R1 - Sobsna core
R3 R4 edge in the office connected to different provo.
R4 R5 remote sites.
ISP ISP2 provider emulation. But it is not important.
The important thing is that all routers are connected by tunnels, the tunnels in the example are raised on normal interfaces for simplicity.
5d1c4d33208b2019529035.png

config
R1=============================
interface FastEthernet0/0
ip address 10.0.0.254 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
router-id 172.16.254.254
log-adjacency-changes
network 10.0.0.0 0.0.0.255 area 0
!
no ip classless
R1#sh ip route
......
Gateway of last resort is 10.0.0.253 to network 0.0.0.0 <<<<<<<< Дефолт от 253
172.16.0.0/30 is subnetted, 4 subnets
O 172.16.0.4 [110/11] via 10.0.0.253, 00:03:19, FastEthernet0/0
O 172.16.1.4 [110/11] via 10.0.0.252, 00:03:19, FastEthernet0/0
O 172.16.0.0 [110/20] via 10.0.0.253, 00:03:19, FastEthernet0/0
O 172.16.1.0 [110/20] via 10.0.0.252, 00:03:19, FastEthernet0/0
10.0.0.0/24 is subnetted, 2 subnets
C 10.0.0.0 is directly connected, FastEthernet0/0
O 10.0.4.0 [110/30] via 10.0.0.253, 00:03:19, FastEthernet0/0
[110/30] via 10.0.0.252, 00:03:21, FastEthernet0/0
O*E2 0.0.0.0/0 [110/1] via 10.0.0.253, 00:03:21, FastEthernet0/0 <<<<<< Дефолт от 253
[110/1] via 10.0.0.252, 00:03:21, FastEthernet0/0 <<<<<< Дефолт от 252
R1#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.16.254.2 1 FULL/DROTHER 00:00:31 10.0.0.252 FastEthernet0/0
172.16.254.3 1 FULL/BDR 00:00:37 10.0.0.253 FastEthernet0/0
R1#
R1=============================
R3=============================
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.0.0.253 255.255.255.0
!
interface FastEthernet0/0.100
encapsulation dot1Q 100
ip address 100.0.0.2 255.255.255.0
!
interface FastEthernet0/1
ip address 172.16.0.1 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 172.16.0.5 255.255.255.252
duplex auto
speed auto
!
router ospf 2
log-adjacency-changes
!
router ospf 1
router-id 172.16.254.3
log-adjacency-changes
network 10.0.0.0 0.0.0.255 area 0
network 172.16.0.0 0.0.255.255 area 0
default-information originate always
!
ip route 0.0.0.0 0.0.0.0 100.0.0.1
R3#sh ip ro
....
Gateway of last resort is 100.0.0.1 to network 0.0.0.0
100.0.0.0/24 is subnetted, 1 subnets
C 100.0.0.0 is directly connected, FastEthernet0/0.100
172.16.0.0/30 is subnetted, 3 subnets
C 172.16.0.4 is directly connected, FastEthernet1/0
C 172.16.0.0 is directly connected, FastEthernet0/1
O 172.16.1.0 [110/11] via 172.16.0.2, 00:49:52, FastEthernet0/1
10.0.0.0/24 is subnetted, 2 subnets
C 10.0.0.0 is directly connected, FastEthernet0/0.10
O 10.0.4.0 [110/20] via 172.16.0.2, 00:49:52, FastEthernet0/1
S* 0.0.0.0/0 [1/0] via 100.0.0.1
R3#sh ip osp nei
Neighbor ID Pri State Dead Time Address Interface
172.16.254.2 1 FULL/DROTHER 00:00:36 10.0.0.252 FastEthernet0/0.10
172.16.254.254 1 FULL/DR 00:00:38 10.0.0.254 FastEthernet0/0.10
172.16.254.4 1 FULL/DR 00:00:38 172.16.0.2 FastEthernet0/1
R3#
R3=============================
R2=============================
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.0.0.252 255.255.255.0
!
interface FastEthernet0/0.100
encapsulation dot1Q 100
ip address 100.0.1.2 255.255.255.0
!
interface FastEthernet0/1
ip address 172.16.1.1 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 172.16.1.5 255.255.255.252
duplex auto
speed auto
!
router ospf 1
router-id 172.16.254.2
log-adjacency-changes
network 10.0.0.0 0.0.0.255 area 0
network 172.16.0.0 0.0.255.255 area 0
default-information originate always
!
ip route 0.0.0.0 0.0.0.0 100.0.1.1
R2#sh ip route
.....
Gateway of last resort is 100.0.1.1 to network 0.0.0.0
100.0.0.0/24 is subnetted, 1 subnets
C 100.0.1.0 is directly connected, FastEthernet0/0.100
172.16.0.0/30 is subnetted, 4 subnets
O 172.16.0.4 [110/11] via 10.0.0.253, 00:00:54, FastEthernet0/0.10
C 172.16.1.4 is directly connected, FastEthernet1/0
O 172.16.0.0 [110/20] via 172.16.1.2, 00:00:54, FastEthernet0/1
[110/20] via 10.0.0.253, 00:00:54, FastEthernet0/0.10
C 172.16.1.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 2 subnets
C 10.0.0.0 is directly connected, FastEthernet0/0.10
O 10.0.4.0 [110/20] via 172.16.1.2, 00:00:56, FastEthernet0/1
S* 0.0.0.0/0 [1/0] via 100.0.1.1
R2#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.16.254.4 1 FULL/DR 00:00:34 172.16.1.2 FastEthernet0/1
172.16.254.3 1 FULL/BDR 00:00:34 10.0.0.253 FastEthernet0/0.10
172.16.254.254 1 FULL/DR 00:00:36 10.0.0.254 FastEthernet0/0.10
R2#
R2=============================
R4=============================
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.0.4.1 255.255.255.0
!
interface FastEthernet0/0.100
encapsulation dot1Q 100
ip address 100.1.0.2 255.255.255.0
!
interface FastEthernet0/1
ip address 172.16.0.2 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 172.16.1.2 255.255.255.252
duplex auto
speed auto
!
router ospf 2
log-adjacency-changes
!
router ospf 1
router-id 172.16.254.4
log-adjacency-changes
network 10.0.4.0 0.0.0.255 area 0
network 172.16.0.0 0.0.255.255 area 0
!
ip route 0.0.0.0 0.0.0.0 100.1.0.1
R4#sh ip route
.....
Gateway of last resort is 100.1.0.1 to network 0.0.0.0
100.0.0.0/24 is subnetted, 1 subnets
C 100.1.0.0 is directly connected, FastEthernet0/0.100
172.16.0.0/30 is subnetted, 4 subnets
O 172.16.0.4 [110/11] via 172.16.0.1, 00:02:42, FastEthernet0/1
O 172.16.1.4 [110/2] via 172.16.1.1, 00:02:42, FastEthernet1/0
C 172.16.0.0 is directly connected, FastEthernet0/1
C 172.16.1.0 is directly connected, FastEthernet1/0
10.0.0.0/24 is subnetted, 2 subnets
O 10.0.0.0 [110/11] via 172.16.1.1, 00:02:42, FastEthernet1/0
C 10.0.4.0 is directly connected, FastEthernet0/0.10
S* 0.0.0.0/0 [1/0] via 100.1.0.1
R4#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.16.254.2 1 FULL/BDR 00:00:32 172.16.1.1 FastEthernet1/0
172.16.254.3 1 FULL/BDR 00:00:34 172.16.0.1 FastEthernet0/1
R4#
R4=============================

PS: Some networkers say do ospf, do others on bgp. And what to choose? And how to set it all up. Others say between the core and the border guards do bgp, and between remote points and border guards do ospf.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
BjLomax, 2019-07-03
@BjLomax

1) Replace "default-information originate always" with "default-information originate"
2) this command should be only on edge routers (R2 R3) 3) Make a static default on these routers
via ip sla + track
OSPF only if they have it

S
Strabbo, 2019-07-03
@Strabbo

You can remove the default-route originate and configure redistribution in ospf. If there is a default route, then it will appear in the ospf, and if it disappears from the routing table, then it will not get into the ospf.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question