Saturday, March 30, 2024

การคอนฟิก BGP Option C ด้วย BGP-LU, ISIS-SR, OSPF-SR บนอุปกรณ์ ZTE

 

การคอนฟิก BGP Option C ด้วย BGP-LU, ISIS-SR, OSPF-SR บนอุปกรณ์ ZTE


Concept
PE1 กับ PE2 จะรัน ISIS-SR โดยคอนฟิก iBGP peer หากันโดยใช้ Loopback. อาศัย BGP-LU ในการประกาศ loopback + label
PE2 กับ PE3 จะมีไม่รัน IGP และไม่ได้ enable LDP, RSVP . MPLS จะมีแค่ BGP-LU. จะมีการทำ route-map เพื่อ set label. คอนฟิก eBGP peer หากันโดยใช้ IP WAN
PE3 กับ PE4 จะเหมือนกันกับ PE1,PE2 ต่างกันแค่เปลี่ยน IGP เป็น OSPF-SR
PE1 กับ PE4 จะคอนฟิก MP-EBGP peer หากัน enable address family vpn4. ไม่ต้อง enable label unicast
PE1 กับ CE1 ที่ PE1 config vrf ใส่ ip ตามปกติ. CE1 ก็คอนฟิกใส่ IP ไม่จำเป็นต้องมี vrf. และคอนฟิก static route เพื่อให้รู้จักวงที่ฝั่ง CE2
PE4 กับ CE2 เหมือนกันกับฝั่ง PE1 กับ CE1

อ้างอิง ตัวอย่างจาก Huawei


log file  config, show status ต่างๆ และผล capture traffic เอาไว้ดู label stack

ตัวอย่าง show status ที่อยู่ใน log file

##------ PE1 verify command ----------------
terminal length 0
show running-config
show interface description
show ip interface brief
show isis adjacency
show ip forwarding route
show mpls forwarding-table
show mpls label manage
ping mpls ipv4 10.10.10.2 32 source 10.10.10.1
ping mpls ipv4 10.10.10.3 32 source 10.10.10.1
ping mpls ipv4 10.10.10.4 32 source 10.10.10.1
show segment-routing ipv4-mpls prefix-sid local
show segment-routing ipv4-mpls prefix-sid remote
show segment-routing ipv4-mpls adjacency-sid remote 
show segment-routing ipv4-mpls adjacency-sid local
show ip bgp labels
show bgp all summary
show bgp ipv4 unicast summary
show bgp vpnv4 unicast summary
show bgp ipv4 unicast neighbor 10.10.10.2
show bgp ipv4 unicast neighbor in 10.10.10.2
show bgp ipv4 unicast neighbor out 10.10.10.2
show bgp vpnv4 unicast neighbor 10.10.10.4
show bgp vpnv4 unicast neighbor in 10.10.10.4
show bgp vpnv4 unicast neighbor out 10.10.10.4
show ip bgp route detail 10.10.10.2 32
show ip bgp route detail 10.10.10.3 32
show ip bgp route detail 10.10.10.4 32
show ip forwarding route vrf Cotton

PE1 Config

hostname PE1
ip vrf Cotton
  rd 1:1
  address-family ipv4
    route-target import 1:1
    route-target export 1:1
  $
$
interface loopback0
  ip address 10.10.10.1 255.255.255.255
$
interface xxvgei-1/1/0/2
  description To_PE2
  ip address 192.168.12.1 255.255.255.0
$
interface xxvgei-1/1/0/3
  description To_CE1
$
interface xxvgei-1/1/0/3.100
  description To_CE1_VLAN100
  ip vrf forwarding Cotton
  ip address 100.1.1.1 255.255.255.0
$
vlan-configuration
  interface xxvgei-1/1/0/3.100
    encapsulation-dot1q 100
  $
$
segment-routing
  ipv4-mpls prefix-sid 10.10.10.1/32 index 10001 node-flag
$
router bgp 100
  bgp router-id 10.10.10.1
  network 10.10.10.1 255.255.255.255
  neighbor 10.10.10.2 remote-as 100
  neighbor 10.10.10.2 activate
  neighbor 10.10.10.2 send-label
  neighbor 10.10.10.2 update-source loopback0
  neighbor 10.10.10.4 remote-as 200
  neighbor 10.10.10.4 activate disable
  neighbor 10.10.10.4 ebgp-multihop ttl 3
  neighbor 10.10.10.4 update-source loopback0
  address-family vpnv4
    neighbor 10.10.10.4 activate
  $
  address-family ipv4 vrf Cotton
    redistribute connected
  $
$
router isis 1
  area 49.0001
  system-id 0100.1001.0001
  router-id 10.10.10.1
  is-type level-2-only
  metric-style wide
  segment-routing mpls enable
  interface loopback0
    circuit-type level-2-only
    ip router isis
    passive-mode
  $
  interface xxvgei-1/1/0/2
    circuit-type level-2-only
    ip router isis
    network point-to-point
  $
