cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3873
Views
0
Helpful
6
Replies

OSPF Between Two Subnets

JKwan
Level 1
Level 1

We are going to use Cisco layer 3 switches instead of WAN routers for connecting two locations via MPLS. To prepare for the installation, I set up a test environment to test the configuration of routed interfaces. I was able to get two endpoint laptops to communicate by using static routes. After replacing the static routes with OSPF, however, the two laptops can no longer PING each other.

 

Here is the config of the two switches:

 

Switch 1 (Cisco 3750) Configuration
!
ip routing
!
interface GigabitEthernet1/0/2
no switchport
ip address 10.10.200.106 255.255.255.252
!
interface Vlan1
ip address 172.20.1.1 255.255.254.0
!
router ospf 1
network 10.10.200.104 0.0.0.3 area 102
network 172.20.0.0 0.0.1.255 area 1

 

Switch 2 (Cisco 3650) Configuration
!
ip routing
!
interface GigabitEthernet1/0/2
no switchport
ip address 10.10.200.105 255.255.255.252
!
interface Vlan1
ip address 172.20.2.1 255.255.255.0
!
router ospf 2
network 10.10.200.104 0.0.0.3 area 102
network 172.20.2.0 0.0.0.255 area 2

 

Trouble-shooting on Switch 1

#sh ip route
10.0.0.0/30 is subnetted, 1 subnets
C 10.10.200.104 is directly connected, GigabitEthernet1/0/2
172.20.0.0/23 is subnetted, 1 subnets
C 172.20.0.0 is directly connected, Vlan1

 

#sh ip ospf int br
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Vl1 1 1 172.20.1.1/23 1 DR 0/0
Gi1/0/2 1 102 10.10.200.106/30 1 BDR 1/1

 

#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
172.20.2.1 1 FULL/DR 00:00:34 10.10.200.105 GigabitEthernet1/0/2

 

#sh ip route

(no routes returned)

 

Trouble-shooting on Switch 2

#sh ip route
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.200.104/30 is directly connected, GigabitEthernet1/0/2
L 10.10.200.105/32 is directly connected, GigabitEthernet1/0/2
172.20.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.20.2.0/24 is directly connected, Vlan1
L 172.20.2.10/32 is directly connected, Vlan1

 

#sh ip ospf int br
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Vl1 2 2 172.20.2.1/24 1 DR 0/0
Gi1/0/2 2 102 10.10.200.105/30 1 DR 1/1

 

#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
172.20.1.1 1 FULL/BDR 00:00:30 10.10.200.106 GigabitEthernet1/0/2

 

#sh ip route ospf
(no routes returned)

 

This is just a very simple setup and I was able to get the two laptops to connect to each other by using static routes. Did I miss anything in OSPF settings?

 

 

 

 

1 Accepted Solution

Accepted Solutions

 

Hi,

 

In OSPF, you will need the backbone area (area 0) in order exchange route between other areas (area 1, area 2, ...). In your case, you will need to replace area 102 with area 0.

 

If you have any questions, please let us know.

 

HTH, 

Meheretab

 

HTH,
Meheretab

View solution in original post

6 Replies 6

 

Hi,

 

In OSPF, you will need the backbone area (area 0) in order exchange route between other areas (area 1, area 2, ...). In your case, you will need to replace area 102 with area 0.

 

If you have any questions, please let us know.

 

HTH, 

Meheretab

 

HTH,
Meheretab

Thanks for the catch.  I missed area ZERO in the design.  I did exactly as suggested and problem solved.  

Georg Pauwen
VIP Alumni
VIP Alumni

Hello,

 

on a side note, if you don't want to use area 0, you can also just use one area:

 

Switch 1

 

router ospf 1
network 10.10.200.104 0.0.0.3 area 102
network 172.20.0.0 0.0.1.255 area 102

 

Switch 2

 

router ospf 2
network 10.10.200.104 0.0.0.3 area 102
network 172.20.2.0 0.0.0.255 area 102


Switch 1

 

router ospf 1
network 10.10.200.104 0.0.0.3 area 1
network 172.20.0.0 0.0.1.255 area 1

 

Switch 2

 

router ospf 2
network 10.10.200.104 0.0.0.3 area 1
network 172.20.2.0 0.0.0.255 area 1

Yes, that too.  Having a single network area 0 will also work in the test environment.  Thank you.

Yury Kuzminov
Level 1
Level 1

Hi,

Not sure why do you need so many areas, however it is your choice.

Try to simplify the design by configuring all your switches as backbone routers first (all subnets/interfaces belong to area 0), if you need multi-area design (for summarizing and segmentation), put interconnect interfaces to backbone and vlan interfaces to another area.

Hope it helps 🙂

 

The use of Area 0 fixed the issue.  That was my negligence (or ignorance) for missing it.

 

Now I am going to use OSPF for connecting two sites (main & branch) on MPLS.  Attached is a network diagram for the setup.

 

Site 1

Internal LAN - CPE Router - CPE Router - CE Router - PE Router - MPLS Cloud

OSPF Area 1:  Between internal LAN and CPE

OSPF Area 101: Between CPE & CE

 

Site 2

Internal LAN - CPE Router - CPE Router - CE Router - PE Router - MPLS Cloud

OSPF Area 2:  Between internal LAN and CPE

OSPF Area 102: Between CPE & CE

 

I have just learned from the carrier that there will not be using Area 0 at their end.  That means I will have to change the area numbers in order to get OSPF to work properly.  Can I simply change area 2 of site 2 to area 0?  Or, are there any better way of using the area numbers?  Any suggestions?