OcNOS-SP : Layer 3 Guide : Layer 3 Unicast Configuration Guide : OSPFv3 : Cost
Cost
Make a route the preferred route by changing its cost. In this example, cost has been configured to make R2 the next hop for R1.
The default cost for each interface is 10. Interface eth2 on R2 has a cost of 100, and Interface eth2 on R3 has a cost of 150. The total cost to reach 10.10.14.0/24 (R4) through R2 and R3 is computed as follows:
R2: 10+100 = 110
R3: 10+150 = 160
For this reason, R1 chooses R2 as its next hop to destination 10.10.14.0/24, because it has the lower cost.
Topology
Figure 12-90: Configure Cost OSPFv3
Configuration
R1
 
#configure terminal
Enter configure mode.
(config)#router ipv6 ospf
Create an OSPFv3 routing instance.
(config-router)#router-id 10.10.10.10
Specify a Router ID (10.10.10.10) for the OSPFv3 routing process.
(config-router)#exit
Exit OSPF router mode.
(config)#interface eth3
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-if)#exit
Exit interface mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-if)#exit
Exit interface mode.
(config)#interface eth2
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-router)#commit
Commit the candidate configuration to the running configuration.
R2
 
(config)#router ipv6 ospf
Create an OSPFv3 routing instance.
(config-router)#router-id 10.10.11.11
Specify a Router ID (10.10.11.11) for the OSPFv3 routing process.
(config-router)#exit
Exit OSPF router mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-if)#exit
Exit interface mode.
(config)#interface eth2
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-if)#ipv6 ospf cost 100
Set the cost of the link-state metric (on eth2) to 100.
(config-router)#commit
Commit the candidate configuration to the running configuration.
R3
 
(config)#router ipv6 ospf
Create an OSPFv3 routing instance.
(config-router)#router-id 10.10.13.13
Specify a Router ID (10.10.13.13) for the OSPFv3 routing process.
(config-router)#exit
Exit OSPF router mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-if)#exit
Exit interface mode.
(config)#interface eth2
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-if)#ipv6 ospf cost 150
Set the cost of link-state metric to 150.
(config-router)#commit
Commit the candidate configuration to the running configuration.
R4
 
(config)#router ipv6 ospf
Create an OSPFv3 routing instance.
(config-router)#router-id 10.10.14.14
Specify a Router ID (10.10.14.14) for the OSPFv3 routing process.
(config-router)#exit
Exit OSPF router mode.
(config)#interface eth3
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-if)#exit
Exit interface mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ipv6 router ospf area 0
Enable OSPFv3 routing on an interface, and assign the Area ID (0).
(config-router)#commit
Commit the candidate configuration to the running configuration.
Validation
R1
 
R1#show ipv6 ospf neighbor
OSPFv3 Process (*null*)
Neighbor ID Pri State Dead Time Interface Instance ID
10.10.13.13 1 Full/Backup 00:00:37 eth1 0
10.10.11.11 1 Full/Backup 00:00:34 eth3 0
 
 
R1#show ipv6 ospfv3 topology
 
OSPFv3 Process (*null*)
OSPFv3 paths to Area (0.0.0.0) routers
Router ID Bits Metric Next-Hop Interface
10.10.10.10 --
10.10.11.11 1 10.10.11.11 eth3
10.10.13.13 1 10.10.13.13 eth1
10.10.14.14 101 10.10.11.11 eth3
 
 
 
rtr1#show ipv6 ospf database
 
OSPFv3 Router with ID (10.10.10.10) (Process *null*)
 
Link-LSA (Interface eth1)
 
Link State ID ADV Router Age Seq# CkSum Prefix
0.0.0.3 10.10.10.10 868 0x80000003 0x4839 1
0.0.0.3 10.10.13.13 747 0x80000003 0x5544 1
 
Link-LSA (Interface eth3)
 
Link State ID ADV Router Age Seq# CkSum Prefix
0.0.0.5 10.10.10.10 898 0x80000003 0xf33e 1
0.0.0.3 10.10.11.11 817 0x80000003 0xce7b 1
 
