Configuring OSPF Directory

OSPF Implementation on the router

OSPF configuration entry list

Start OSPF

Configure the interface parameter of OSPF

OSPF configuration on different physical networks

Configure route summary within OSPF domain

Configure the gathering of a forward router

Create default route

Select router ID through LOOPBACK interface

Configure the management distance of OSPF

Configure the route calculating timer

The supervision and maintenance of OSPF

Examples of OSPF configuration

The OSPF Configuration will be introduced in this chapter. For more specific detailed information about all the OSPF commands, please refer to the relevant sections about OSPF Commanders in the Reference for Network Protocol Configuration. 

OSPF is an IGP Route protocol developed by the OSPF Working Group of IETF. The OSPF, which is designed for the IP Network, supports the IP Sub-network and the External Route Information Label and at the same time allows the authentication of message and supports the IP Multicast.

 

OSPF Implementation on the router

The Implementation of OSPF of our company complies with the OSPF V2 specification (Refers to RFC2328). Some key feathers in the implementation are listed in the following:

  1. Stub Area--Supporting the Stub Area

  2. Route redistribution--Any route, formed by and learned a routing protocol, can always be redistributed to the other route protocol Domain. Within the autonomous System, it means that OSPF can input the route learned by the RIP. And the routes learned by OSPF can also be redistributed to the RIP.  Between autonomous Systems, OSPF can input the routes learned by BGP; and OSPF routes can also be injected to BGP.

  3. Authentication--The Plaintext and MD5 Authentications are supported between the neighboring routers within a area.

  4. Router Interface Parameters--The configurable Parameters include: Outgoing Cost, Retransmission Interval, Interface Transmission Delay, router Priority, Judgement on the router Switching-off Interval, the Interval of Hello Message and the Authentication Password.

  5. Virtue Link--Supporting the Virtue Link

  6. NSSA area--Refer to RFC 1587

  7. OSPF---RFC 1793 on the virtual circuit.

OSPF configuration entry list

OSPF requires to exchange  routing data among all routers, ABR and ASBR in a area. In order to simplify the configuration, you may let them all work under default parameters without authentication, etc… but if you want to alter some parameters, you should guarantee the identity of the parameters on all routers.

In order to configure OSPF complete the following tasks. Besides the necessity of activating OSPF, other configurations are all optional. 

Start OSPF

Configure the interface parameter of OSPF

OSPF configuration on different physical networks

Configure OSPF network type

Configure point-to-multiple point, broadcasting network

Configure non-broadcasting network

Configure OSPF domain

Configure route summary within OSPF domain

Configure the gathering of a forward router

Create default route

Select router ID through LOOPBACK interface

Configure the management distance of OSPF

Configure the route calculating timer

The supervision and maintenance of OSPF

In addition to that, about configuring route redistribution, please refer to the related content about “Route Redistribution” of “Protocol-independent Feather Configurations of IP routing Protocol”

Start OSPF

Like other routing protocols, activating OSPF demands creating OSPF routing process, allocation of an IP address range related to the executing process, allocation of an area ID related to IP address range. Under the global configuration mode, use the following commands:

Step

Command

Objective

1

router ospf process-id

This command activates OSPF routing protocol, and enters router configuration mode.

2

network address mask area area-id

This command configures the interface(s) running OSPF and the area ID of the interface

 

Configure the interface parameter of OSPF

During the implementation of OSPF, it is permitted to change the OSPF parameters related to interface according to the requirement. There is no need to change any parameter, but you should guarantee the identity of certain parameters on all routers on connected network.

Under interface configuration mode, use the following commands to configure interface parameters:

Command

Objective

ip ospf cost cost

Configure the metric of OSPF interface to forward packets.

ip ospf retransmit-interval seconds

The seconds taken to retransmit LSA between the neighbors belonging to the same OSPF interface.

ip ospf transmit-delay seconds

Configure the estimated time to transmit LSA on an OSPF interface (second as the unit)

ip ospf priority number

Configure the priority of router to become the  DR router

ip ospf hello-interval seconds

Configure the time interval to send hello packet on OSPF interface.

ip ospf dead-interval seconds

If the router does not receive hello packet from the neighbor within the time interval defined, it considers the neighbor router to be turned off.

ip ospf authentication-key key

It is an authentication password of the adjacent router in an address, which uses simple password authentication of OSPF.

ip ospf message-digest-key keyid md5 key

Demand OSPF to use MD5 authentication

ip ospf passive

Do not send hello message on the interface

OSPF configuration on different physical networks

