Using ip ospf area Command.
by David Sudjiman ~ July 20th, 2008. Filed under: Cisco.
Command ip ospf area can be used to simplify the configuration. The idea is that you don’t need to enable network area command yet you only need to explicitly enable ip ospf area per-interface basis and by this command your point-to-point network will be automatically advertised.
Let’s look at this example below.
rtr1 directly connected to rtr2 and each router has its own loopback address. OSPF area 1 is being used accross these routers and ospf network type is point-to-point.
Below is the result before the command ip ospf area being implemented.
rtr1#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
20.20.20.20 0 FULL/ - 00:00:36 192.168.1.2 FastEthernet0/0
rtr1(config-if)#do sh ip route
Gateway of last resort is not set
20.0.0.0/32 is subnetted, 1 subnets
O 20.20.20.20 [110/2] via 192.168.1.2, 00:00:44, FastEthernet0/0
10.0.0.0/32 is subnetted, 1 subnets
C 10.10.10.10 is directly connected, Loopback0
192.168.1.0/30 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
rtr2(config-if)#do sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
10.10.10.10 0 FULL/ - 00:00:37 192.168.1.1 FastEthernet0/0
rtr2#sh ip route
Gateway of last resort is not set
20.0.0.0/32 is subnetted, 1 subnets
C 20.20.20.20 is directly connected, Loopback0
10.0.0.0/32 is subnetted, 1 subnets
O 10.10.10.10 [110/2] via 192.168.1.1, 00:01:40, FastEthernet0/0
192.168.1.0/30 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
And these are the results after command ip ospf area being implemented.
rtr1#sh run int f0/0
Building configuration...
Current configuration : 148 bytes
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.252
ip ospf network point-to-point
ip ospf 1 area 0
duplex auto
speed auto
end
rtr1#sh run | s router ospf
router ospf 1
log-adjacency-changes
network 10.10.10.10 0.0.0.0 area 0
rtr1#sh ip route
Gateway of last resort is not set
20.0.0.0/32 is subnetted, 1 subnets
O 20.20.20.20 [110/2] via 192.168.1.2, 00:25:13, FastEthernet0/0
10.0.0.0/32 is subnetted, 1 subnets
C 10.10.10.10 is directly connected, Loopback0
192.168.1.0/30 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
rtr2#sh run int f0/0
Building configuration...
Current configuration : 148 bytes
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.252
ip ospf network point-to-point
ip ospf 1 area 0
duplex auto
speed auto
end
rtr2#sh run | s router ospf
router ospf 1
log-adjacency-changes
network 20.20.20.20 0.0.0.0 area 0
rtr2#sh ip route
Gateway of last resort is not set
20.0.0.0/32 is subnetted, 1 subnets
C 20.20.20.20 is directly connected, Loopback0
10.0.0.0/32 is subnetted, 1 subnets
O 10.10.10.10 [110/2] via 192.168.1.1, 00:26:13, FastEthernet0/0
192.168.1.0/30 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
Source http://www.cisco.com/en/US/docs/ios/12_0s/feature/guide/ospfarea.html
