PacketLab
OSPF · External routing and special areas

Redistribution

Import only the intended external prefix and verify that another static stays private.

Understand

Redistribution imports reachability from another routing source. The importing router becomes an ASBR and originates external LSAs in a normal area. Native OSPF interface activation is preferable for internal connected networks; do not redistribute everything connected just to enable OSPF.

Define the ownership boundary first: permitted prefixes, source protocols, metric type, seed metric and loop-prevention policy. Use an allowlist with implicit deny and retain subnets in this command syntax. Multiple mutual redistribution points can feed routes back into their source domain. Tags help only when an explicit policy matches and rejects them.

A source route must be eligible in the local routing table. Redistributing a static Null0 route advertises reachability while discarding packets at the ASBR; it is a deliberate control-plane test here, not a real service exit.

Lab setup

Use a fresh lab for this lesson; changes from other lessons are not cumulative. All outputs are illustrative excerpts, not recorded router tests. Transit cost is explicitly 10 and Loopback0 cost is 1. Interface names may vary by image.

Lab topologyIllustrative topology
192.0.2.0/30area 0192.0.2.4/30area 1R1Lo0 · 10.255.0.1/32R2Lo0 · 10.255.0.2/32R3Lo0 · 10.255.0.3/32
Solid lines are physical links, configured as point-to-point. Interfaces and areas are listed below. Router symbol: GNS3, GPL-2.0. Original layout.
RouterInterfaceIPv4 addressArea
R1Gi1192.0.2.1/300
R2Gi1192.0.2.2/300
R2Gi2192.0.2.5/301
R3Gi1192.0.2.6/301

Loopback0 is 10.255.0.<router number>/32; area assignments: R1: area 0, R2: area 0, R3: area 1.

Complete baseline configurations

R1

Configuration
configure terminal
hostname R1
router ospf 1
 router-id 10.255.0.1
 passive-interface Loopback0
 exit
interface Loopback0
 ip address 10.255.0.1 255.255.255.255
 ip ospf 1 area 0
 ip ospf cost 1
 exit
interface GigabitEthernet1
 ip address 192.0.2.1 255.255.255.252
 ip ospf network point-to-point
 ip ospf cost 10
 ip ospf 1 area 0
 no shutdown
 exit
end

R2

Configuration
configure terminal
hostname R2
router ospf 1
 router-id 10.255.0.2
 passive-interface Loopback0
 exit
interface Loopback0
 ip address 10.255.0.2 255.255.255.255
 ip ospf 1 area 0
 ip ospf cost 1
 exit
interface GigabitEthernet1
 ip address 192.0.2.2 255.255.255.252
 ip ospf network point-to-point
 ip ospf cost 10
 ip ospf 1 area 0
 no shutdown
 exit
interface GigabitEthernet2
 ip address 192.0.2.5 255.255.255.252
 ip ospf network point-to-point
 ip ospf cost 10
 ip ospf 1 area 1
 no shutdown
 exit
end

R3

Configuration
configure terminal
hostname R3
router ospf 1
 router-id 10.255.0.3
 passive-interface Loopback0
 exit
interface Loopback0
 ip address 10.255.0.3 255.255.255.255
 ip ospf 1 area 1
 ip ospf cost 1
 exit
interface GigabitEthernet1
 ip address 192.0.2.6 255.255.255.252
 ip ospf network point-to-point
 ip ospf cost 10
 ip ospf 1 area 1
 no shutdown
 exit
end

Apply

Use the border baseline with all areas normal. R1 owns the import. Add two discard statics but allow only 198.51.100.0/24; 203.0.113.0/24 is the negative test.

R1

Configuration
configure terminal
ip route 198.51.100.0 255.255.255.0 Null0
ip route 203.0.113.0 255.255.255.0 Null0
ip prefix-list OSPF-IMPORT seq 5 permit 198.51.100.0/24
route-map STATIC-IN permit 10
 match ip address prefix-list OSPF-IMPORT
 set tag 100
 exit
router ospf 1
 redistribute static subnets metric 20 metric-type 1 route-map STATIC-IN
end

Verify and interpret

Illustrative output · excerpt
R3# show ip route ospf | include 198.51.
O E1 198.51.100.0/24 [110/40] via 192.0.2.5, GigabitEthernet1
R3# show ip route 203.0.113.0
% Network not in table
R3# show ip ospf database external 198.51.100.0
  Advertising Router: 10.255.0.1
  Network Mask: /24
  Metric Type: 1
  Metric: 20
  Forward Address: 0.0.0.0
  External Route Tag: 100

The permitted E1 metric is 20 internal + 20 external = 40. The second static is deliberately excluded. With forwarding address zero, the path resolves toward the ASBR.

Remove the permitted source static, then confirm the LSA and route withdraw after convergence. Restore it and verify the permitted route returns. Do not widen the allowlist to fix an unrelated adjacency failure.

R1 · withdraw then restore in separate steps

Configuration
configure terminal
no ip route 198.51.100.0 255.255.255.0 Null0
end

R1 · restore

Configuration
configure terminal
ip route 198.51.100.0 255.255.255.0 Null0
end

Technical references

OSPFv2 standard · Router configuration guide · Redistribution guidance

Key Takeaways

  • Redistribution creates external reachability at an ASBR.
  • Prefer native activation for internal connected prefixes.
  • Allowlist source prefixes and set metric policy explicitly.
  • Verify denied routes as well as permitted routes.
  • Tags prevent feedback only when a policy enforces them.

Redistribution Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. What role does R1 gain?
2. Which static is permitted?
3. Why include subnets?
4. What is R3’s E1 metric?
5. What does a tag do by itself?
6. Removing the allowed static should cause what?