OSPF divides the physical media of the network into the following 3 types:

1. Broadcasting network (Ethernet, Token Ring, FDDI)

2. Non-broadcasting, multi-access network (SMDS, Frame Relay, X.25)

3. Point-to-point network (HDLC, PPP)

You network can be configured to be broadcasting network or non-broadcasting, multi-access network.

X.25 and FR network provide optional broadcasting ability, It can been configured for OSPF to work in the broadcasting network through command “map”. About command “map”, you can refer to the related description about command “map” of X.25 and FR in WAN Command Reference.

Configure OSPF network type

No matter what the physical media type of the network is, you can configure your network to be broadcasting network or non-broadcasting, multi-access network. Using this feature, you can flexibly configure the network, you can configure the physical broadcasting network to be a non-broadcasting, multi-access network; you can also configure non-broadcasting network (X.25, Frame Relay, and SMDS) to be broadcasting network. This feature also reduces the configuration of the neighbors, for detailed information, please refer to the related content of non-broadcasting network’s configuration of OSPF.

Configure non-broadcasting, multi-access network to be broadcasting network or non-broadcasting network, that is, to suppose there exists virtual links from every router to other routers, or suppose they consist of a full-mesh network. Because of the restriction of expenses, it is usually not practical; or a partially full-mesh network. Under this situation, you can configure a point-to-multiple point network. Routers not adjacent to each other can exchange routing information through virtual links.

OSPF point-to-multiple point interface can be defined as several point-to-point network interfaces, which creates multiple host routes. OSPF point-to-multiple point network has the following advantages over non-broadcasting, multi-access network and point-to-point network:

Point-to-multiple point network is easy to configure, it does not demand neighbor configuration command, it only uses one IP and will not produce DR.

Because it does not need to full-mesh network topology, it costs less.

It is more reliable. Even when virtual links fail, it can still maintain the connection.

Under interface configuration mode, configure OSPF network type with the following command:

Command

Objective

ip ospf network {broadcast | non-broadcast | {point-to-multipoint [non-broadcast] }}

This command configures the network type of OSPF.

At the end of this chapter, you can see an example of the configuration of OSPF point-to-multiple point network.

Configure point-to-multiple point, broadcasting network

You do not need to describe the neighbor relations in point-to-multiple point network and broadcasting network. But you can use command “neighbor” to describe the priority of a certain neighbor.

Before using this command, some OSPF point-to-multiple point protocol traffic is multicast traffic. So for point-to-multiple point interface, command “neighbor” is not needed. Packet “hello”, update packet and confirmation packet are all transmitted through broadcasting form, especially,  multicast “hello” packet can dynamically discover all neighbors.

In point-to-multiple point network, the router supposes that all neighbors have the same metric. This value can be configured through command “ip ospf cost”. In fact, the bandwidth of every neighbor is different, so the value should be different. This feature only applies to point-to-multiple point interface.

Using the following command to configure the interface to be point-to-multipoint interface and allocate a metric for each neighbor:

Step

Command

Objective

1

ip ospf network point-to-multipoint

On broadcasting media, configure the interface to be a point-to-multiple point network

2

exit

Return to global configuration mode

3

router ospf process-id

Configure an OSPF router process and enter into router configuration mode.

4

neighbor ip-address cost number

Designate a neighbor and allocate a metric for it

 

 

For each neighbor wishing to designate its metric, repeat step 4. Otherwise use the value designated by command “ip ospf cost

Configure non-broadcasting network

Because there are many routers in the OSPF network, so there must be one DR elected for the network. If the broadcasting ability is not configured, it is requested to perform parameter configuration for the selection process.

These parameters only carry out configuration on the routers that are eligible to become DR or BDR.

Under router configuration mode, use the following command to configure routers of non-broadcasting network which are mutually related:

Command

Objective

neighbor ip-address [priority number] [poll-interval seconds]

Configure the router connected to the non-broadcasting network

You can designate the following parameters for a neighbor router:

1. The precedence of neighbor router.

2. Non-broadcasting poll interval.

3. Interface accessible to the neighbor

 

In point to multiple point, non-broadcasting network, you can use command “neighbor” to designate neighbor relation. Allocate an optional priority.

In the previous software versions, some users configure point to multipoint connections on non-broadcasting media (IP over ATM), so the router cannot dynamically discover its neighbor router. This feature permits the usage of command “neighbor” on point to multipoint interface.

