3

I built a simple Network with 2 routers, the problem is that i cant reach to other router, somehow there's problem i couldn't figure out.

here is the configurations:

Router0:

enter image description here


Router1:

enter image description here

doesn't work...

2
  • 2
    Please don't use pictures for text. You should edit your question to remove the pictures and insert the actual text. Also, you need to provide a diagram of how these are connected. What other router(s) do you have?
    – Ron Maupin
    Mar 25, 2016 at 17:40
  • 2
    And when doing to, it may be useful to include more configuration details, like the interface configurations, and OSPF commands like show ip ospf neigh.
    – Teun Vink
    Mar 25, 2016 at 17:42

3 Answers 3

6

working ospf drawing

(I imagine your setup to be something like this)

Your OSPF adjacency is not coming up because the IP addresses on the facing interfaces between R1 and R2 are not in the same subnet.

As soon as you use two IP addresses that are in the same subnet (as in the drawing above), you will have IP connectivity between R1 and R2, and your OSPF adjacency can be established :

Router R1

!
interface GigabitEthernet0/0
 ip address 72.40.42.1 255.255.254.0
 duplex full
 speed 1000
 media-type gbic
 negotiation auto
!
interface GigabitEthernet1/0
 ip address 72.40.40.1 255.255.254.0
 negotiation auto
!
<...>
!
router ospf 1
 router-id 1.1.1.1
 network 72.40.40.0 0.0.1.255 area 0
 network 72.40.42.0 0.0.1.255 area 0
!

Router R2

!
interface GigabitEthernet0/0
 ip address 72.40.43.1 255.255.254.0
 duplex full
 speed 1000
 media-type gbic
 negotiation auto
!
interface GigabitEthernet1/0
 ip address 72.40.46.1 255.255.254.0
 negotiation auto
!
<...>
!
router ospf 1
 router-id 2.2.2.2
 network 72.40.42.0 0.0.1.255 area 0
 network 72.40.46.0 0.0.1.255 area 0
!

(Please note that 72.40.42.1/23 and 72.40.43.1/23 are in the same subnet) << as pointed out above, this is the crucial point

Your OSPF comes up now :

R1#sh ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/DR         00:00:38    72.40.43.1      GigabitEthernet0/0
R1#

and

R2#sh ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/BDR        00:00:37    72.40.42.1      GigabitEthernet0/0
R2#

And you are able to check the reachability of the OSPF-learned network by pinging :

R2#ping 72.40.40.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 72.40.40.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/32/48 ms

The crucial point is that the IP addresses on the link between R1 and R2 have to be in the same subnet (or you need to configure static routes or other less elegant tricks). Otherwise, R1 will have no way to know how to reach R2, and vice-versa.

2
  • thank you Mr.tonton but what's the purpose of put both of them in the same network? i want them to be separated networks Mar 29, 2016 at 16:23
  • OK I understood Jun 18, 2016 at 12:37
1

as Ron mentioned before there is no common network between your routers and every single interface is on a separate network and the reason is that the wild card mask that you have configured on each of these interfaces which give you the option to have interfaces on the same network only using the 1st octet (.255) 2nd octet (.1)cannot be changed. You can fix that by using a different wild card mask such 0.0.8.255 and here the ping can work and all your interfaces will be on the same network but you will be losing the benefit of the router which is separating between 2 different networks Better practice is to change the IP addresses on the interfaces and have both of the connected interfaces to be on the same network.

0

If these are your only two routers, you have a problem: there is no common network on which these routers can communicate. Routers need a common network between them in order to even communicate with IP, much less with a protocol (e.g. OSPF) which uses IP. OSPF could never form a neighbor relationship if the FastEthernet ports on these routers are connected to the other router as the only links between the routers.

2
  • I still don't get it Mar 25, 2016 at 19:04
  • If Router0 F0/0 is connected to Router1 F0/0, those two interfaces must be on the same network in order for IP to communicate. You currently have them on two separate networks (72.40.40.0/23 is a different network than 72.40.44.0/23), and those two networks cannot communicate without an intervening router.
    – Ron Maupin
    Mar 25, 2016 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.