1. 程式人生 > 實用技巧 >ospf sr

ospf sr

root@mpls4:~# cat /etc/frr/frr.conf
# default to using syslog. /etc/rsyslog.d/45-frr.conf places the log
# in /var/log/frr/frr.log

frr version 7.3.1
frr defaults traditional
hostname mpls3
log file /var/log/frr/ospfd.log
log syslog informational
service integrated-vtysh-config
!
interface enp1s0
ip address 172.16.0.10/30
ip ospf area 0.0.0.0

!
interface enp7s0
ip address 172.16.0.14/30
ip ospf area 0.0.0.0
!
interface enp8s0
ip address 172.16.0.18/30
ip ospf area 0.0.0.0
!
interface lo
ip address 192.168.0.4/32
ip ospf area 0.0.0.0
!
router ospf
ospf router-id 192.168.0.4
passive-interface lo
capability opaque
mpls-te on
mpls-te router-address 192.168.0.4
segment-routing on
segment-routing global-block 16000 19999
segment-routing node-msd 11
segment-routing prefix 192.168.0.4/32 index 1004
router-info area
!
line vty
!
root@mpls4:~#

段路由全域性塊SRGB

mpls4# show ip ospf database 

       OSPF Router with ID (192.168.0.4)

                Router Link States (Area 0.0.0.0)

Link ID         ADV Router      Age  Seq#       CkSum  Link count
192.168.0.1 192.168.0.1 699 0x8000003b 0x1d55 3 192.168.0.2 192.168.0.2 712 0x80000073 0xd5ef 4 192.168.0.3 192.168.0.3 722 0x80000041 0xc9ac 5 192.168.0.4 192.168.0.4 1657 0x80000060 0x338f 5 Net Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# CkSum 172.16.0.6 192.168.0.3 42 0x80000007 0x7cd3 172.16.0.10 192.168.0.4 1557 0x80000009 0x4efa 172.16.0.14 192.168.0.4 1407 0x80000008 0x3213 172.16.0.18 192.168.0.4 1637 0x80000004 0x1c28 192.168.122.35 192.168.0.3 732 0x80000004 0xfd0e Area-Local Opaque-LSA (Area 0.0.0.0) Opaque-Type/Id ADV Router Age Seq# CkSum 4.0.0.0 192.168.0.1 1469 0x8000000d 0x536a 4.0.0.0 192.168.0.2 742 0x8000000c 0x7745 4.0.0.0 192.168.0.3 712 0x80000013 0x8b28 4.0.0.0 192.168.0.4 1647 0x80000018 0xa309 7.0.0.1 192.168.0.1 1469 0x8000000e 0xd6d7 7.0.0.1 192.168.0.2 1652 0x8000000e 0xf8b2 7.0.0.1 192.168.0.3 1452 0x8000000e 0x1b8d 7.0.0.1 192.168.0.4 1367 0x8000000c 0x4166 8.0.0.3 192.168.0.1 1569 0x80000003 0xc08d 8.0.0.4 192.168.0.2 32 0x80000006 0x2a27 mpls4# show ip ospf database segment-routing adv-router 192.168.0.1 OSPF Segment Routing database for ID 192.168.0.4 SR-Node: 192.168.0.1 SRGB (Size/Label): 4000/16000 Algorithm(s): SPF MSD: 8 Prefix or Link Label In Label Out Node or Adj. SID Interface Nexthop ------------------ -------- --------- --------------------- --------- --------------- 192.168.0.1/32 17001 pop SR Pfx (idx 1001) enp1s0 172.16.0.9 mpls4#

mpls4# show ip ospf database opaque-area  segment-routing adv-router 192.168.0.1
% Unknown command: show ip ospf database opaque-area  segment-routing adv-router 192.168.0.1
mpls4# show ip ospf database opaque-area   adv-router 192.168.0.1

       OSPF Router with ID (192.168.0.4)


                Area-Local Opaque-LSA (Area 0.0.0.0)

  LS age: 1659
  Options: 0x42 : *|O|-|-|-|-|E|-
  LS Flags: 0x6  
  LS Type: Area-Local Opaque-LSA
  Link State ID: 4.0.0.0 (Area-Local Opaque-Type/ID)
  Advertising Router: 192.168.0.1
  LS Seq Number: 8000000d
  Checksum: 0x536a
  Length: 60

  Opaque-Type 4 (Router Information LSA)
  Opaque-ID   0x0
  Opaque-Info: 40 octets of data
  Router Capabilities: 0x10000000
  Segment Routing Algorithm TLV:
    Algorithm 0: SPF
  Segment Routing Range TLV:
    Range Size = 4000
    SID Label = 16000

  Segment Routing MSD TLV:
    Node Maximum Stack Depth = 8

  LS age: 1659
  Options: 0x42 : *|O|-|-|-|-|E|-
  LS Flags: 0x6  
  LS Type: Area-Local Opaque-LSA
  Link State ID: 7.0.0.1 (Area-Local Opaque-Type/ID)
  Advertising Router: 192.168.0.1
  LS Seq Number: 8000000e
  Checksum: 0xd6d7
  Length: 44

  Opaque-Type 7 (Extended Prefix Opaque LSA)
  Opaque-ID   0x1
  Opaque-Info: 24 octets of data
  Extended Prefix TLV: Length 20
        Route Type: 1
        Address Family: 0x0
        Flags: 0x40
        Address: 192.168.0.1/32
  Prefix SID Sub-TLV: Length 8
        Algorithm: 0
        Flags: 0x0
        MT-ID:0x0
        Index: 1001

  LS age: 19
  Options: 0x42 : *|O|-|-|-|-|E|-
  LS Flags: 0x6  
  LS Type: Area-Local Opaque-LSA
  Link State ID: 8.0.0.3 (Area-Local Opaque-Type/ID)
  Advertising Router: 192.168.0.1
  LS Seq Number: 80000004
  Checksum: 0xbe8e
  Length: 60

  Opaque-Type 8 (Extended Link Opaque LSA)
  Opaque-ID   0x3
  Opaque-Info: 40 octets of data
  Extended Link TLV: Length 36
        Link Type: 0x2
        Link ID: 172.16.0.10
        Link data: 172.16.0.9
  Adj-SID Sub-TLV: Length 7
        Flags: 0xe0
        MT-ID:0x0
        Weight: 0x0
        Label: 50000
  Adj-SID Sub-TLV: Length 7
        Flags: 0x60
        MT-ID:0x0
        Weight: 0x0
        Label: 50001

mpls4#