Router-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum Link
0.0.0.0 10.10.10.10 58 0x80000008 0xabaf 2
0.0.0.0 10.10.11.11 1767 0x80000008 0x26cd 2
0.0.0.0 10.10.13.13 1753 0x80000008 0x9724 2
0.0.0.0 10.10.14.14 1753 0x80000007 0x96b5 2
 
Network-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum
0.0.0.3 10.10.10.10 58 0x80000003 0x4341
0.0.0.5 10.10.10.10 163 0x80000003 0xf88d
0.0.0.4 10.10.11.11 1767 0x80000002 0x5c22
0.0.0.4 10.10.13.13 1753 0x80000002 0x680e
 
Intra-Area-Prefix-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum Prefix Reference
0.0.0.1 10.10.10.10 813 0x80000003 0xd34b 1 Network-LSA
0.0.0.2 10.10.10.10 743 0x80000003 0xcb53 1 Network-LSA
0.0.0.2 10.10.11.11 652 0x80000003 0xf91f 1 Network-LSA
0.0.0.3 10.10.13.13 684 0x80000003 0x22ec 1 Network-LSA
Intra-Area-Te-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum
0.0.0.3 10.10.10.10 868 0x80000004 0x4fe8
0.0.0.5 10.10.10.10 898 0x80000004 0x39fb
0.0.0.3 10.10.11.11 817 0x80000004 0x72c1
0.0.0.4 10.10.11.11 802 0x80000005 0xe1ea
0.0.0.3 10.10.13.13 747 0x80000004 0x5ad6
0.0.0.4 10.10.13.13 727 0x80000005 0x8f02
0.0.0.3 10.10.14.14 688 0x80000004 0x2df8
0.0.0.5 10.10.14.14 653 0x80000004 0x9c8c
 
 
rtr1#show ipv6 ospf route
OSPFv3 Process (*null*)
Codes: C - connected, D - Discard, 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
 
Destination Metric
Next-hop
C 3ffe:10::/64 1
directly connected, eth3, Area 0.0.0.0
C 3ffe:11::/64 1
directly connected, eth1, Area 0.0.0.0
O 3ffe:12::/64 101
via fe80::a00:27ff:fef9:2432, eth3, Area 0.0.0.0
O 3ffe:13::/64 102
via fe80::a00:27ff:fef9:2432, eth3, Area 0.0.0.0
 
 
rtr1#show ipv6 route
IPv6 Routing Table
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
N2 - OSPF NSSA external type 2, I - IS-IS, B - BGP
Timers: Uptime
 
IP Route Table for VRF "default"
C ::1/128 via ::, lo, 01:22:59
C 3ffe:10::/64 via ::, eth3, 00:51:14
C 3ffe:11::/64 via ::, eth1, 00:50:44
O 3ffe:12::/64 [110/101] via fe80::a00:27ff:fef9:2432, eth3, 00:49:33
O 3ffe:13::/64 [110/102] via fe80::a00:27ff:fef9:2432, eth3, 00:48:21
C fe80::/64 via ::, eth1, 01:13:13
K ff00::/8 [0/256] via ::, eth0, 01:22:47
 
 
 
R2
 
R2#show ipv6 ospf neighbor
OSPFv3 Process (*null*)
Neighbor ID Pri State Dead Time Interface Instance ID
10.10.10.10 1 Full/DR 00:00:32 eth1 0
10.10.14.14 1 Full/Backup 00:00:33 eth2 0
 
 
R2#show ipv6 ospfv3 topology
 
OSPFv3 Process (*null*)
OSPFv3 paths to Area (0.0.0.0) routers
Router ID Bits Metric Next-Hop Interface
10.10.10.10 1 10.10.10.10 eth1
10.10.11.11 --
10.10.13.13 2 10.10.10.10 eth1
10.10.14.14 100 10.10.14.14 eth2
 
 
 
R2#show ipv6 ospf database
 
OSPFv3 Router with ID (10.10.11.11) (Process *null*)
 
Link-LSA (Interface eth1)
 
Link State ID ADV Router Age Seq# CkSum Prefix
0.0.0.5 10.10.10.10 1373 0x80000003 0xf33e 1
0.0.0.3 10.10.11.11 1290 0x80000003 0xce7b 1
 
Link-LSA (Interface eth2)
 
