ospf route

Answered Question
Aug 4th, 2008

Hi Experts,

I need help in my ospf config.

RouterA-FE0<--->FE0-RouterB-FE1<--->FE0-RouterC-FE1

RouterA

!

interface fastethernet0

ip address 192.168.0.1 255.255.255.252

!

router ospf 1

log-adjacency-changes

network 192.168.0.0 0.0.0.3 area 1

RouterB

!

interface fastethernet0

ip address 192.168.0.2 255.255.255.252

ip nat outside

!

interface fastethernet1

ip address 192.168.0.5 255.255.255.252

ip nat inside

!

router ospf 1

log-adjacency-changes

network 192.168.0.0 0.0.0.3 area 1

network 192.168.0.4 0.0.0.3 area 1

!

ip nat inside source static 192.168.1.1 172.16.1.1

ip nat inside source static 192.168.1.2 172.16.1.2

ip nat inside source static 192.168.1.3 172.16.1.3

RouterC

!

interface fastethernet0

ip address 192.168.0.6 255.255.255.252

!

interface fastethernet1

ip address 192.168.1.1 255.255.255.0

!

router ospf 1

log-adjacency-changes

network 192.168.0.4 0.0.0.3 area 1

network 192.168.1.0 0.0.0.255 area 1

RouterA suppose to have...

ip route 172.16.1.2 255.255.255.255 192.168.0.2

ip route 172.16.1.3 255.255.255.255 192.168.0.2

ip route 172.16.1.4 255.255.255.255 192.168.0.2

However, RouterA doesn't want to put the static route. How can I make RouterA see 172.16.1.2, 172.16.1.3, and 172.16.1.4 route with a default gateway of 192.168.0.2?

Should I add this in RouterB config?

!

interface null0

!

router ospf 1

redistribute static subnets

!

ip route 172.16.1.2 255.255.255.255 null0

ip route 172.16.1.3 255.255.255.255 null0

ip route 172.16.1.4 255.255.255.255 null0

GT

Correct Answer by vaisharm about 8 years 6 months ago

NAT is going to work as well. If any one from RouterA tries to reach any of the three 172.16.1.0 IPs:

RouterB#sh ip nat trans

Pro Inside global Inside local Outside local Outside global

--- 172.16.1.1 192.168.1.1 --- ---

icmp 172.16.1.2:11 192.168.1.2:11 192.168.0.1:11 192.168.0.1:11

--- 172.16.1.2 192.168.1.2 --- ---

icmp 172.16.1.3:12 192.168.1.3:12 192.168.0.1:12 192.168.0.1:12

icmp 172.16.1.3:13 192.168.1.3:13 192.168.0.1:13 192.168.0.1:13

--- 172.16.1.3 192.168.1.3 --- ---

However, I have one doubt. You have static routes pointing to null0 for

172.16.1.2

172.16.1.3

172.16.1.4

But the static NAT statements are for

172.16.1.1

172.16.1.2

172.16.1.3

Was 172.16.1.1 included by mistake? Should it be 172.16.1.4 ?

If this was a typo, you may include the correct network and it would work just as you thought.

HTH,

~Vaibhav

Correct Answer by vaisharm about 8 years 6 months ago

Hi Gilbert,

Yes, the routes would be installed in router A as below:

O E2 172.16.1.4 [110/20] via 192.168.0.2, 00:03:19, FastEthernet0/0

O E2 172.16.1.3 [110/20] via 192.168.0.2, 00:03:19, FastEthernet0/0

O E2 172.16.1.2 [110/20] via 192.168.0.2, 00:03:19, FastEthernet0/0

I haven't checked the NAT bit though.

HTH,

~Vaibhav

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Marwan ALshawi Mon, 08/04/2008 - 19:30

do u have any thing connect with router B contain those address i mea 172.16.1.0/24 ?

if not creat loopback address like

interface loopbak 0

ip address 172.16.1.2 255.255.255.0

interface loopbak 1

ip address 172.16.1.3 255.255.255.0

also change the area number on router B and A to (0)

also add

ip route 172.16.1.2 255.255.255.255 192.168.0.2

ip route 172.16.1.3 255.255.255.255 192.168.0.2

ip route 172.16.1.4 255.255.255.255 192.168.0.2

good luck

please, rate if helpful

gilbert_tan1968 Mon, 08/04/2008 - 22:10

Hi,

Thank you for your reply.

I can't make changes to RouterA since its not manage by me. Also, the admin of RouterA doesn't want to make any changes (or addition) to RouterA configuration.

As mentioned, if I managed routerA it should routed there as;

ip route 172.16.1.2 255.255.255.255 192.168.0.2

ip route 172.16.1.3 255.255.255.255 192.168.0.2

ip route 172.16.1.4 255.255.255.255 192.168.0.2

Now, how to make the route apear in RouterA via OSPF Area 1 in RouterB and make sure NAT works?

I think about the Null/Redistribute solution but I can't test it - no equipment to test them :(

GT

Marwan ALshawi Mon, 08/04/2008 - 22:23

now what can i see is that router A only advertising the subnet between B and A

so if router A has a network connected to any other interface and not included in router a advertised network

what happen

the packet will come to u, but from router B it will dose not know how to get back to that network because it is not advertised

so if u know he has network and u dont want router a do any more changes

just maked a static route on router B to that network useing router A as a next hope

then redistribute it in ospf

Correct Answer
vaisharm Tue, 08/05/2008 - 00:23

Hi Gilbert,

Yes, the routes would be installed in router A as below:

O E2 172.16.1.4 [110/20] via 192.168.0.2, 00:03:19, FastEthernet0/0

O E2 172.16.1.3 [110/20] via 192.168.0.2, 00:03:19, FastEthernet0/0

O E2 172.16.1.2 [110/20] via 192.168.0.2, 00:03:19, FastEthernet0/0

I haven't checked the NAT bit though.

HTH,

~Vaibhav

Correct Answer
vaisharm Tue, 08/05/2008 - 01:25

NAT is going to work as well. If any one from RouterA tries to reach any of the three 172.16.1.0 IPs:

RouterB#sh ip nat trans

Pro Inside global Inside local Outside local Outside global

--- 172.16.1.1 192.168.1.1 --- ---

icmp 172.16.1.2:11 192.168.1.2:11 192.168.0.1:11 192.168.0.1:11

--- 172.16.1.2 192.168.1.2 --- ---

icmp 172.16.1.3:12 192.168.1.3:12 192.168.0.1:12 192.168.0.1:12

icmp 172.16.1.3:13 192.168.1.3:13 192.168.0.1:13 192.168.0.1:13

--- 172.16.1.3 192.168.1.3 --- ---

However, I have one doubt. You have static routes pointing to null0 for

172.16.1.2

172.16.1.3

172.16.1.4

But the static NAT statements are for

172.16.1.1

172.16.1.2

172.16.1.3

Was 172.16.1.1 included by mistake? Should it be 172.16.1.4 ?

If this was a typo, you may include the correct network and it would work just as you thought.

HTH,

~Vaibhav

gilbert_tan1968 Tue, 08/05/2008 - 02:23

Hi Vaibhav,

Thank you for your reply.

Yes the 172.16.1.1 supposed to be 172.1.1.4 (typo error). Here is the corrected NAT config

ip nat inside source static 192.168.1.2 172.16.1.2

ip nat inside source static 192.168.1.3 172.16.1.3

ip nat inside source static 192.168.1.4 172.16.1.4

Thank you for testing it. After seeing your reply, I configure it in a production network and all is working as expected.

GT

Actions

This Discussion