四、验证配置结果
# 通过show poe interface可以查看到配置信息以及供电信息。
DeviceA# show poe interface gigabitEthernet 0/1
Interface : gi0/1
Power enabled : enable
Power status : on
Max power : 15.4W
Current power : 14.8 W
Average power : 14.8 W
Peak power : 14.8 W
LLDP requested power : N/A
LLDP allocated power : N/A
Voltage : 53.5 V
Current : 278 mA
PD class : 4
Trouble cause : None
Priority : critical
Legacy : off
Power-off time-range : poe-time
Power management : auto
4pair status : normal
四、验证配置结果
# 通过show poe powersupply可以查看到配置信息以及供电信息。
DeviceA# show poe powersupply
Device member : 1
Power management : energy-saving
PSE total power : 125.0 W
PSE total power consumption : 15.0 W
PSE available power : 125.0 W
PSE total remain power : 110.0 W
PSE peak power : 15.0 W
PSE average power : 13.9 W
PSE powered port : 1
PSE disconnect mode : dc
PSE warning power : 90
PSE mcu/pse version : 111/222(mcu/pse)
PSE class lldp : enable
PSE uninterruptible-power : disable
PSE fast on : disable
五、验证配置结果
# 检查Device A上使用show ip ospf database能学习到区域2的路由。
Device A# show ip ospf database
OSPF Router with ID (192.168.12.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.12.1 192.168.12.1 1025 0x80000002 0x00292E 1
192.168.12.2 192.168.12.2 3 0x80000004 0x00DA5E 2
192.168.23.3 192.168.23.3 7 (DNA) 0x80000001 0x001328 0
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
192.168.12.2 192.168.12.2 1031 0x80000001 0x00CE8E
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
192.168.23.0 192.168.12.2 820 0x80000001 0x0077CC
192.168.23.0 192.168.23.3 7 (DNA) 0x80000001 0x002414
192.168.34.0 192.168.23.3 7 (DNA) 0x80000001 0x00AA82
# OSPF基础配置。
P1(config)# router ospf 1
P1(config-router)# network 172.168.40.0 0.0.0.255 area 0
P1(config-router)# network 172.168.10.0 0.0.0.255 area 0
P1(config-router)# network 172.168.0.3 0.0.0.0 area 0
P1(config-router)# exit
# 在P1上配置骨干网MPLS信令,打开接口MPLS能力。
P1(config)# interface gigabitethernet 1/0
P1(config-GigabitEthernet 1/0)# ip address 172.168.10.2 255.255.255.0
P1(config-GigabitEthernet 1/0)# mpls ip
P1(config-GigabitEthernet 1/0)# label-switch
P1(config-GigabitEthernet 1/0)# exit
P1(config)# interface gigabitethernet 1/1
P1(config-GigabitEthernet 1/1)# ip address 172.168.40.1 255.255.255.0
P1(config-GigabitEthernet 1/1)# mpls ip
P1(config-GigabitEthernet 1/1)# label-switch
P1(config-GigabitEthernet 1/1)# exit
P1(config)# mpls ip
P1(config)# mpls router ldp
PE2(config-mpls-router)# ldp router-id interface loopback 0 force
PE2(config-mpls-router)# exit
五、验证配置结果
(1) PE1的配置验证。
# 检查PE1上存在OSPF伪链路路由。
PE1# show ip ospf 10 sham-links
Sham Link SLINK0 to address 192.168.0.2 is up
Area 0.0.0.0 source address 192.168.0.1, Cost: 1
Output interface is GigabitEthernet 1/1
Nexthop address 172.16.40.2
Transmit Delay is 1 sec, State Point-To-Point,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:01
Adjacency state Full
# 检查PE1的OSPF邻居。
PE1# show ip ospf 10 neighbor
OSPF process 10, 1 Neighbors, 1 is Full:
Neighbor ID Pri State BFD State Dead Time Address Interface
192.168.0.2 1 Full/ – – 00:00:34 192.168.0.2 SLINK0
# 检查PE1 VRF路由。
PE1# show ip route vrf VPNA
Routing Table: VPNA
Codes: C – connected, S – static, R – RIP, B – BGP
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
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Gateway of last resort is no set
C 192.168.10.0/24 is directly connected, GigabitEthernet 1/2
O 192.168.20.0/24 [110/101] via 192.168.1.2, 00:56:23, GigabitEthernet 1/2
O 192.168.30.0/24 [110/2] via 172.168.0.2, 00:00:36
O 192.168.40.0/24 [110/2] via 172.168.0.2, 00:00:36
(2) PE2的配置验证。
# 检查PE1上存在OSPF 伪链路路由。
PE2# show ip ospf 10 sham-links
Sham Link SLINK0 to address 192.168.0.1 is up
Area 0.0.0.0 source address 192.168.0.2, Cost: 1
Output interface is GigabitEthernet 1/1
Nexthop address 172.16.10.1
Transmit Delay is 1 sec, State Point-To-Point,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:01
Adjacency state Full
# 检查PE2的OSPF邻居。
PE2# show ip ospf 10 neighbor
OSPF process 10, 1 Neighbors, 1 is Full:
Neighbor ID Pri State BFD State Dead Time Address Interface
192.168.0.1 1 Full/ – – 00:00:34 192.168.0.1 SLINK0
# 检查PE2 VRF路由。
PE2# show ip route vrf VPNA
Routing Table: VPNA
Codes: C – connected, S – static, R – RIP, B – BGP
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
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default
Gateway of last resort is no set
O 192.168.10.0/24 [110/2] via 172.168.0.1, 00:00:36
O 192.168.20.0/24 [110/2] via 172.168.0.1, 00:00:36
C 192.168.30.0/24 is directly connected, GigabitEthernet 1/2
O 192.168.40.0/24 [110/101] via 192.168.30.2, 00:56:23, GigabitEthernet 1/2
六、 配置文件 ● SITEA的配置文件。
!
interface gigabitethernet 1/0
ip address 192.168.10.2 255.255.255.0
ip ospf cost 1
!
interface gigabitethernet 1/1
ip address 192.168.20.1 255.255.255.0
ip ospf cost 200
!
router ospf 10
network 192.168.10.0 255.255.255.0 area 0
network 192.168.20.0 255.255.255.0 area 0
!
●SITEB的配置文件。
!
interface gigabitethernet 1/0
ip address 192.168.30.2 255.255.255.0
ip ospf cost 1
!
interface gigabitethernet 1/1
ip address 192.168.20.2 255.255.255.0
ip ospf cost 200
!
router ospf 10
network 192.168.30.0 255.255.255.0 area 0
network 192.168.20.0 255.255.255.0 area 0
!
● PE1的配置文件。
!
ip vrf VPNA
rd 1:100
route-target both 1:100
!
interface gigabitethernet 1/1
ip address 172.168.10.1 255.255.255.0
label-switching
mpls ip
!
interface gigabitethernet 1/2
ip vrf forwarding VPNA
ip address 192.168.10.1 255.255.255.0
interface loopback 0
ip address 172.168.0.1 255.255.255.255
!
interface loopback 10
ip vrf forwarding VPNA
ip address 192.168.0.1 255.255.255.255
!
router bgp 1
neighbor 172.168.0.2 remote-as 1
neighbor 172.168.0.2 update-source loopback 0
address-family vpnv4
neighbor 172.168.0.2 activate
address-family ipv4 vrf VPNA
redistribute ospf 10
redistribute connected
!
router ospf 1
network 172.168.10.0 0.0.0.255 area 0
network 172.168.0.1 0.0.0.0 area 0
!
router ospf 10 vrf VPNA
network 192.168.10.0 255.255.255.0 area 0
redistribute bgp subnets
area 0 sham-link 192.168.0.1 192.168.0.2
!
mpls ip
mpls router ldp
ldp router-id interface loopback 0 force
!
●PE2的配置文件。
!
ip vrf VPNA
rd 1:100
route-target both 1:100
!
interface gigabitethernet 1/1
ip address 172.168.40.2 255.255.255.0
label-switching
mpls ip
!
interface gigabitethernet 1/2
ip vrf forwarding VPNA
ip address 192.168.30.1 255.255.255.0
!
interface loopback 0
ip address 172.168.0.2 255.255.255.255
!
interface loopback 10
ip vrf forwarding VPNA
ip address 192.168.0.2 255.255.255.255
!
router bgp 1
neighbor 172.168.0.1 remote-as 1
neighbor 172.168.0.1 update-source loopback 0
address-family vpnv4
neighbor 172.168.0.1 activate
address-family ipv4 vrf VPNA
redistribute ospf 10
redistribute connected
!
router ospf 1
network 172.168.40.0 0.0.0.255 area 0
network 172.168.0.2 0.0.0.0 area 0
!
router ospf 10 vrf VPNA
network 192.168.30.0 255.255.255.0 area 0
redistribute bgp subnets
area 0 sham-link 192.168.0.2 192.168.0.1
!
mpls ip
mpls router ldp
ldp router-id interface loopback 0 force
!
●P1的配置文件。
!
interface gigabitethernet 1/0
ip address 172.168.10.2 255.255.255.0
mpls ip
label-switch
!
interface gigabitethernet 1/1
ip address 172.168.40.1 255.255.255.0
mpls ip
label-switch
!
interface loopback 0
ip address 172.168.0.3 255.255.255.255
!
router ospf 1
network 172.168.40.0 0.0.0.255 area 0
network 172.168.10.0 0.0.0.255 area 0
network 172.168.0.3 0.0.0.0 area 0
!
mpls ip
mpls router ldp
ldp router-id interface loopback 0 force
!
五、验证配置结果
# 检查Device A路由表,192.168.4.0/24表项存在备份路由。
Device A# show ip route fast-reroute | begin 192.168.4.0
O 192.168.4.0/24 [ma] via 192.168.1.2, 00:39:28, GigabitEthernet 0/1
[b] via 192.168.2.2, 00:39:28, GigabitEthernet 0/2