Link State ID ADV Router Age Seq# CkSum Prefix
0.0.0.4 10.10.11.11 1275 0x80000003 0x802a 1
0.0.0.5 10.10.14.14 1126 0x80000003 0x4f29 1
 
Router-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum Link
0.0.0.0 10.10.10.10 533 0x80000008 0xabaf 2
0.0.0.0 10.10.11.11 440 0x80000009 0x24ce 2
0.0.0.0 10.10.13.13 427 0x80000009 0x9525 2
0.0.0.0 10.10.14.14 426 0x80000008 0x94b6 2
 
Network-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum
0.0.0.3 10.10.10.10 533 0x80000003 0x4341
0.0.0.5 10.10.10.10 638 0x80000003 0xf88d
0.0.0.4 10.10.11.11 440 0x80000003 0x5a23
0.0.0.4 10.10.13.13 427 0x80000003 0x660f
 
Intra-Area-Prefix-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum Prefix Reference
0.0.0.1 10.10.10.10 1288 0x80000003 0xd34b 1 Network-LSA
0.0.0.2 10.10.10.10 1218 0x80000003 0xcb53 1 Network-LSA
0.0.0.2 10.10.11.11 1125 0x80000003 0xf91f 1 Network-LSA
0.0.0.3 10.10.13.13 1158 0x80000003 0x22ec 1 Network-LSA
Intra-Area-Te-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum
0.0.0.3 10.10.10.10 1343 0x80000004 0x4fe8
0.0.0.5 10.10.10.10 1373 0x80000004 0x39fb
0.0.0.3 10.10.11.11 1290 0x80000004 0x72c1
0.0.0.4 10.10.11.11 1275 0x80000005 0xe1ea
0.0.0.3 10.10.13.13 1223 0x80000004 0x5ad6
0.0.0.4 10.10.13.13 1203 0x80000005 0x8f02
0.0.0.3 10.10.14.14 1161 0x80000004 0x2df8
0.0.0.5 10.10.14.14 1126 0x80000004 0x9c8c
 
 
R2#show ipv6 ospf route
OSPFv3 Process (*null*)
Codes: C - connected, D - Discard, 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
 
Destination Metric
Next-hop
C 3ffe:10::/64 1
directly connected, eth1, Area 0.0.0.0
O 3ffe:11::/64 2
via fe80::a00:27ff:fe6e:21d8, eth1, Area 0.0.0.0
C 3ffe:12::/64 100
directly connected, eth2, Area 0.0.0.0
O 3ffe:13::/64 101
via fe80::a00:27ff:fe01:c94d, eth2, Area 0.0.0.0
 
 
R2#show ipv6 route
IPv6 Routing Table
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
N2 - OSPF NSSA external type 2, I - IS-IS, B - BGP
Timers: Uptime
 
IP Route Table for VRF "default"
C ::1/128 via ::, lo, 01:26:25
C 3ffe:10::/64 via ::, eth1, 00:54:14
O 3ffe:11::/64 [110/2] via fe80::a00:27ff:fe6e:21d8, eth1, 00:55:03
C 3ffe:12::/64 via ::, eth2, 00:53:58
O 3ffe:13::/64 [110/101] via fe80::a00:27ff:fe01:c94d, eth2, 00:52:43
C fe80::/64 via ::, eth2, 01:20:38
K ff00::/8 [0/256] via ::, eth2, 01:20:39
R3
R3#show ipv6 ospf neighbor
OSPFv3 Process (*null*)
Neighbor ID Pri State Dead Time Interface Instance ID
10.10.10.10 1 Full/DR 00:00:33 eth1 0
10.10.14.14 1 Full/Backup 00:00:38 eth2 0
 
 
 
R3#show ipv6 ospfv3 topology
 
OSPFv3 Process (*null*)
OSPFv3 paths to Area (0.0.0.0) routers
Router ID Bits Metric Next-Hop Interface
10.10.10.10 1 10.10.10.10 eth1
10.10.11.11 2 10.10.10.10 eth1
10.10.13.13 --
10.10.14.14 102 10.10.10.10 eth1
 
 
R3#
R3#show ipv6 ospf database
 
OSPFv3 Router with ID (10.10.13.13) (Process *null*)
 
Link-LSA (Interface eth1)
 