$

PE2 Config

hostname PE2
interface xxvgei-1/1/0/1
  description To_PE2
  ip address 192.168.23.2 255.255.255.0
$
interface xxvgei-1/1/0/2
  description To_PE1
  ip address 192.168.12.2 255.255.255.0
$
interface loopback0
  ip address 10.10.10.2 255.255.255.255
$
route-map ebgp_apply_label permit 10
  set mpls-label
$
route-map ibgp_apply_label permit 10
  match mpls-label
  set mpls-label
$
segment-routing
  ipv4-mpls prefix-sid 10.10.10.2/32 index 10002 node-flag
$
router bgp 100
  bgp router-id 10.10.10.2
  network 10.10.10.2 255.255.255.255
  neighbor 10.10.10.1 remote-as 100
  neighbor 10.10.10.1 activate
  neighbor 10.10.10.1 next-hop-self all
  neighbor 10.10.10.1 send-label
  neighbor 10.10.10.1 update-source loopback0
  neighbor 10.10.10.1 route-map ibgp_apply_label out
  neighbor 192.168.23.3 remote-as 200
  neighbor 192.168.23.3 activate
  neighbor 192.168.23.3 send-label
  neighbor 192.168.23.3 route-map ebgp_apply_label out
$
router isis 1
  area 49.0001
  system-id 0100.1001.0002
  router-id 10.10.10.2
  is-type level-2-only
  metric-style wide
  segment-routing mpls enable
  interface loopback0
    circuit-type level-2-only
    ip router isis
    passive-mode
  $
  interface xxvgei-1/1/0/2
    circuit-type level-2-only
    ip router isis
    network point-to-point
  $
$

PE3 Config

hostname PE3
interface xxvgei-1/1/0/1
  description To_PE2
  ip address 192.168.23.3 255.255.255.0
$
interface xxvgei-1/1/0/2
  description To_PE4
  ip address 192.168.34.3 255.255.255.0
$
interface loopback0
  ip address 10.10.10.3 255.255.255.255
$
route-map ebgp_apply_label permit 10
  set mpls-label
$
route-map ibgp_apply_label permit 10
  match mpls-label
  set mpls-label
$
segment-routing
  ipv4-mpls prefix-sid 10.10.10.3/32 index 10003 node-flag
$
router bgp 200
  bgp router-id 10.10.10.3
  network 10.10.10.3 255.255.255.255
  neighbor 10.10.10.4 remote-as 200
  neighbor 10.10.10.4 activate
  neighbor 10.10.10.4 next-hop-self all
  neighbor 10.10.10.4 send-label
  neighbor 10.10.10.4 update-source loopback0
  neighbor 10.10.10.4 route-map ibgp_apply_label out
  neighbor 192.168.23.2 remote-as 100
  neighbor 192.168.23.2 activate
  neighbor 192.168.23.2 send-label
  neighbor 192.168.23.2 route-map ebgp_apply_label out
$
router ospf 1
  router-id 10.10.10.3
  area 0.0.0.0
    interface loopback0
      passive
    $
    interface xxvgei-1/1/0/2
      network point-to-point
    $
  $
  segment-routing mpls enable
$

PE4 Config

hostname PE4
ip vrf Cotton
  rd 1:1
  address-family ipv4
    route-target import 1:1
    route-target export 1:1
  $
$
interface xxvgei-1/1/0/2
  description To_PE3
  ip address 192.168.34.4 255.255.255.0
$
interface xxvgei-1/1/0/3
  description To_CE2
$
interface xxvgei-1/1/0/3.100
  description To_CE2_VLAN100
  ip vrf forwarding Cotton
  ip address 100.2.2.1 255.255.255.0
$
interface loopback0
  ip address 10.10.10.4 255.255.255.255
$
vlan-configuration
  interface xxvgei-1/1/0/3.100
    encapsulation-dot1q 100
  $
$
segment-routing
  ipv4-mpls prefix-sid 10.10.10.4/32 index 10004 node-flag
$
router bgp 200
  bgp router-id 10.10.10.4
  network 10.10.10.4 255.255.255.255
  neighbor 10.10.10.1 remote-as 100
  neighbor 10.10.10.1 activate disable
  neighbor 10.10.10.1 ebgp-multihop ttl 3
  neighbor 10.10.10.1 update-source loopback0
  neighbor 10.10.10.3 remote-as 200
  neighbor 10.10.10.3 activate
  neighbor 10.10.10.3 send-label
  neighbor 10.10.10.3 update-source loopback0
  address-family vpnv4
    neighbor 10.10.10.1 activate
  $
  address-family ipv4 vrf Cotton
    redistribute connected
  $
$
router ospf 1
  router-id 10.10.10.4
  area 0.0.0.0
    interface loopback0
      passive
    $
    interface xxvgei-1/1/0/2
      network point-to-point
    $
  $
  segment-routing mpls enable
