OSPF Segment Routing和MPLS基本配置

R1

RP/0/0/CPU0:ios# show run
Mon Aug 10 10:42:30.274 UTC
Building configuration...
!! IOS XR Configuration 6.0.1
!! Last configuration change at Mon Aug 10 08:38:30 2020 by admin
!
vrf a
 address-family ipv4 unicast
  import route-target
   1:1
  !
  export route-target
   1:1
  !
 !
!
interface Loopback0
 ipv4 address 1.1.1.1 255.255.255.255
!
interface Loopback10
 vrf a
 ipv4 address 10.10.10.10 255.255.255.255
!
interface MgmtEth0/0/CPU0/0
 shutdown
!
interface GigabitEthernet0/0/0/0
 ipv4 address 12.1.1.1 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 13.1.1.1 255.255.255.0
!
interface GigabitEthernet0/0/0/2
 shutdown
!
router ospf 1
 router-id 1.1.1.1
 segment-routing global-block 16100 16199
 segment-routing mpls
 segment-routing forwarding mpls
 area 0
  interface Loopback0
   prefix-sid index 1
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
  interface GigabitEthernet0/0/0/1
   network point-to-point
  !
 !
!
router bgp 1
 bgp router-id 1.1.1.1
 address-family vpnv4 unicast
 !
 neighbor 6.6.6.6
  remote-as 1
  update-source Loopback0
  address-family vpnv4 unicast
  !
 !
 vrf a
  rd 1:1
  address-family ipv4 unicast
   redistribute connected
  !
 !
!
end

R2

 1 RP/0/0/CPU0:ios# show run
 2 Mon Aug 10 10:44:28.008 UTC
 3 Building configuration...
 4 !! IOS XR Configuration 6.0.1
 5 !! Last configuration change at Mon Aug 10 07:52:28 2020 by admin
 6 !
 7 interface Loopback0
 8  ipv4 address 2.2.2.2 255.255.255.255
 9 !
10 interface MgmtEth0/0/CPU0/0
11  shutdown
12 !
13 interface GigabitEthernet0/0/0/0
14  ipv4 address 12.1.1.2 255.255.255.0
15 !
16 interface GigabitEthernet0/0/0/1
17  ipv4 address 24.1.1.2 255.255.255.0
18 !
19 interface GigabitEthernet0/0/0/2
20  ipv4 address 23.1.1.2 255.255.255.0
21 !
22 router ospf 1
23  router-id 2.2.2.2
24  segment-routing global-block 16200 16299
25  segment-routing mpls
26  segment-routing forwarding mpls
27  area 0
28   interface Loopback0
29    prefix-sid index 2
30   !
31   interface GigabitEthernet0/0/0/0
32    network point-to-point
33   !
34   interface GigabitEthernet0/0/0/1
35    network point-to-point
36   !
37   interface GigabitEthernet0/0/0/2
38    network point-to-point
39   !
40  !
41 !
42 end

R3

 1 RP/0/0/CPU0:ios#show run
 2 Mon Aug 10 10:45:21.274 UTC
 3 Building configuration...
 4 !! IOS XR Configuration 6.0.1
 5 !! Last configuration change at Mon Aug 10 07:52:31 2020 by admin
 6 !
 7 interface Loopback0
 8  ipv4 address 3.3.3.3 255.255.255.255
 9 !
10 interface MgmtEth0/0/CPU0/0
11  shutdown
12 !
13 interface GigabitEthernet0/0/0/0
14  ipv4 address 35.1.1.3 255.255.255.0
15 !
16 interface GigabitEthernet0/0/0/1
17  ipv4 address 13.1.1.3 255.255.255.0
18 !
19 interface GigabitEthernet0/0/0/2
20  ipv4 address 23.1.1.3 255.255.255.0
21 !
22 router ospf 1
23  router-id 3.3.3.3
24  segment-routing global-block 16300 16399
25  segment-routing mpls
26  segment-routing forwarding mpls
27  area 0
28   interface Loopback0
29    prefix-sid index 3
30   !
31   interface GigabitEthernet0/0/0/0
32    network point-to-point
33   !
34   interface GigabitEthernet0/0/0/1
35    network point-to-point
36   !
37   interface GigabitEthernet0/0/0/2
38    network point-to-point
39   !
40  !
41 !
42 end

