Introduction
This document describes how to set forward address in OSPF redistributed default route to a non-zero value.
Background Information
By default, NXOS sets Quad 0 ( 0.0.0.0) forward address in OSPF redistributed default route. If you want to set this address as non-zero then you need to have some additional configuration.
Default-information originate command is mandatory to redistribute default route into OSPF from another protocol. This command, by default, does not set the forwarding address in the new type 5 Link State Advertisement(LSA) generated. To set forwarding address in the type 5 LSA (ID: 0.0.0.0, Network Mask: /0) you can use a route-map that sets the option for forwarding address.
This behavior is different than Cisco IOS® base devices.
Requirements
Cisco recommends that you have knowledge of these topics:
- Basic knowledge of NXOS and IP Routing.
- Understanding of general IP routing
- OSPF routing protocol concepts and terms
- Understanding of OSPF configuration on NXOS
Components Used
Information in this document is based on N9K-C93180YC-EX, NXOS® 9.3(2)
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, ensure that you understand the potential impact of any command.
Configure
Network Diagram
Configurations
For this configuration Example:
- N9K1 distributes default route into BGP.
- N9K2 learns this default route from N9K1 via eBGP and redistributes into OSPF.
- N9K3 learns this default route from N9K2 via OSPF.
When N9K2 and N9K3 learn this default route, by default, forward address sets to 0.0.0.0 for the Type-5 LSA. To change this default behavior, you can use set forwarding-address option in route-map and attach that route-map to default-information originate command while you redistribute this default route into OSPF.
To configure set forwarding-address option, do these steps:
Step 1. Configure IP prefix-list test to match default route
N9K2# configure terminal
N9K2(config)# ip prefix-list test seq 5 permit 0.0.0.0/0
N9K2(config)#
Step 2. Configure route-map test and match the ip-prefix list test
N9K2# configure terminal
N9K2(config)# route-map test permit 10
N9K2(config-route-map)# match ip address prefix-list test
N9K2(config-route-map)#
Step 3. Configure route-map fwd-addr-fix to set forwarding-address
N9K2# configure terminal
N9K2(config)# route-map fwd-addr-fix permit 10
N9K2(config-route-map)# set forwarding-address
N9K2(config-route-map)#
Step 4. Redistribute default route from BGP into OSPF and apply default-information originate command with route-map fwd-addr-fix
N9K2# configure terminal
N9K2(config)#router ospf 1
N9K2(config-router)# default-information originate route-map fwd-addr-fix
N9K2(config-router)# redistribute static route-map test
N9K2(config-router)#
Verify
Verify on N9K2 and N9K3 if forward-address is set to ip 10.10.10.1. Use command show ip ospf database external 0.0.0.0 detail
N9K2# show ip ospf database external 0.0.0.0 det
OSPF Router with ID (10.10.10.5) (Process ID 1 VRF default)
Type-5 AS External Link States
LS age: 400
Options: 0x2 (No TOS-capability, No DC)
LS Type: Type-5 AS-External
Link State ID: 0.0.0.0 (Network address)
Advertising Router: 10.10.10.5
LS Seq Number: 0x80000006
Checksum: 0x4b3f
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 10.10.10.1
External Route Tag: 0
N9K2#
N9K3# show ip ospf database external 0.0.0.0 det
OSPF Router with ID (10.10.10.6) (Process ID 1 VRF default)
Type-5 AS External Link States
LS age: 501
Options: 0x2 (No TOS-capability, No DC)
LS Type: Type-5 AS-External
Link State ID: 0.0.0.0 (Network address)
Advertising Router: 10.10.10.5
LS Seq Number: 0x80000006
Checksum: 0x4b3f
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 10.10.10.1
External Route Tag: 0
N9K3#