In a point to multipoint network, the router supposes all neighbors have the same metric. This value can be configured through the command “ip ospf cost”. In fact, as the bandwidth of each neighbor is different, the value should also be different. This feature only applies to point to multiple point interfaces.

Under interface configuration mode, use the following command to configure point to multiple point interfaces on media that do not support broadcasting.

Step

Command

Objective

1

ip ospf network point-to-multipoint non-broadcast

Configure point to multiple point interface on non-broadcasting media

2

exit

Enter into global configuration mode.

3

router ospf process-id

Create a OSPF routing process and enter into router configuration mode

4

neighbor ip-address [cost  number]

Designate an OSPF neighbor and allocate a metric for it

5

 

Repeat step 4 for each neighbor

Configure OSPF domain

Configurable area parameters include: authentication, designating Stub area, designating metric for default summary route. Authentication adopts protection based on passwords.

Stub areas are those that don’t distribute external routes in them. Instead, ABR generates a default external route to enter the stub area, enable it to enter the external network of the autonomous system. in order to utilize the features OSPF Stub support, you should use default route in the Stub area. In order to additionally reduce LSA number sent into the Stub area, you can prohibit gathering ABR to reduce the sending of summary LSA (type3) entered into the Stub area.

Under router configuration mode, use the following command to define the area parameter:

Command

Objective

area area-id authentication simple

Activate OSPF area authentication

area area-id authentication message-digest

Enable OSPF to use MD5 for authentication

area area-id stub [no-summary]

Define a Stub area

area area-id default-cost cost

Set metric for default route in Stub area.

Configure route summary within OSPF domain

This feature enables ABR to broadcast a summary route to other areas. In OSPF, ABR will broadcast every network to other areas. If the network number can be allocated according to a certain method, and be continuous, you can configure ABR to broadcast a summary route to other areas. A summary route can cover all networks within a certain range.

Under router configuration mode, use the following commands to define the address ranges:

Command

Objective

area area-id range address mask

Define the address range for route summary.

Configure the gathering of a forward router

When distributing routes from other router areas to OSPF router area, each performs independent broadcasting in the form of external LSA. But you can configure the router to broadcast a route, which covers a certain address range. This method can reduce the size of OSPF link status database.

Under the router configuration mode, use the following command to configure gathering the router:

Command

Objective

summary-address prefix mask [not advertise]

Describe the address and mask that cover the distribution route, only one gathering route is broadcasted.

Create default route

You can demand ASBR to create a default route to enter into the OSPF route area. Whenever you configure a router distribute route to enter into OSPF domain, this router automatically changes into ASBR. But, ASBR does not create default route entering into OSPF route area by default.

Under router configuration mode, use the following command to force ASBR to create a default route:

Command

Objective

default-information originate [always] [route-map map-name]

Force ASBR to create a default route entering into OSPF route area.

Select router ID through LOOPBACK interface

OSPF uses the biggest IP address configured on the interface as its router ID. If the interface connected to this IP address changes into DOWN state, or this IP address is deleted, OSPF process will restart to calculate new router ID and resend routing information from all interfaces.

If one loopback interface is configured with IP address, then the router uses that IP address as its router ID, since loopback interface will never become Down, and all these make the routing table more stable.

The router preferably uses LOOPBACK interface as the router ID, meanwhile selects the biggest IP address among all loopback interfaces as the router ID. If there is no loopback interface, then uses the biggest IP address of the router. You cannot designate OSPF to use any special interface.

Under global mode, use the following command, to configure IP Loopback interface.

Step

Command

Objective

1

interface loopback 0

Create a loopback interface and enter into interface configuration mode.

2

ip address ip-address mask

Allocate an IP address for the interface.

Configure the management distance of OSPF

Management distance is defined as the reliability level of routing information source, such as a router or a group of routers. Generally speaking, management distance is an integer between 0-255, the higher the value is, the lower the reliability level it is. If the management distance is 255, then the route information source will not be trusted and should be neglected.

OSPF uses 3 different types of management distances: inter-domain, inner-domain and exterior. The route within an area is inner-domain; the route to other areas is inter-domain; the route distributed from other route protocol domains is exterior. The default value of every kind of route is 110.

Under router configuration mode, use the following command to configure the distance value of OSPF:

Command

Objective

distance ospf [intra-area dist1] [inter-area dist2] [external dist3]

Change the management distance value of OSPF inner-domain, inter-domain and exterior route.

Configure the route calculating timer

You can configure the time delay between the time when OSPF receives topologic change information and when it starts to calculate SPF. You can also configure the interval between two consecutive calculations of SPF. Under router configuration mode, use the following command to configure:

Command

Objective

timers delay delaytime

Set the time delay in the route calculation in a area

timers hold holdtime

Set the minimum time interval of route calculation in a area

The supervision and maintenance of OSPF

It can display the statistic information of the network, such as: the statistics about the content of IP routing Table, cache and database and etc… This information can help you to judge the utilization of the network resource, and solve the network problem. You can understand the availability of the network nodes, discover the route the network data packet goes through the network.

Use the following commands to display various routing statistics:



Display the general information about OSPF routing process:

show ip ospf [process-id]

Display the related information about OSPF database:

show ip ospf [process-id] database

show ip ospf [process-id] database [router] [link-state-id]

show ip ospf [process-id] database [router] [self-originate]

show ip ospf [process-id] database [router] [adv-router [ip-address]]

show ip ospf [process-id] database [network] [link-state-id]

show ip ospf [process-id] database [summary] [link-state-id]

show ip ospf [process-id] database [asbr-summary] [link-state-id]

show ip ospf [process-id] database [external] [link-state-id]

show ip ospf [process-id] database [database-summary]

Display the internal routing table entry of ABR and ASBR:

show ip ospf border-routers

Display the information about OSPF interface:

show ip ospf interface

Display the OSPF neighbor information according to the interface:

show ip ospf neighbor

Supervise the adjacency establishment of OSPF:

debug ip ospf adj

Supervise the interface and neighbour events of OSPF:

debug ip ospf events

Supervise the flooding process of OSPF database:

debug ip ospf flood

Supervise the LSA generation of OSPF:

debug ip ospf lsa-generation

Supervise the message of OSPF:

debug ip ospf packet

Supervise the message retransmission process of OSPF:

debug ip ospf retransmission

Supervise the SPF calculation route of OSPF:

debug ip ospf spf

debug ip ospf spf intra

debug ip ospf spf inter

debug ip ospf spf external

Supervise the establishment of SPF tree of OSPF:

debug ip ospf tree

 

Examples of OSPF configuration

Here are the examples of OSPF configuration

Examples of OSPF point to multipoint configuration

Examples of OSPF point to multipoints, non-broadcasting configuration

examples of the configuration of variable length sub-network masks

examples of the configuration of OSPF route and route distribution

Configure complex OSPF on ABR router



Examples of OSPF point to multipoint configuration

Beijing uses DLCI201 to communicate with Shanghai, DLCI202 to communicate with Jelly, and DLCI203 with Platty. Neon uses DLCI101 to communicate with Mollie and DLCI102with Platty. Platty can communicate with Neon (via DLCI 401) and Mollie (via DLCI 402). Jelly can communicate with Mollie via DLCI301.

The configuration of BEIJING:

Hostname Beijing

!

interface serial 1/0

  ip address 130.130.0.2 255.255.0.0

  encapsulation frame-relay

  frame-relay map 130.130.0.1 pvc 201 broadcast

  frame-relay map 130.130.0.3 pvc 202 broadcast

  frame-relay map 130.130.0.4 pvc 203 broadcast

  ip ospf network point-to-multipoint

!

router ospf 1

  network 130.130.0.0 255.255.0.0 area 0

The configuration of ShangHai:

hostname shanghai

!

interface serial 1/0

  ip address 130.130.0.1 255.0.0.0

  encapsulation frame-relay

  frame-relay map 130.130.0.2 pvc 101 broadcast

  frame-relay map 130.130.0.4 pvc 102 broadcast

  ip ospf network point-to-multipoint

!

router ospf 1

  network 130.130.0.0 255.255.0.0 area 0

The configuration of  GuangZhou:

hostname guangzhou

!

interface serial 1/0

  ip address 130.130.0.4 255.0.0.0

  encapsulation frame-relay

  physical speed 1000000

  frame-relay map 130.130.0.1 pvc 401 broadcast

  frame-relay map 130.130.0.2 pvc 402 broadcast

  ip ospf network point-to-multipoint

!

router ospf 1

  network 130.130.0.0 255.255.0.0 area 0

The configuration of ChongQing:

hostname chongqing

!

interface serial 1/1

  ip address 130.130.0.3 255.0.0.0

  encapsulation frame-relay

  physical speed 2000000

  frame-relay map 130.130.0.2 pvc 301 broadcast

  ip ospf network point-to-multipoint

!

router ospf 1

  network 130.130.0.0 255.255.0.0 area 0

Examples of OSPF point to multipoints, non-broadcasting configuration