$

CE1 Config

hostname CE1
interface xxvgei-1/1/0/3
  description To_PE1
$
interface xxvgei-1/1/0/3.100
  description To_PE1_VLAN100
  ip address 100.1.1.2 255.255.255.0
$
vlan-configuration
  interface xxvgei-1/1/0/3.100
    encapsulation-dot1q 100
  $
$
ip route 100.2.2.0 255.255.255.0 xxvgei-1/1/0/3.100 100.1.1.1 name CE2

CE2 Config

hostname CE2
interface xxvgei-1/1/0/3
  description To_PE4
$
interface xxvgei-1/1/0/3.100
  description To_PE4_VLAN100
  ip address 100.2.2.2 255.255.255.0
$
vlan-configuration
  interface xxvgei-1/1/0/3.100
    encapsulation-dot1q 100
  $
$
ip route 100.1.1.0 255.255.255.0 xxvgei-1/1/0/3.100 100.2.2.1 name CE1

CE1 Ping test

CE1#ping 100.2.2.2 source 100.1.1.2
sending 5,100-byte ICMP echo(es) to 100.2.2.2,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 60/75/97 ms.
[finish]
CE1#

PE1 verify status

PE1#show isis adjacency
Process ID: 1
Interface         System id        State     Lev     Holds       SNPA(802.2)    Pri     MT   NSF       AF       
xxvgei-1/1/0/2    PE2              UP        L2      29          PPP            -            Disable   IPv4      
PE1#
PE1#show ip forwarding route
IPv4 Routing Table:
Status codes: *valid, >best, R: Relay;
    Dest               Gw              Interface          Owner       Pri Metric
*>  10.10.10.1/32      10.10.10.1      loopback0          Address     0   0     
*>  10.10.10.2/32      192.168.12.2    xxvgei-1/1/0/2     ISIS-L2     115 10    
*>  10.10.10.3/32      10.10.10.2      xxvgei-1/1/0/2     BGP         200 0     
*>  10.10.10.4/32      10.10.10.2      xxvgei-1/1/0/2     BGP         200 0     
*>  192.168.12.0/24    192.168.12.1    xxvgei-1/1/0/2     Direct      0   0     
*>  192.168.12.1/32    192.168.12.1    xxvgei-1/1/0/2     Address     0   0     
PE1#
PE1#show mpls forwarding-table
Local     Outgoing  Prefix or           Outgoing            Next Hop        M/S 
label     label     Lspname             interface                               
910001    Untagged  10.10.10.1/32       loopback0           10.10.10.1      M   
910002    910002    10.10.10.2/32       xxvgei-1/1/0/2      192.168.12.2    M   
PE1#
PE1#ping mpls ipv4 10.10.10.4 32 source 10.10.10.1
sending 5,120-byte MPLS echo(es) to 10.10.10.4,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 36/39/43 ms.
PE1#
PE1#show segment-routing ipv4-mpls prefix-sid remote
Codes: N = Node-flag; E = Explicit-null; I = Implicit-null; NH = Next-hop;
Marks: * = valid; > = best; I = ISIS; O = OSPF;
*>I 10.10.10.2/32                               SID:10002      SID-Flag:N
    Via:192.168.12.2                            Router-ID:10.10.10.2     
    NH-SID:10002                                NH-SID-Flag:N
PE1#
PE1#show ip bgp labels
Network            Next Hop      In Label/Out Label
10.10.10.1/32      10.10.10.1       notag/notag
10.10.10.2/32      10.10.10.2       notag/492018
10.10.10.3/32      10.10.10.2       notag/492020
10.10.10.4/32      10.10.10.2       notag/492019
PE1#
PE1#show bgp all summary
BGP router ID  : 10.10.10.1
Local AS       : 100
All peers      : 2
  Established  : 2
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State
10.10.10.2      4   100         77         73         01:05:15     Established
10.10.10.4      4   200         46         46         00:38:52     Established
PE1#
PE1#show bgp ipv4 unicast neighbor in 10.10.10.2
Routes Learned From This Neighbor:
Status codes: * valid, < last valid, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Local router ID 10.10.10.1, Local AS 100, Local port 20052
Remote router ID 10.10.10.2, Remote AS 100, Remote port 179
Total number of routes: 3
  Valid routes        : 3
  Invalid routes      : 0
     Network             Next Hop        Metric     LocPrf     RtPrf   Path

* i  10.10.10.2/32       10.10.10.2                 100        200     i
* i  10.10.10.3/32       10.10.10.2                 100        200     200 i
* i  10.10.10.4/32       10.10.10.2                 100        200     200 i
PE1#
PE1#show bgp ipv4 unicast neighbor out 10.10.10.2
Routes Sent To This Neighbor:
Origin codes: i - IGP, e - EGP, ? - incomplete
Total number of routes: 1
Network            Next Hop        From            Metric LocPrf Path