Link State ID ADV Router Age Seq# CkSum Prefix
0.0.0.3 10.10.10.10 1591 0x80000003 0x4839 1
0.0.0.3 10.10.13.13 1468 0x80000003 0x5544 1
 
Link-LSA (Interface eth2)
 
Link State ID ADV Router Age Seq# CkSum Prefix
0.0.0.4 10.10.13.13 1448 0x80000003 0x9d29 1
0.0.0.3 10.10.14.14 1409 0x80000003 0x50cf 1
 
Router-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum Link
0.0.0.0 10.10.10.10 780 0x80000008 0xabaf 2
0.0.0.0 10.10.11.11 689 0x80000009 0x24ce 2
0.0.0.0 10.10.13.13 673 0x80000009 0x9525 2
0.0.0.0 10.10.14.14 673 0x80000008 0x94b6 2
 
Network-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum
0.0.0.3 10.10.10.10 780 0x80000003 0x4341
0.0.0.5 10.10.10.10 885 0x80000003 0xf88d
0.0.0.4 10.10.11.11 689 0x80000003 0x5a23
0.0.0.4 10.10.13.13 673 0x80000003 0x660f
 
Intra-Area-Prefix-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum Prefix Reference
0.0.0.1 10.10.10.10 1536 0x80000003 0xd34b 1 Network-LSA
0.0.0.2 10.10.10.10 1466 0x80000003 0xcb53 1 Network-LSA
0.0.0.2 10.10.11.11 1374 0x80000003 0xf91f 1 Network-LSA
0.0.0.3 10.10.13.13 1403 0x80000003 0x22ec 1 Network-LSA
Intra-Area-Te-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum
0.0.0.3 10.10.10.10 1591 0x80000004 0x4fe8
0.0.0.5 10.10.10.10 1621 0x80000004 0x39fb
0.0.0.3 10.10.11.11 1539 0x80000004 0x72c1
0.0.0.4 10.10.11.11 1524 0x80000005 0xe1ea
0.0.0.3 10.10.13.13 1468 0x80000004 0x5ad6
0.0.0.4 10.10.13.13 1448 0x80000005 0x8f02
0.0.0.3 10.10.14.14 1409 0x80000004 0x2df8
0.0.0.5 10.10.14.14 1374 0x80000004 0x9c8c
 
 
R3#show ipv6 ospf route
OSPFv3 Process (*null*)
Codes: C - connected, D - Discard, 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
 
Destination Metric
Next-hop
O 3ffe:10::/64 2
via fe80::a00:27ff:fe7d:2a72, eth1, Area 0.0.0.0
C 3ffe:11::/64 1
directly connected, eth1, Area 0.0.0.0
O 3ffe:12::/64 102
via fe80::a00:27ff:fe7d:2a72, eth1, Area 0.0.0.0
O 3ffe:13::/64 103
via fe80::a00:27ff:fe7d:2a72, eth1, Area 0.0.0.0
 
 
R3#show ipv6 route
IPv6 Routing Table
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
N2 - OSPF NSSA external type 2, I - IS-IS, B - BGP
Timers: Uptime
 
IP Route Table for VRF "default"
C ::1/128 via ::, lo, 01:28:16
O 3ffe:10::/64 [110/2] via fe80::a00:27ff:fe7d:2a72, eth1, 00:58:14
C 3ffe:11::/64 via ::, eth1, 00:55:44
O 3ffe:12::/64 [110/102] via fe80::a00:27ff:fe7d:2a72, eth1, 00:56:36
C 3ffe:13::/64 via ::, eth2, 00:55:26
C fe80::/64 via ::, eth1, 01:20:39
K ff00::/8 [0/256] via ::, eth2, 01:21:40
R4
 
R4#show ipv6 ospf neighbor
OSPFv3 Process (*null*)
Neighbor ID Pri State Dead Time Interface Instance ID
10.10.13.13 1 Full/DR 00:00:30 eth1 0
10.10.11.11 1 Full/DR 00:00:30 eth3 0
 
 
 
R4#show ipv6 ospfv3 topology
 
