In the following example you configure a range of OSPF interfaces with the network area command.
- host1(config)#interface fastEthernet 0/0
- host1(config-if)#ip address 1.1.1.1 255.255.255.0
- host1(config-if)#ip address 2.2.2.2 255.255.255.0
secondary
- host1(config-if)#exit
- host1(config)#router ospf 1
- host1(config-router)#network 1.1.1.0 0.0.0.255
area 0
- host1(config-router)#network 2.2.2.0 0.0.0.255
area 0
If you want to specify the cost, you can do so for both interfaces simultaneously.
- host1(config)#interface fastEthernet 0/0
- host1(config-if)#ip ospf cost 30
You can use address commands to create a third OSPF interface over the Ethernet interface. When you specify a cost, you set it for only that interface.
- host1(config)#interface fastEthernet 0/0
- host1(config-if)#ip address 3.3.3.3 255.255.255.0
secondary
- host1(config-if)#exit
- host1(config)#router ospf 1
- host1(config-router)#address 3.3.3.3 area
0
- host1(config-router)#address 3.3.3.3 cost
25