About OSPF network configuration

Source: Internet
Author: User

When should I use a complete IP address or a network address?
OSPF is the link state protocol, which mainly refers to the interface status such as ip address, mask, Hello time ....) this information will be exchanged through LSAs during the establishment of adjency between Routers until the same Area converges, all Routers have the same link state database, and then use their own root) to create an SPF tree, finally, the route table is calculated based on SPF. any interface changes in the Area will be updated.
Let's look at the OSPF execution process: (simple example)
Int s1
Ip add 10.1.1.1 255.255.255.0 (10.1.1.1/24)
Int s2
Ip add 172.2.0.1 255.255.255.0 (172.2.0.1/24)
Int s3
Ip add 172.3.0.1 255.255.0.0 (172.3.0.1/16)
Int s4
Ip add 172.4.0.1 255.255.0.0 (172.4.0.1/16)
Route ospf 10
Network 10.1.1.1 0.0.0.0 area 0
Network 172.2.0.0 0.0.255.255 area 0
When entering OSPF 10, OSPF first runs network 10.1.1.1 0.0.0.0, finds the interface address, matches s0, assigns it to Area 0, and then runs network 172.2.0.0.0.0.255.255 aera 0, matches s2-> Area 0, finally, we can see the following information on other Routers:
172.16.0.0/24 is subnetted, 1 subnets
O 172.16.0.0 [110/128] via 192.168.0.1, 00:00:00, Serialx
10.0.0.0/24 is subnetted, 1 subnets
O 10.1.1.0 [110/74] via 192.168.0.1, 00:00:05, Serialx
We can see that the submask is 24, ignoring the inverse mask prepared in the network. Why?
Let's take a look at what will happen when a new network is added?
Route ospf 10
Network 10.1.1.1 0.0.0.0 area 0
Network 172.2.0.0 0.0.255.255 area 0
Network 172.0.0.0 0.20.255.255 area 1
Network 0.0.0.0 0.0.0.0 area 2
Show ip route
Codes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP
D-OSPF, EX-VPN external, O-OSPF, IA-OSPF inter area
N1-ospf nssa external type 1, N2-ospf nssa external type 2
E1-OSPF external type 1, E2-OSPF external type 2, E-EGP
I-IS, L1-IS level-1, L2-IS level-2, ia-IS inter area
*-Candidate default, U-per-user static route, o-ODR
P-periodic downloaded static route
Gateway of last resort is not set
O ia 172.3.0.0/16 [110/933] via 192.168.0.1, 00:00:05, Serialx
O ia 172.4.0.0/16 [110/933] via 192.168.0.1, 00:00:02, Serialx
172.16.0.0/24 is subnetted, 1 subnets
O 172.16.0.0 [110/128] via 192.168.0.1, 00:00:10, Serialx
10.0.0.0/24 is subnetted, 1 subnets
O 10.1.1.0 [110/74] via 192.168.0.1, 00:00:05, Serialx
S3 and s4 are all in Area 1 (marked as IA mask 16 ).
Summary: The actual network scope has been described in interface mask, which is clearly marked in the Link state database of all Routers and will not be changed due to the OSPF network configuration. In the OSPF network configuration, inverse mask only serves to specify the network range in the OSPF process of the current Router. For example, network 172.0.0.0 0.20.255.255 ranges from 172.0.0.0 ~ 172.00000000255: All interfaces in the range are allocated to Area 1, and all other addresses are allocated to Area 2.
If no Loopback interface is available in Stub Area
Router ospf 20
Network 0.0.0.0 255.255.255.255 area x
In this way, you do not need to specify the network range separately. For other types, we recommend that you use the interface ip address and 0.0.0.0 for exact matching to prevent errors. For example:
Network 10.1.1.1 0.0.0.0 area 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.