interface Serial1/0

ip address 10.0.1.1 255.255.255.0

ip ospf network point-to-multipoint non-broadcast

encapsulation frame-relay

frame-relay local-dlci 200

frame-relay map 10.0.1.3 pvc 202

frame-relay map 10.0.1.4 pvc 203

frame-relay map 10.0.1.5 pvc 204

no shut

!

router ospf 1

network 10.0.1.0 0.0.0.255 area 0

neighbor 10.0.1.3 cost 5

neighbor 10.0.1.4 cost 10

neighbor 10.0.1.5 cost 15

Here is the configuration of the router on the other side:

interface Serial1/2

 ip address 10.0.1.3 255.255.255.0

 encapsulation frame-relay

 ip ospf network point-to-multipoint non-broadcast

 no ip mroute-cache

 no keepalive

 no fair-queue

 frame-relay local-dlci 301

 frame-relay map 10.0.1.1 pvc 300

 no shut

 !

 router ospf 1

 network 10.0.1.0 0.0.0.255 area 0

examples of the configuration of variable length sub-network masks

OSPF, static routing supports variable length sub-network masks (VLSMs). Through VLSMs, it can use different masks to the same network number on different interfaces, this saves IP addresses, and can more efficiently utilize the address space of the network.

In the following example, it only uses 30bit sub-network masks and reserves address space of 2 bit as the host address for the serial ports. For point-to-point serial link, which only requires two host addresses, it is enough.

interface ethernet 1/0

  ip address 131.107.1.1 255.255.255.0

! 8 bits of host address space reserved for ethernets

interface serial 1/1

  ip address 131.107.254.1 255.255.255.252

! 2 bits of address space reserved for serial lines

! Router is configured for OSPF and assigned AS 107

router ospf 107

! Specifies network directly connected to the router

  network 131.107.0.0 0.0.255.255 area 0.0.0.0

examples of the configuration of OSPF route and route distribution

OSPF requires exchanging information among many internal routers, ABRs and ASBRs. Under minimum configuration, the routers based on OSPF can work under default parameters and have no requirement of authentication.

Here are three examples of configuration:



The first example practices the basic OSPF command.



The second example configures the configuration of internal router, ABR and ASBR in a single OSPF autonomous system.



The third example illustrates a more complex example of configuration with various OSPF tools.



An example of basic OSPF configuration

The following example illustrates a simple OSPF configuration. Activate routing process 90 , then connect the Ethernet interface 0 to area 0.0.0.0. Meanwhile, redistribute RIP to OSPF, OSPF to RIP.

interface ethernet 1/0

  ip address 130.130.1.1 255.255.255.0

  ip ospf cost 1

!

interface ethernet 1/0

  ip address 130.130.1.1 255.255.255.0

!

router ospf 90

  network 130.130.0.0 255.255.0.0 area 0

  redistribute rip

!

router rip

  network 130.130.0.0

  redistribute ospf 90

An example of the basic configuration of inner router, ABR and ASBR



The following example allocates 4 areas ID for 4 IP address range. Firstly, routing process 109 is activated, the 4 areas are: 10.9.5.0, 2, 3, 0. The masks of area 10.9.50.0,2,3 designate the address range, but area 0 includes all the networks.

router ospf 109

  network 131.108.20.0 255.255.255.0 area 10.9.50.0

  network 131.108.0.0 255.255.0.0 area 2

  network 131.109.10.0 255.255.255.0 area 3

  network 0.0.0.0 0.0.0.0 area 0

!

! Interface Ethernet1/0 is in area 10.9.50.0:

interface ethernet 1/0

  ip address 131.108.20.5 255.255.255.0

!

! Interface Ethernet1/1 is in area 2:

interface ethernet 1/1

  ip address 131.108.1.5 255.255.255.0

!

! Interface Ethernet1/2 is in area 2:

interface ethernet 1/2

  ip address 131.108.2.5 255.255.255.0

!

! Interface Ethernet1/3 is in area 3:

interface ethernet 1/3

  ip address 131.109.10.5 255.255.255.0

!

! Interface Ethernet1/4 is in area 0:

interface ethernet 1/4

  ip address 131.109.1.1 255.255.255.0

!

! Interface FastEthernet0/0 is in area 0:

interface FastEthernet0/0

  ip address 10.1.0.1 255.255.0.0

The functions of network area configuration command are ordinal, so the order of the commands is important. The router matches the address/mask pair of each interface in order. For detailed information, please refer to the related content in the reference of related network protocol command in “OSPF command”.

