Application of OSPF routing protocol on CISCO Routers

Source: Internet
Author: User

1. Start the OSPF protocol

To start the OSPF routing protocol on a CISCO router, two steps are generally required:
1) Start the OSPF protocol process:
Router (config) # router ospf <process-id>
2) define the network of the vro:
Router (config-router) # network <network address> <mask> area <area-id>

The OSPF protocol is started through the Router ospf command. The OSPF protocol Process id is only a value related to the current vro and has no relationship with other vrouters in the network. A vro can run an OSPF process or multiple OSPF processes. Each OSPF Process maintains a database. Therefore, try to run only one OSPF process to reduce the load on the vro.

The Network command defines the Network of the router and specifies the Network domain of the router port. The mask defines the network size, which is the opposite of the port mask. For example, the 0.0.0.255 mask defines the first three bytes as the network number and identifies the network size. The area-id identifies the network domain to which the port belongs. The value is generally an integer and can also be expressed as an IP address.
The configuration command is as follows:
Router #
Interface ethernet 0
Ip address 200.2.2.1 255.255.255.0
Interface serial 0
Ip address 200.8.8.1 255.255.255.0
Router ospf 108
Network 200.2.2.0 0.0.0.255 area 0
Network 200.8.8.0 0.0.255 area 1

The IP address of Ethernet port 0 is configured in the first section, the IP address of serial port 0 is configured in the second section, and the OSPF routing protocol is started in the third section. The networks 200.2.2.0 and 200.8.8.0 are placed in different network domains respectively.

2. Configure OSPF Interface Parameters

All network interface parameters of the OSPF protocol have their default values. You can also configure some interface parameters based on the actual needs of the network to fully optimize the network.
1) HELLO Interval
The OSPF router regularly sends HELLO data packets to the neighboring routers to find the status of the neighboring routers. The probe interval can be set. The HELLO interval is measured in seconds)
Router (config-if) # ip ospf hello-interval seconds
2) link weight
Generally, OSPF calculates the weight based on the link bandwidth. You can set the weight based on your needs.
Router (config-if) # ip ospf cost
3) transmission latency
Transmission latency refers to the time required to transmit a link status update package between OSPF link interfaces.
Router (config-if) # ip ospf transmit-delay seconds
4) retransmission Interval
Retransmission interval refers to the retransmission interval of the link state. If a router sends a new link status package to an adjacent router, the packet is re-transmitted when no peer Validation Package is received.
Router (config-if) # ip ospf retransmit-interval seconds

3. Route reduction

Route reduction combines multiple routes into one route, which greatly reduces the load on the router. Routing is usually performed on the domain border router, especially the domain border router directly connected to the backbone domain because the route is finally broadcast to other network domains by the backbone domain ). There are two types of routing, one is Inter-Domain Routing, and the other is external routing.

1) Inter-Domain route reduction
Inter-Domain route reduction is configured on the domain border router. It is suitable for intra-domain route reduction in autonomous regions. However, it is not suitable for external routes to be injected into OSPF routes through broadcast. In order to make full use of Route reduction, the network number of the network domain is as continuous as possible, so that multiple networks can be reduced to one network, multiple routes will be reduced to one route, on the CISCO Series router, the command to be configured is:
Area-id range address mask
"Area-id" Domain id) is the id of the network domain for Route reduction, "address" address) and "mask" mask) convert the network address in the domain to a specific segment.

For example, router B migrates the IP address in network domain 1 from 202.102.0.0 to 202.102.15.0 to an IP address segment: 202.102.0.0 255.255.255.240.0. Similarly, router C converts the IP address in network domain 2 to 128.1.16.0 255.255.255.240.0. The command on router C is:
RouterC #
Router ospf 102
Area 2 range 128.1.16.0 255.255.240.0

2) External route reduction
An external route is a route entry that is injected into OSPF through broadcast. The IP address of an external route must be continuous. Route reduction is completed through the sub-commands under "router ospf", and this command is only valid on the VBR of the autonomous domain:
Summary-address ip-address mask

For example, router B injects an external route into the OSPF domain, and the injected subnet range is 126.1.96-127. To perform route reduction, you must perform the following operations on vrob B:
RouterB #
Router ospf 102
Summary-address 126.1.96.0 255.%224.0
Redistribute bgp 20 metric 100 subnets
The preceding command causes router B to generate an external route 126.1.96.0 255.255.224.0 and normalize the routes broadcast by the BGP protocol.
4. Broadcast external routes to OSPF

To broadcast external routing protocol to OSPF is to broadcast routes to OSPF from the Static Routing Protocol or other dynamic routing protocols to change the external routing of OSPF. To broadcast routes to OSPF, the command to be executed on the CISCO router is:
Redistribute protocol [process-id] [metric value] [metric-type value] [subnets]

"Protocol" protocol) and "process-id" process number) are the routing protocols and process numbers that will broadcast the routes to OSPF. If the weight value metric is not defined, OSPF defines 1 for the routes broadcast by BGP, and 20 for routes broadcast by other routing protocols. If the subnets keyword is not specified, the route for dividing subnets will be lost.

Metric-type is divided into two types: External type 1 and external type 2. The difference is that the two methods for calculating weights in one path are different: in type 2, the weight of the route to the destination vro remains unchanged. In type 1, the weight value is accumulated, and the default value of the weight type is 2.

For example, router A broadcasts two external routes to OSPF. Router R1 broadcasts data of type 1, and router R2 broadcasts data of Type 2. When router C arrives, the weight of Route R1 is X + Y + Z, while that of Route R2 is X. The two static routes 12.28.110.0/24 and 128.10.0.0/16 enter router A through Ethernet E0, and then broadcast to router B.
The configuration required on the CISCO router is as follows:

Route# interface ethernet 0
Ip address 202.102.16.2 255.255.255.0
Interface serial 1
Ip address 202.102.18.1 255.255.255.0
Router ospf 102
Redistribute static metric 30 subnets
Redistribute connect subnets
Network 202.102.16.0 0.0.0.255 area 1
Network 202.102.18.0 0.0.255 area 0
Ip route 12.28.110.0 255.255.255.0 202.102.16.2
Ip route 128.10.0.0 255.255.0.0 202.102.16.2
RouterB # interface serial 0
Ip address 202.102.18.2 255.255.255.0
Router ospf 102
Network 202.102.18.0 0.0.255 area 0

Vroa A broadcasts two static routes to vrob B. In the command "Redistribute static metric 30 subnets", the weight value 30 can be omitted. The default weight of OSPF broadcast is 20, however, the keyword "subnets" cannot be omitted. Otherwise, "Ip route 12.28.110.0 255.255.255.0 202.102.16.2" cannot be broadcast because of subnet division.


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.