Introduction
This document describes the distance OSPF external command and its significance locally to the device it is configured to with redistribution from other Interior Gateway Protocol (IGP) protocol into Open Shortest Path First (OSPF).
Prerequisites
Requirements
There are no specific requirements for this document.
Components Used
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Background Information
The purpose is to understand the significance of the distance OSPF external feature on the local router where it is configured.
Configure
Four routers R1, R2, R3, R4 are connected as shown in the diagram. Routers R1,R3 and R2,R4 have Enhanced Interior Gateway Routing Protocol (EIGRP) neighborship on the directly connected interfaces within the subnets 192.168.13.0/30 and 192.168.24.0/30. There is an OSPF neighborship between R3,R4 within the subnet 172.168.34.0/30, routers R1, R2, R3, R4 have a loopback with respect to their numbering, for example; R1-1.1.1.1/24 etc. as shown.
Network Diagram
Configurations
On R1:
router eigrp 1
network 1.1.1.0 0.0.0.255
network 192.168.13.0 0.0.0.3
no auto-summary
On R2:
router eigrp 2
network 2.2.2.0 0.0.0.255
network 192.168.24.0 0.0.0.3
no auto-summary
On R3:
router eigrp 1
network 192.168.13.0 0.0.0.3
distance eigrp 90 90
no auto-summary
!
router ospf 1
log-adjacency-changes
redistribute eigrp 1 subnets
network 172.16.34.0 0.0.0.3 area 0
distance ospf external 10
On R4:
router eigrp 2
network 192.168.24.0 0.0.0.3
distance eigrp 180 180
no auto-summary
!
router ospf 1
log-adjacency-changes
redistribute eigrp 2 subnets
network 172.16.34.0 0.0.0.3 area 0
Explanation
R1 is advertising its loopback 1.1.1.0/24 to R3, R3 installs this in the RIB as eigrp route with internal AD 90. The eigrp route learnt is redistributed into OSPF 1, as per the understanding this route in ospf database will be an external route which should have an AD of 10 as configured by the command “distance ospf external 10” under OSPF 1. Which is not the case, this route is local to the device and learnt via EIGRP 1. The routes received as E1/E2 will have and
AD of 10, the route local to R3 will have AD of 90.
The AD is changed for all the incoming routes on router R3 which are marked as external E1/E2 routes.
Verify
Use this section to confirm that your configuration works properly.
R3#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
D 1.1.1.0 [90/156160] via 192.168.13.1, 00:23:57, FastEthernet0/0
192.168.13.0/30 is subnetted, 1 subnets
C 192.168.13.0 is directly connected, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
O E2 2.2.2.0 [10/20] via 172.16.34.2, 00:47:05, FastEthernet0/1
The route for 1.1.1.0/24 is install in RIB of R3 as D(eigrp internal) route.
R3#sh ip ospf database external 1.1.1.0
OSPF Router with ID (3.3.3.3) (Process ID 1)
Type-5 AS External Link States
LS age: 1548
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 1.1.1.0 (External Network Number )
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x6928
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
The route 1.1.1.0/24 is present in the database of R3 as an external route, which should be having an AD 10 as expected and install this in RIB of R3 whereas the internal eigrp route with AD 90 is installed.
R4#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
O E2 1.1.1.0 [110/20] via 172.16.34.1, 00:27:55, FastEthernet0/1
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [180/156160] via 192.168.24.1, 03:05:39, FastEthernet0/0R4#
The route for 1.1.1.0/24 is learnt as an O E2 external route on R4 with AD 110
R4#sh ip ospf data ext 1.1.1.0
OSPF Router with ID (4.4.4.4) (Process ID 1)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 1745
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 1.1.1.0 (External Network Number )
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x6928
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0
The route received in the inbound direction on R3 as an O E2 route for the subnet 2.2.2.0/24 which is getting redistributed from R4 via EIGRP2 into OSPF1 is having an AD of 10 as seen in the first output.
O E2 2.2.2.0 [10/20] via 172.16.34.2, 00:47:05, FastEthernet0/1
Troubleshoot
There is currently no specific troubleshooting information available for this configuration.