Let’s return to the first network area in the above example. The area ID 10.9.50.0 is configured with an interface sub-network mask as 131.108.20.0. So Ethernet interface 0 matches. So Ethernet interface 0 only exists in area 10.0.50.0.

Then come to the second area. Except interface 0, apply the same process on other interfaces, then Ethernet interface 1 matches. So interface 1 connects to area2.

Continue the matching of other network areas. NOTICE that the last network area command is a special case, which means that the rest interfaces are all connected to network area 0.

An example of the complex configuration of interior router, ABR and ASBR. 

The following example illustrates the configuration of several routers in a single OSPF autonomous system. Figure 24 is the network topology of the example:

Configure the router according to the above Figure:

routerA

interface loopback 0/0

  ip address 202.96.207.81 255.255.255.0

!

interface Ethernet 1/0

  ip address 192.168.10.81 255.255.255.0

!

interface ethernet 1/0

  ip address 192.160.10.81 255.255.255.0

!

router ospf 192

  network 192.168.10.0 255.255.255.0 area 1

  network 192.160.10.0 255.255.255.0 area 0

!

routerB

interface loopback 0/0

  ip address 202.96.209.82 255.255.255.252

!

interface Ethernet 1/0

  ip address 192.168.10.82 255.255.255.0

!

interface ethernet 1/1

  ip address 192.160.20.82 255.255.255.0

!

router ospf 192

  network 192.168.20.0 255.255.255.0 area 1

  network 192.168.10.0 255.255.255.0 area 1

!

routerC

interface loopback 0/0

  ip address 202.96.208.83 255.255.255.252

!

interface Ethernet 1/0

  ip address 192.163.20.83 255.255.255.0

!

interface ethernet 1/1

  ip address 192.160.20.83 255.255.255.0

!

router ospf 192

  network 192.168.20.0 255.255.255.0 area 1

  network 192.163.20.0 255.255.255.0 area 0

!

Configure complex OSPF on ABR router

The following example shows some tasks regarding the configuration of ABR. It can be divided into the following two directories:

1. Basic OSPF configuration:

2. Route distribution:

Here is the brief description of the task in this configuration. Figure 25 illustrates the allocation of network address range and area.

The basic configuration task of the example is shown as the following:

Configure address range for Ethernet interface 0 to 3.

Activate OSPF on every interface.

Configure OSPF authentication password for each area and network.

Set the link priority and other interface parameters.

Create Stub area 36.0.0.0. (NOTICE: Use a separate command “area” for the setting of authentication and Stub area parameters. You can also use a command to set these parameters.)

Set backbone area (Area 0)

The configuration tasks related to distribution are as follow:

Configuration of parameters for the distribution of IGRP and RIP routes to enter into OSPF domain. (including metric-type, metric, tag, and subnet)

The distribution of IGRP and OSPF routes to enter into RIP.

Here is an example of OSPF configuration:

interface ethernet 1/0

  ip address 192.168.20.81 255.255.255.0

  ip ospf password GHGHGHG

  ip ospf cost 10

!

interface ethernet 1/1

  ip address 192.168.30.81 255.255.255.0

  ip ospf password ijklmnop

  ip ospf cost 20

  ip ospf retransmit-interval 10

  ip ospf transmit-delay 2

  ip ospf priority 4

!

interface ethernet 1/2

  ip address 192.168.40.81 255.255.255.0

  ip ospf password abcdefgh

  ip ospf cost 10

!

interface ethernet 1/3

  ip address 192.168.0.81 255.255.255.0

  ip ospf password ijklmnop

  ip ospf cost 20

  ip ospf dead-interval 80

!

router ospf 192

  network 192.168.0.0 255.255.255.0 area 0

  network 192.168.20.0 255.255.255.0 area 192.168.20.0

  network 192.168.30.0 255.255.255.0 area 192.168.30.0

  network 192.168.40.0 255.255.255.0 area 192.168.40.0

  area 0 authentication simple

  area 192.168.20.0 stub

  area 192.168.20.0 authentication simple

  area 192.168.20.0 default-cost 20

  area 192.168.20.0 authentication simple

  area 192.168.20.0 range 36.0.0.0 255.0.0.0

  area 192.168.30.0 range 192.42.110.0 255.255.255.0

  area 0 range 130.0.0.0 255.0.0.0

  area 0 range 141.0.0.0 255.0.0.0

  redistribute rip

RIP on network 192.168.30.0

router rip

  network 192.168.30.0

  redistribute ospf 192