Configuring OSPF:
(conf)#router ospf <process_id> where the process ID can be any number. But, there can be only one OSPF instance
- Inside ospf configuration, use #network 1.1.1.0/24 area 0
- We can see the DR and BDR using #show ip ospf interface of our own interface
- We can see neighbor details using #show ip ospf neighbor detail
Network Command in OSPF:
In network command syntax is: #network
- network 10.1.2.0 0.0.0.3 area 0 advertises the /30 network (10.1.2.0 thru 10.1.2.4)
where as
- network 10.1.2.2 0.0.0.0 area 0 advertises the /32, the specific host of 10.1.2.2
Wildcard Information for configuring network command in OSPF:
- The rule for a wildcard mask is:
0 means that the equivalent bit must match
1 means that the equivalent bit does not matter
- Wildcard masks are used in situations where subnet masks may not apply. For example, when two affected hosts fall in different subnets, the use of a wildcard mask will group them together.
- https://en.wikipedia.org/wiki/Wildcard_mask
NOTE:
Wildcard mask of all zeros (0.0.0.0) means that the entire IP address have to match in order for a statement to execute. For example, if we want to match only the IP address of 192.168.0.1, the command used will be 192.168.0.1 0.0.0.0.
A wildcard mask of all ones (255.255.255.255) means that no bits have to match. This basically means that all addresses will be matched.
Here is an example of using a wildcard mask to include only the desired interfaces in the OSPF routing process:
- Router R1 has three networks directly connected.
- To include only the 10.0.1.0 subnet in the OSPF routing process, the following network command can be used: #network 10.0.1.0 0.0.0.255 area 0
- So, from above command, the last octet doesen’t have to match, because the wildcard mask bits are all ones. The first 24 bits have to match, because of the wildcard mask bits of all zeros. So, in this case, wildcard mask will match all addresses that begins with 10.0.1.X. In our case, only one network will be matched, 10.0.1.0/24.
What if we want to match both 10.0.0.0/24 and 10.0.1.0/24? Then, we will have to use different wildcard mask. We need to use the wildcard mask of 0.0.1.255.
- Well, we again need to write down addresses in binary:
00001010.00000000.00000000.00000000 = 10.0.0.0
00001010.00000000.00000001.00000000 = 10.0.1.0
00000000.00000000.00000001.11111111 = 0.0.1.255
- From the output above, we can see that only the first 23 bits have to match. That means that all addresses in the range of 10.0.0.0 – 10.0.1.255 will be matched. So, in our case, we have successfully matched both addresses, 10.0.0.0 and 10.0.1.0.
The router decides from which all interfaces to send that hello packet using below method:
- \1. The wildcard-mask argument is logically ORed with the interface IP address.
- \2. The wildcard-mask argument is logically ORed with the ip-address argument in the network command.
- \3. The software compares the two resulting values. If they match, OSPF is enabled on the associated interface and this interface is attached to the OSPF area specified.
Note: #network 0.0.0.0 255.255.255.255 wildcard is allowed in the network command because it matches all the networks
Read for another example: http://www.ccnapractice.com/ospf/forming-ospf-neighbour-relationships
--------------------------------------------------------------------------------------------------------------------------------
Loopback Interfaces in OSPF:
https://sites.google.com/site/amitsciscozone/home/important-tips/ospf/loopback-interfaces-in-o
--------------------------------------------------------------------------------------------------------------------------------
Router ID:
- Thus, it is always recommended to manually configure a router ID as in this case it will be independent of individual interfaces.
- Priority is:
- Manual configuration (router-ospf)#router-id 1.1.1.1
- Highest IP address on a loopback interface.
- Highest IP address on an “active” non-loopback interface.
- OSPF routers will not form neighborship with another router that has the same router-ID
--------------------------------------------------------------------------------------------------------------------------------
Transit and Stub Networks in OSPF
Transit Network: Here, we have many entry and exit points. So, it is possible to enter through one entry point and exit through another exit point (interface).A network can be said to be a transit network if there is another router connected to the interface. | Stub Network: Here, we have only a single entry and exit point into and out of the OSPF network .ie. it should use the same interface Loopback interface is an example of a stub network |
---|---|
No comments:
Post a Comment