10.10.10.1/32      10.10.10.1                             100    i
PE1#
PE1#show bgp vpnv4 unicast neighbor in 10.10.10.4
Routes Learned From This Neighbor:
Status codes: * valid, < last valid, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Local router ID 10.10.10.1, Local AS 100, Local port 20054
Remote router ID 10.10.10.4, Remote AS 200, Remote port 179
Total number of routes: 1
  Valid routes        : 1
  Invalid routes      : 0
     Dest                Next Hop        Metric     LocPrf     InTag   Path

Route Distinguisher:1:1 (default for vrf Cotton)
*    100.2.2.0/24        10.10.10.4                            27684   200 ?
PE1#
PE1#show bgp vpnv4 unicast neighbor out 10.10.10.4
Routes Sent To This Neighbor:
Origin codes: i - IGP, e - EGP, ? - incomplete
Total number of routes: 1
Network          Next Hop        From            Metric LocPrf Tag     Path

Route Distinguisher:1:1 (default for vrf Cotton)
100.1.1.0/24     10.10.10.1                                    339776  100 ?
PE1#
PE1#show ip bgp route detail 10.10.10.4 32
BGP routing table entry for 10.10.10.4/32
02:32:53(Age 00:39:00) received from 10.10.10.2 (10.10.10.2), path-id 0
   Origin i, nexthop 10.10.10.2(metric 10), localpref 100, weight 0, rtpref 200, best, selected,
   As path [200]
   Received label  492019(0x781f3)

PE1#
PE1#show ip forwarding route vrf Cotton
Routes:  3            Route-paths:  3
IPv4 Routing Table:
Headers: Dest: Destination,  Gw: Gateway,  Pri: Priority;
Codes  : BROADC: Broadcast, USER-I: User-ipaddr, USER-S: User-special,
         MULTIC: Multicast, USER-N: User-network, DHCP-D: DHCP-DFT,
         ASBR-V: ASBR-VPN, STAT-V: Static-VRF, DHCP-S: DHCP-static,
         GW-FWD: PS-BUSI, NAT64: Stateless-NAT64, LDP-A: LDP-area,
         GW-UE: PS-USER, P-VRF: Per-VRF-label, TE: RSVP-TE, NAT-M : NAT-mask
         BP: BRAS-pool, HAGP: Hybrid-access-gateway-protocol;
Status codes: *valid, >best, R: Relay;
    Dest               Gw              Interface          Owner       Pri Metric
*>  100.1.1.0/24       100.1.1.1       xxvgei-1/1/0/3.100 Direct      0   0     
*>  100.1.1.1/32       100.1.1.1       xxvgei-1/1/0/3.100 Address     0   0     
*>  100.2.2.0/24       10.10.10.4      xxvgei-1/1/0/2     BGP         20  0     
PE1#

PE2 verify status

PE2#show isis adjacency
Process ID: 1
Interface         System id        State     Lev     Holds       SNPA(802.2)    Pri     MT   NSF       AF       
xxvgei-1/1/0/2    PE1              UP        L2      27          PPP            -            Disable   IPv4      
PE2#
PE2#show ip forwarding route
IPv4 Routing Table:
Status codes: *valid, >best, R: Relay;
    Dest               Gw              Interface          Owner       Pri Metric
*>  10.10.10.1/32      192.168.12.1    xxvgei-1/1/0/2     ISIS-L2     115 10    
*>  10.10.10.2/32      10.10.10.2      loopback0          Address     0   0     
*>  10.10.10.3/32      192.168.23.3    xxvgei-1/1/0/1     BGP         20  0     
*>  10.10.10.4/32      192.168.23.3    xxvgei-1/1/0/1     BGP         20  0     
*>  192.168.12.0/24    192.168.12.2    xxvgei-1/1/0/2     Direct      0   0     
*>  192.168.12.2/32    192.168.12.2    xxvgei-1/1/0/2     Address     0   0     
*>  192.168.23.0/24    192.168.23.2    xxvgei-1/1/0/1     Direct      0   0     
*>  192.168.23.2/32    192.168.23.2    xxvgei-1/1/0/1     Address     0   0     
PE2#
PE2#show mpls forwarding-table
Local     Outgoing  Prefix or           Outgoing            Next Hop        M/S 
label     label     Lspname             interface                               
910001    910001    10.10.10.1/32       xxvgei-1/1/0/2      192.168.12.1    M   
910002    Untagged  10.10.10.2/32       loopback0           10.10.10.2      M   
PE2#
PE2#show segment-routing ipv4-mpls prefix-sid remote
Codes: N = Node-flag; E = Explicit-null; I = Implicit-null; NH = Next-hop;
Marks: * = valid; > = best; I = ISIS; O = OSPF;
*>I 10.10.10.1/32                               SID:10001      SID-Flag:N
    Via:192.168.12.1                            Router-ID:10.10.10.1     
    NH-SID:10001                                NH-SID-Flag:N