R4

 1 RP/0/0/CPU0:ios#show run
 2 Mon Aug 10 10:46:27.810 UTC
 3 Building configuration...
 4 !! IOS XR Configuration 6.0.1
 5 !! Last configuration change at Mon Aug 10 07:52:32 2020 by admin
 6 !
 7 interface Loopback0
 8  ipv4 address 4.4.4.4 255.255.255.255
 9 !
10 interface MgmtEth0/0/CPU0/0
11  shutdown
12 !
13 interface GigabitEthernet0/0/0/0
14  ipv4 address 46.1.1.4 255.255.255.0
15 !
16 interface GigabitEthernet0/0/0/1
17  ipv4 address 24.1.1.4 255.255.255.0
18 !
19 interface GigabitEthernet0/0/0/2
20  ipv4 address 45.1.1.4 255.255.255.0
21 !
22 router ospf 1
23  router-id 4.4.4.4
24  segment-routing global-block 16400 16499
25  segment-routing mpls
26  segment-routing forwarding mpls
27  area 0
28   interface Loopback0
29    prefix-sid index 4
30   !
31   interface GigabitEthernet0/0/0/0
32    network point-to-point
33   !
34   interface GigabitEthernet0/0/0/1
35    network point-to-point
36   !
37   interface GigabitEthernet0/0/0/2
38    network point-to-point
39   !
40  !
41 !
42 end

R5

 1 RP/0/0/CPU0:ios#show run
 2 Mon Aug 10 10:47:00.687 UTC
 3 Building configuration...
 4 !! IOS XR Configuration 6.0.1
 5 !! Last configuration change at Mon Aug 10 07:52:35 2020 by admin
 6 !
 7 interface Loopback0
 8  ipv4 address 5.5.5.5 255.255.255.255
 9 !
10 interface MgmtEth0/0/CPU0/0
11  shutdown
12 !
13 interface GigabitEthernet0/0/0/0
14  ipv4 address 35.1.1.5 255.255.255.0
15 !
16 interface GigabitEthernet0/0/0/1
17  ipv4 address 56.1.1.5 255.255.255.0
18 !
19 interface GigabitEthernet0/0/0/2
20  ipv4 address 45.1.1.5 255.255.255.0
21 !
22 router ospf 1
23  router-id 5.5.5.5
24  segment-routing global-block 16500 16599
25  segment-routing mpls
26  segment-routing forwarding mpls
27  area 0
28   interface Loopback0
29    prefix-sid index 5
30   !
31   interface GigabitEthernet0/0/0/0
32    network point-to-point
33   !
34   interface GigabitEthernet0/0/0/1
35    network point-to-point
36   !
37   interface GigabitEthernet0/0/0/2
38    network point-to-point
39   !
40  !
41 !
42 end

R6

 1 RP/0/0/CPU0:ios#show run
 2 Mon Aug 10 10:47:25.606 UTC
 3 Building configuration...
 4 !! IOS XR Configuration 6.0.1
 5 !! Last configuration change at Mon Aug 10 08:45:41 2020 by admin
 6 !
 7 vrf a
 8  address-family ipv4 unicast
 9   import route-target
10    1:1
11   !
12   export route-target
13    1:1
14   !
15  !
16 !
17 interface Loopback0
18  ipv4 address 6.6.6.6 255.255.255.255
19 !
20 interface Loopback10
21  vrf a
22  ipv4 address 60.60.60.60 255.255.255.255
23 !
24 interface Loopback20
25  vrf a
26  ipv4 address 66.66.66.66 255.255.255.255
27 !
28 interface MgmtEth0/0/CPU0/0
29  shutdown
30 !
31 interface GigabitEthernet0/0/0/0
32  ipv4 address 46.1.1.6 255.255.255.0
33 !
34 interface GigabitEthernet0/0/0/1
35  ipv4 address 56.1.1.6 255.255.255.0
36 !
37 interface GigabitEthernet0/0/0/2
38  ipv4 address 67.1.1.6 255.255.255.0
39 !
40 router ospf 1
41  router-id 6.6.6.6
42  segment-routing global-block 16600 16699
43  segment-routing mpls
44  segment-routing forwarding mpls
45  area 0
46   interface Loopback0
47    prefix-sid index 6
48   !
49   interface GigabitEthernet0/0/0/0
50    network point-to-point
51   !
52   interface GigabitEthernet0/0/0/1
53    network point-to-point
54   !
55   interface GigabitEthernet0/0/0/2
56    network point-to-point
57   !
58  !
59 !
60 router bgp 1
61  bgp router-id 6.6.6.6
62  address-family vpnv4 unicast
63  !
64  neighbor 1.1.1.1
65   remote-as 1
66   update-source Loopback0
67   address-family vpnv4 unicast
68   !
69  !
70  vrf a
71   rd 1:1
72   address-family ipv4 unicast
73    redistribute connected
74   !
75  !
76 !
77 end

 