OSPFv3 Process (*null*)
OSPFv3 paths to Area (0.0.0.0) routers
Router ID Bits Metric Next-Hop Interface
10.10.10.10 2 10.10.11.11 eth3
10.10.13.13 eth1
10.10.11.11 1 10.10.11.11 eth3
10.10.13.13 1 10.10.13.13 eth1
10.10.14.14 --
 
 
R4#show ipv6 ospf database
 
OSPFv3 Router with ID (10.10.14.14) (Process *null*)
 
Link-LSA (Interface eth1)
 
Link State ID ADV Router Age Seq# CkSum Prefix
0.0.0.4 10.10.13.13 1634 0x80000003 0x9d29 1
0.0.0.3 10.10.14.14 1592 0x80000003 0x50cf 1
 
Link-LSA (Interface eth3)
 
Link State ID ADV Router Age Seq# CkSum Prefix
0.0.0.4 10.10.11.11 1708 0x80000003 0x802a 1
0.0.0.5 10.10.14.14 1557 0x80000003 0x4f29 1
 
Router-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum Link
0.0.0.0 10.10.10.10 966 0x80000008 0xabaf 2
0.0.0.0 10.10.11.11 873 0x80000009 0x24ce 2
0.0.0.0 10.10.13.13 859 0x80000009 0x9525 2
0.0.0.0 10.10.14.14 857 0x80000008 0x94b6 2
 
Network-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum
0.0.0.3 10.10.10.10 966 0x80000003 0x4341
0.0.0.5 10.10.10.10 1071 0x80000003 0xf88d
0.0.0.4 10.10.11.11 873 0x80000003 0x5a23
0.0.0.4 10.10.13.13 859 0x80000003 0x660f
 
Intra-Area-Prefix-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum Prefix Reference
0.0.0.1 10.10.10.10 1721 0x80000003 0xd34b 1 Network-LSA
0.0.0.2 10.10.10.10 1651 0x80000003 0xcb53 1 Network-LSA
0.0.0.2 10.10.11.11 1558 0x80000003 0xf91f 1 Network-LSA
0.0.0.3 10.10.13.13 1589 0x80000003 0x22ec 1 Network-LSA
 
Intra-Area-Te-LSA (Area 0.0.0.0)
 
Link State ID ADV Router Age Seq# CkSum
0.0.0.3 10.10.10.10 1776 0x80000004 0x4fe8
0.0.0.5 10.10.10.10 6 0x80000005 0x37fc
0.0.0.3 10.10.11.11 1723 0x80000004 0x72c1
0.0.0.4 10.10.11.11 1708 0x80000005 0xe1ea
0.0.0.3 10.10.13.13 1654 0x80000004 0x5ad6
0.0.0.4 10.10.13.13 1634 0x80000005 0x8f02
0.0.0.3 10.10.14.14 1592 0x80000004 0x2df8
0.0.0.5 10.10.14.14 1557 0x80000004 0x9c8c
 
 
 
R4#show ipv6 ospf route
OSPFv3 Process (*null*)
Codes: C - connected, D - Discard, 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
 
Destination Metric
Next-hop
O 3ffe:10::/64 2
via fe80::a00:27ff:fe0d:fbe3, eth3, Area 0.0.0.0
O 3ffe:11::/64 2
via fe80::a00:27ff:fecf:8873, eth1, Area 0.0.0.0
C 3ffe:12::/64 1
directly connected, eth3, Area 0.0.0.0
C 3ffe:13::/64 1
directly connected, eth1, Area 0.0.0.0
 
 
R4#show ipv6 route
IPv6 Routing Table
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
N2 - OSPF NSSA external type 2, I - IS-IS, B - BGP
Timers: Uptime
 
IP Route Table for VRF "default"
C ::1/128 via ::, lo, 01:32:01
O 3ffe:10::/64 [110/2] via fe80::a00:27ff:fe0d:fbe3, eth3, 01:02:49
O 3ffe:11::/64 [110/2] via fe80::a00:27ff:fecf:8873, eth1, 01:02:19
C 3ffe:12::/64 via ::, eth3, 00:58:46
C 3ffe:13::/64 via ::, eth1, 00:59:18
C fe80::/64 via ::, eth1, 01:27:01
K ff00::/8 [0/256] via ::, eth3, 01:27:31
 
Last modified date: 10/16/2023