PE2#
PE2#show ip bgp labels
Network            Next Hop      In Label/Out Label
10.10.10.1/32      10.10.10.1      492021/notag
10.10.10.2/32      10.10.10.2      492018/notag
10.10.10.3/32      192.168.23.3    492020/687931
10.10.10.4/32      192.168.23.3    492019/687932
PE2#
PE2#show bgp all summary
BGP router ID  : 10.10.10.2
Local AS       : 100
All peers      : 2
  Established  : 2
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State
10.10.10.1      4   100         78         2          01:08:54     Established
192.168.23.3    4   200         132        8          01:53:15     Established
PE2#
PE2#show bgp ipv4 unicast neighbor in 10.10.10.1
Routes Learned From This Neighbor:
Status codes: * valid, < last valid, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Local router ID 10.10.10.2, Local AS 100, Local port 179
Remote router ID 10.10.10.1, Remote AS 100, Remote port 20052
Total number of routes: 1
  Valid routes        : 1
  Invalid routes      : 0
     Network             Next Hop        Metric     LocPrf     RtPrf   Path

* i  10.10.10.1/32       10.10.10.1                 100        200     i
PE2#
PE2#show bgp ipv4 unicast neighbor out 10.10.10.1
Routes Sent To This Neighbor:
Origin codes: i - IGP, e - EGP, ? - incomplete
Total number of routes: 3
Network            Next Hop        From            Metric LocPrf Path

10.10.10.2/32      10.10.10.2                             100    i
10.10.10.3/32      10.10.10.2      192.168.23.3           100    200 i
10.10.10.4/32      10.10.10.2      192.168.23.3           100    200 i
PE2#
PE2#show bgp ipv4 unicast neighbor in 192.168.23.3
Routes Learned From This Neighbor:
Status codes: * valid, < last valid, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Local router ID 10.10.10.2, Local AS 100, Local port 179
Remote router ID 10.10.10.3, Remote AS 200, Remote port 20012
Total number of routes: 2
  Valid routes        : 2
  Invalid routes      : 0
     Network             Next Hop        Metric     LocPrf     RtPrf   Path

*    10.10.10.3/32       192.168.23.3                          20      200 i
*    10.10.10.4/32       192.168.23.3                          20      200 i
PE2#
PE2#show bgp ipv4 unicast neighbor out 192.168.23.3
Routes Sent To This Neighbor:
Origin codes: i - IGP, e - EGP, ? - incomplete
Total number of routes: 2
Network            Next Hop        From            Metric LocPrf Path

10.10.10.1/32      192.168.23.2    10.10.10.1                    100 i
10.10.10.2/32      192.168.23.2                                  100 i
PE2#
PE2#show ip bgp route detail 10.10.10.1 32
BGP routing table entry for 10.10.10.1/32
02:32:49(Age 00:42:34) received from 10.10.10.1 (10.10.10.1), path-id 0
   Origin i, nexthop 10.10.10.1(metric 10), localpref 100, weight 0, rtpref 200,
   As path
   Received label  notag
Bgp-rib-only due to next-hop-loop

02:32:49(Age 00:42:34) advertised to UpdateGroup Index: 3, 
   To 1 peer(s): 192.168.23.3
   Origin i,
   As path(to 192.168.23.3) [100]
   Sent label  492021(0x781f5)

PE2#
PE2#show ip bgp route detail 10.10.10.4 32
BGP routing table entry for 10.10.10.4/32
01:58:18(Age 01:17:05) received from 192.168.23.3 (10.10.10.3), path-id 0
   Origin i, nexthop 192.168.23.3(metric 0), weight 0, rtpref 20, best, selected,
   As path [200]
   Received label  687932(0xa7f3c)

02:06:29(Age 01:08:54) advertised to UpdateGroup Index: 5, 
   To 1 peer(s): 10.10.10.1
   Origin i, localpref 100,
   As path(to 10.10.10.1) [200]
   Sent label  492019(0x781f3)

PE2#

PE3 verify status

PE3#show ip ospf neighbor
Codes: *: Multi-Area Interface

            OSPF Router with ID (10.10.10.3) (Process ID 1)

Neighbor ID     Pri State        DeadTime  Address         Interface
10.10.10.4      1   FULL/--      00:00:38  192.168.34.4    xxvgei-1/1/0/2
PE3#
PE3#show ip forwarding route
IPv4 Routing Table:
Status codes: *valid, >best, R: Relay;
    Dest               Gw              Interface          Owner       Pri Metric