R1

 1 RP/0/0/CPU0:ios#ping vrf a 66.66.66.66 source loopback10 
 2 Mon Aug 10 10:48:21.170 UTC
 3 Type escape sequence to abort.
 4 Sending 5, 100-byte ICMP Echos to 66.66.66.66, timeout is 2 seconds:
 5 !!!!!
 6 Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/9 ms
 7 RP/0/0/CPU0:ios#ping vrf a 60.60.60.60  source loopback10
 8 Mon Aug 10 10:48:34.620 UTC
 9 Type escape sequence to abort.
10 Sending 5, 100-byte ICMP Echos to 60.60.60.60, timeout is 2 seconds:
11 !!!!!
12 Success rate is 100 percent (5/5), round-trip min/avg/max = 9/11/19 ms

R1

 1 RP/0/0/CPU0:ios#show cef vrf a 66.66.66.66/32
 2 Mon Aug 10 10:49:50.894 UTC
 3 %Prefix not found or IP is not running. VRF **nVSatellite.
 4 
 5 VRF: a
 6 _____________
 7 66.66.66.66/32, version 4, internal 0x5000001 0x0 (ptr 0xa1426574) [1], 0x0 (0x0), 0x208 (0xa155b348)
 8  Updated Aug 10 08:45:41.024
 9  Prefix Len 32, traffic index 0, precedence n/a, priority 3
10    via 6.6.6.6/32, 3 dependencies, recursive [flags 0x6000]
11     path-idx 0 NHID 0x0 [0xa15c45f4 0x0]
12     recursion-via-/32
13     next hop VRF - 'default', table - 0xe0000000
14     next hop 6.6.6.6/32 via 16106/0/21
15      next hop 12.1.1.2/32 Gi0/0/0/0    labels imposed {16206 24004}
16      next hop 13.1.1.3/32 Gi0/0/0/1    labels imposed {16306 24004}

R1

 1 RP/0/0/CPU0:ios#show mpls forwarding 
 2 Mon Aug 10 10:50:53.900 UTC
 3 Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
 4 Label  Label       or ID              Interface                    Switched    
 5 ------ ----------- ------------------ ------------ --------------- ------------
 6 16102  Pop         SR Pfx (idx 2)     Gi0/0/0/0    12.1.1.2        0           
 7 16103  Pop         SR Pfx (idx 3)     Gi0/0/0/1    13.1.1.3        0           
 8 16104  16204       SR Pfx (idx 4)     Gi0/0/0/0    12.1.1.2        0           
 9 16105  16305       SR Pfx (idx 5)     Gi0/0/0/1    13.1.1.3        0           
10 16106  16206       SR Pfx (idx 6)     Gi0/0/0/0    12.1.1.2        680940      
11        16306       SR Pfx (idx 6)     Gi0/0/0/1    13.1.1.3        1673735     
12 24000  Pop         SR Adj (idx 0)     Gi0/0/0/0    12.1.1.2        0           
13 24001  Pop         SR Adj (idx 0)     Gi0/0/0/0    12.1.1.2        0           
14 24002  Pop         SR Adj (idx 0)     Gi0/0/0/1    13.1.1.3        0           
15 24003  Pop         SR Adj (idx 0)     Gi0/0/0/1    13.1.1.3        0           
16 24004  Aggregate   a: Per-VRF Aggr[V] a                            655720      

 

不建议路由域中使用不同的SRGB。

在R3的接口抓包。

IGP控制平面报文

 

posted @ 2020-08-10 18:52  贾春旺  阅读(596)  评论(0编辑  收藏  举报