*>  10.10.10.1/32      192.168.23.2    xxvgei-1/1/0/1     BGP         20  0     
*>  10.10.10.2/32      192.168.23.2    xxvgei-1/1/0/1     BGP         20  0     
*>  10.10.10.3/32      10.10.10.3      loopback0          Address     0   0     
*>  10.10.10.4/32      192.168.34.4    xxvgei-1/1/0/2     OSPF        110 1     
*>  192.168.23.0/24    192.168.23.3    xxvgei-1/1/0/1     Direct      0   0     
*>  192.168.23.3/32    192.168.23.3    xxvgei-1/1/0/1     Address     0   0     
*>  192.168.34.0/24    192.168.34.3    xxvgei-1/1/0/2     Direct      0   0     
*>  192.168.34.3/32    192.168.34.3    xxvgei-1/1/0/2     Address     0   0     
PE3#
PE3#show mpls forwarding-table
Local     Outgoing  Prefix or           Outgoing            Next Hop        M/S 
label     label     Lspname             interface                               
910003    Untagged  10.10.10.3/32       loopback0           10.10.10.3      M   
910004    910004    10.10.10.4/32       xxvgei-1/1/0/2      192.168.34.4    M   
PE3#
PE3#show segment-routing ipv4-mpls adjacency-sid remote 
Codes: L- = Local-; R- = Remote-; * = ID;
L-Router-ID     L-Description   R-Router-ID      R-Description    SID
10.10.10.4      192.168.34.4    10.10.10.3       192.168.34.3     965536 
PE3#
PE3#show ip bgp labels
Network            Next Hop      In Label/Out Label

10.10.10.1/32      192.168.23.2    687933/492021
10.10.10.2/32      192.168.23.2    687934/492018
10.10.10.3/32      10.10.10.3      687931/notag
10.10.10.4/32      10.10.10.4      687932/notag
PE3#
PE3#show bgp all summary
BGP router ID  : 10.10.10.3
Local AS       : 200
All peers      : 2
  Established  : 2
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State
10.10.10.4      4   200         95         98         01:21:51     Established
192.168.23.2    4   100         142        137        01:58:01     Established
PE3#
PE3#show bgp ipv4 unicast neighbor in 10.10.10.4
Routes Learned From This Neighbor:
Status codes: * valid, < last valid, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Local router ID 10.10.10.3, Local AS 200, Local port 179
Remote router ID 10.10.10.4, Remote AS 200, Remote port 20007
Total number of routes: 1
  Valid routes        : 1
  Invalid routes      : 0
     Network             Next Hop        Metric     LocPrf     RtPrf   Path

* i  10.10.10.4/32       10.10.10.4                 100        200     i
PE3#
PE3#show bgp ipv4 unicast neighbor out 10.10.10.4
Routes Sent To This Neighbor:
Origin codes: i - IGP, e - EGP, ? - incomplete
Total number of routes: 3
Network            Next Hop        From            Metric LocPrf Path

10.10.10.1/32      10.10.10.3      192.168.23.2           100    100 i
10.10.10.2/32      10.10.10.3      192.168.23.2           100    100 i
10.10.10.3/32      10.10.10.3                             100    i
PE3#
PE3#show bgp ipv4 unicast neighbor in 192.168.23.2
Routes Learned From This Neighbor:
Status codes: * valid, < last valid, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Local router ID 10.10.10.3, Local AS 200, Local port 20012
Remote router ID 10.10.10.2, Remote AS 100, Remote port 179
Total number of routes: 2
  Valid routes        : 2
  Invalid routes      : 0
     Network             Next Hop        Metric     LocPrf     RtPrf   Path

*    10.10.10.1/32       192.168.23.2                          20      100 i
*    10.10.10.2/32       192.168.23.2                          20      100 i
PE3#
PE3#show bgp ipv4 unicast neighbor out 192.168.23.2
Routes Sent To This Neighbor:
Origin codes: i - IGP, e - EGP, ? - incomplete
Total number of routes: 2
Network            Next Hop        From            Metric LocPrf Path

10.10.10.3/32      192.168.23.3                                  200 i
10.10.10.4/32      192.168.23.3    10.10.10.4                    200 i
PE3#
PE3#show ip bgp route detail 10.10.10.1 32
BGP routing table entry for 10.10.10.1/32
02:32:47(Age 00:47:20) received from 192.168.23.2 (10.10.10.2), path-id 0
   Origin i, nexthop 192.168.23.2(metric 0), weight 0, rtpref 20, best, selected,
   As path [100]
   Received label  492021(0x781f5)

02:32:47(Age 00:47:20) advertised to UpdateGroup Index: 4, 
   To 1 peer(s): 10.10.10.4
   Origin i, localpref 100,
   As path(to 10.10.10.4) [100]
   Sent label  687933(0xa7f3d)

PE3#
PE3#show ip bgp route detail 10.10.10.4 32
BGP routing table entry for 10.10.10.4/32
01:58:16(Age 01:21:51) received from 10.10.10.4 (10.10.10.4), path-id 0
   Origin i, nexthop 10.10.10.4(metric 1), localpref 100, weight 0, rtpref 200,
   As path
   Received label  notag
Bgp-rib-only due to next-hop-loop

01:58:16(Age 01:21:51) advertised to UpdateGroup Index: 2, 
   To 1 peer(s): 192.168.23.2
   Origin i,
   As path(to 192.168.23.2) [200]
   Sent label  687932(0xa7f3c)

PE3#

PE4 verify status

PE4#show ip ospf neighbor
Codes: *: Multi-Area Interface

            OSPF Router with ID (10.10.10.4) (Process ID 1)

Neighbor ID     Pri State        DeadTime  Address         Interface
10.10.10.3      1   FULL/--      00:00:34  192.168.34.3    xxvgei-1/1/0/2
PE4#
PE4#show ip forwarding route
IPv4 Routing Table:
Status codes: *valid, >best, R: Relay;
    Dest               Gw              Interface          Owner       Pri Metric
*>  10.10.10.1/32      10.10.10.3      xxvgei-1/1/0/2     BGP         200 0     
*>  10.10.10.2/32      10.10.10.3      xxvgei-1/1/0/2     BGP         200 0     
*>  10.10.10.3/32      192.168.34.3    xxvgei-1/1/0/2     OSPF        110 1     
*>  10.10.10.4/32      10.10.10.4      loopback0          Address     0   0     
*>  192.168.34.0/24    192.168.34.4    xxvgei-1/1/0/2     Direct      0   0     
*>  192.168.34.4/32    192.168.34.4    xxvgei-1/1/0/2     Address     0   0     
PE4#
PE4#show mpls forwarding-table
Local     Outgoing  Prefix or           Outgoing            Next Hop        M/S 
label     label     Lspname             interface                               
910003    910003    10.10.10.3/32       xxvgei-1/1/0/2      192.168.34.3    M   
910004    Untagged  10.10.10.4/32       loopback0           10.10.10.4      M   
PE4#
PE4#ping mpls ipv4 10.10.10.1 32 source 10.10.10.4
sending 5,120-byte MPLS echo(es) to 10.10.10.1,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 36/39/43 ms.
PE4#
PE4#show segment-routing ipv4-mpls adjacency-sid remote 
Codes: L- = Local-; R- = Remote-; * = ID;
L-Router-ID     L-Description   R-Router-ID      R-Description    SID
10.10.10.3      192.168.34.3    10.10.10.4       192.168.34.4     965536 
PE4#
PE4#show ip bgp labels
Network            Next Hop      In Label/Out Label

10.10.10.1/32      10.10.10.3       notag/687933
10.10.10.2/32      10.10.10.3       notag/687934
10.10.10.3/32      10.10.10.3       notag/687931
10.10.10.4/32      10.10.10.4       notag/notag
PE4#
PE4#show bgp all summary
BGP router ID  : 10.10.10.4
Local AS       : 200
All peers      : 2
  Established  : 2
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State
10.10.10.1      4   100         60         2          00:49:47     Established
10.10.10.3      4   200         102        4          01:24:20     Established
PE4#
PE4#show bgp ipv4 unicast neighbor in 10.10.10.3
Routes Learned From This Neighbor:
Status codes: * valid, < last valid, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Local router ID 10.10.10.4, Local AS 200, Local port 20007
Remote router ID 10.10.10.3, Remote AS 200, Remote port 179
Total number of routes: 3
  Valid routes        : 3
  Invalid routes      : 0
     Network             Next Hop        Metric     LocPrf     RtPrf   Path

* i  10.10.10.1/32       10.10.10.3                 100        200     100 i
* i  10.10.10.2/32       10.10.10.3                 100        200     100 i
* i  10.10.10.3/32       10.10.10.3                 100        200     i
PE4#
PE4#show bgp ipv4 unicast neighbor out 10.10.10.3
Routes Sent To This Neighbor:
Origin codes: i - IGP, e - EGP, ? - incomplete
Total number of routes: 1
Network            Next Hop        From            Metric LocPrf Path

10.10.10.4/32      10.10.10.4                             100    i
PE4#
PE4#show bgp vpnv4 unicast neighbor in 10.10.10.1
Routes Learned From This Neighbor:
Status codes: * valid, < last valid, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Local router ID 10.10.10.4, Local AS 200, Local port 179
Remote router ID 10.10.10.1, Remote AS 100, Remote port 20054
Total number of routes: 1
  Valid routes        : 1
  Invalid routes      : 0
     Dest                Next Hop        Metric     LocPrf     InTag   Path

Route Distinguisher:1:1 (default for vrf Cotton)
*    100.1.1.0/24        10.10.10.1                            339776  100 ?
PE4#
PE4#show bgp vpnv4 unicast neighbor out 10.10.10.1
Routes Sent To This Neighbor:
Origin codes: i - IGP, e - EGP, ? - incomplete
Total number of routes: 1
Network          Next Hop        From            Metric LocPrf Tag     Path

Route Distinguisher:1:1 (default for vrf Cotton)
100.2.2.0/24     10.10.10.4                                    27684   200 ?
PE4#
PE4#show ip bgp route detail 10.10.10.1 32
BGP routing table entry for 10.10.10.1/32
02:32:54(Age 00:49:48) received from 10.10.10.3 (10.10.10.3), path-id 0
   Origin i, nexthop 10.10.10.3(metric 1), localpref 100, weight 0, rtpref 200, best, selected,
   As path [100]
   Received label  687933(0xa7f3d)

PE4#
PE4#show ip forwarding route vrf Cotton
Routes:  3            Route-paths:  3
IPv4 Routing Table:
Headers: Dest: Destination,  Gw: Gateway,  Pri: Priority;
Codes  : BROADC: Broadcast, USER-I: User-ipaddr, USER-S: User-special,
         MULTIC: Multicast, USER-N: User-network, DHCP-D: DHCP-DFT,
         ASBR-V: ASBR-VPN, STAT-V: Static-VRF, DHCP-S: DHCP-static,
         GW-FWD: PS-BUSI, NAT64: Stateless-NAT64, LDP-A: LDP-area,
         GW-UE: PS-USER, P-VRF: Per-VRF-label, TE: RSVP-TE, NAT-M : NAT-mask
         BP: BRAS-pool, HAGP: Hybrid-access-gateway-protocol;
Status codes: *valid, >best, R: Relay;
    Dest               Gw              Interface          Owner       Pri Metric
*>  100.1.1.0/24       10.10.10.1      xxvgei-1/1/0/2     BGP         20  0     
*>  100.2.2.0/24       100.2.2.1       xxvgei-1/1/0/3.100 Direct      0   0     
*>  100.2.2.1/32       100.2.2.1       xxvgei-1/1/0/3.100 Address     0   0     
PE4#

ดู label stack จาก capture traffic ด้วย wireshark
ผมลืมกด capture traffic ที่ HOP3 ใช้ HOP1 เทียบผลเอานะครับ

HOP1 PE1 -> PE2

Frame 22: 126 bytes on wire (1008 bits), 126 bytes captured (1008 bits)
Ethernet II, Src: Xensource_64:39:01 (00:16:3e:64:39:01), Dst: Xensource_64:3f:01 (00:16:3e:64:3f:01)
MultiProtocol Label Switching Header, Label: 910002, Exp: 0, S: 0, TTL: 254
MultiProtocol Label Switching Header, Label: 492019, Exp: 0, S: 0, TTL: 254
MultiProtocol Label Switching Header, Label: 27684, Exp: 0, S: 1, TTL: 254
Internet Protocol Version 4, Src: 100.1.1.2, Dst: 100.2.2.2
Internet Control Message Protocol

HOP1 PE2 -> PE1

Frame 23: 122 bytes on wire (976 bits), 122 bytes captured (976 bits)
Ethernet II, Src: Xensource_64:3f:01 (00:16:3e:64:3f:01), Dst: Xensource_64:39:01 (00:16:3e:64:39:01)
MultiProtocol Label Switching Header, Label: 910001, Exp: 0, S: 0, TTL: 252
MultiProtocol Label Switching Header, Label: 339776, Exp: 0, S: 1, TTL: 254
Internet Protocol Version 4, Src: 100.2.2.2, Dst: 100.1.1.2
Internet Control Message Protocol

HOP2 PE2 -> PE3

Frame 7: 122 bytes on wire (976 bits), 122 bytes captured (976 bits)
Ethernet II, Src: Xensource_64:3f:01 (00:16:3e:64:3f:01), Dst: Xensource_64:40:01 (00:16:3e:64:40:01)
MultiProtocol Label Switching Header, Label: 687932, Exp: 0, S: 0, TTL: 253
MultiProtocol Label Switching Header, Label: 27684, Exp: 0, S: 1, TTL: 254
Internet Protocol Version 4, Src: 100.1.1.2, Dst: 100.2.2.2
Internet Control Message Protocol

HOP2 PE3 -> PE2

Frame 8: 122 bytes on wire (976 bits), 122 bytes captured (976 bits)
Ethernet II, Src: Xensource_64:40:01 (00:16:3e:64:40:01), Dst: Xensource_64:3f:01 (00:16:3e:64:3f:01)
MultiProtocol Label Switching Header, Label: 492021, Exp: 0, S: 0, TTL: 253
MultiProtocol Label Switching Header, Label: 339776, Exp: 0, S: 1, TTL: 254
Internet Protocol Version 4, Src: 100.2.2.2, Dst: 100.1.1.2
Internet Control Message Protocol

จบ บริบูรณ์

1 comment:

  1. เยี่ยมจริงๆ เยี่ยมจริงๆ เยี่ยมจริงๆ

    ReplyDelete

การใช้งาน Secure crt เพื่อรัน Python-Script และ VBScript

   สำหรับใครที่ใช้งาน Secure CRT อยู่เป็นประจำและมีงานที่ต้องดึงข้อมูลโดยใช้ command line อยู่เป็นประจำหรือต้องดึงข้อมูลปริมาณมาก การใช้งาน ...