Thursday, April 11, 2024

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

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


Script ที่ผมใช้รัน จะ simulate ในโน๊ตบุ๊คโดยใช้ EVE-NG ซิมอุปกรณ์ Huawei และ Nokia Tology ก็จะตามรูปด้านล่างนี้ครับ


บทที่ 1 เริ่มต้นใช้งาน ส่งคำสั่ง รอผลลัพธ์ และการแสดงผล
  • crt.Session.Send(String) คือ ส่ง String
  • crt.Screen.WaitForString(String) คือ รอการแสดงผลจนถึง String ที่กำหนด
  • crt.Screen.ReadString(String) คล้ายกับ WaitForString แต่จะเป็นการอ่านจนถึง String ที่กำหนดแล้ว Return data ออกมา
  • crt.Dialog.MessageBox(String) แสดงหน้าต่าง Dialog พร้อมข้อความ
  • vbcr คือ กด Enter ของภาษา vbs. ส่วน python ใช้ "\n"
ในตัวอย่างนี้เราจะส่งคำสั่ง display ip interface brief ให้ router huawei จากนั้นก็จะรอจนกระทั่ง output จะมีคำว่า <HUAWEI>  จากนั้นก็จะส่งคำสั่ง display ip routing-table เก็บ output ใส่ตัวแปร data จนถึงคำว่า <HUAWEI>  แสดงผล output ในหน้าต่าง Diaglog

Chapter_1.vbs

crt.Screen.Send("display ip interface brief" & vbcr)
crt.Screen.WaitForString("<HUAWEI>")
crt.Screen.Send("display ip routing-table" & vbcr)
data = crt.Screen.ReadString("<HUAWEI>")
crt.Dialog.MessageBox(data)

Chapter_1.py

crt.Screen.Send("display ip interface brief\n")
crt.Screen.WaitForString("<HUAWEI>")
crt.Screen.Send("display ip routing-table\n")
data = crt.Screen.ReadString("<HUAWEI>")
crt.Dialog.MessageBox(data)

Chapter_1 ตัวอย่างผลลัพธ์




บทที่ 2 การดู Help เพื่อดูรายละเอียดการใช้งานและคำอธิบายของฟังก์ชั่น มีตัวอย่างทั้ง VBScript และ Python

คลิกที่ Menu Help -> Help Topics -> ในหน้าต่าง Help เลือก Contents -> Scripting -> Script Objects Reference 

ส่วนมากจะใช้งานในส่วนของ Screen Object กับ Session Object

ตัวอย่าง Help ของ Readstring


บทที่ 3 การเก็บ log

Chapter_3.vbs

Set FSO = CreateObject("Scripting.FileSystemObject")       ' create FileSystemObject
scriptPath = FSO.GetAbsolutePathName(".")                  ' get script path  = D:\Desktop\script
crt.session.log(False)		                           ' release log session
logpath = FSO.BuildPath(scriptPath, "log_huawei.txt" )     ' log path = D:\Desktop\script\log_huawei.txt
crt.Session.LogFileName = logpath                          ' set log filename
crt.Session.Log(True, False)                               ' start log session and overwrite log file
crt.Screen.Send("display ip interface brief" & vbCr)       ' send command and [Enter]
crt.Sleep 1000                                             ' delay 1 second
crt.session.log(False)                                     ' release log session
crt.Dialog.MessageBox(logpath)                             ' message logpath after finish

Chapter_3.py

import os                                           
import time                                               
scriptPath = os.path.dirname(os.path.realpath(__file__))   # get script path  = D:\Desktop\script
crt.Session.Log(False)                                     # release log session
logpath = os.path.join(scriptPath, "log_huawei.txt")       # log path = D:\Desktop\script\log_huawei.txt
crt.Session.LogFileName = logpath                          # set log filename
crt.Session.Log(True, True)                                # start log session and append log file
time.sleep(1)                                              # delay 1 second
crt.Session.Log(False)                                     # release log session
crt.Dialog.MessageBox(logpath)                             # message logpath after finish

บทที่ 4 การใช้ Loop

ส่วนที่ 1 จะเก็บคำสั่งต่างๆ ไว้ในตัวแปรประเภท array และ list ตามลำดับ จากนั้นใช้ For loop เพื่อส่งสั่งไปยัง Router

Chapter 4.1_loop_command.vbs

lines = Array("show isis adjacency process-id 11",_  
	      "show isis adjacency process-id 15",_
	      "show isis adjacency process-id 19" )

For each aline in lines
    crt.Screen.Send(aline & vbCr)
    crt.Screen.WaitForString("#")
    crt.Sleep 1000	
Next

Chapter 4.1_loop_command.py

lines = ["show isis adjacency process-id 11",
	 "show isis adjacency process-id 15",
	 "show isis adjacency process-id 19" ]

for aline in lines:
    crt.Screen.Send(aline + "\n")
    crt.Screen.WaitForString("#")
    time.sleep(1)

ส่วนที่ 2 จะส่งคำสั่ง "display ip interface brief" เก็บ output ไว้ในตัวแปล info จากนั้นแสดงหน้า output ในหน้าต่าง Diaglog เพื่อตรวจสอบ output. ใช้ฟังก์ชั่น split เพื่อแยก output ในแต่ละบรรทัดให้อยู่ในตัวแปลประเภท Array และ List ตามลำดับ ใช้ For loop เพื่อแสดงผลลัพท์

Chapter 4.2_loop_split.vbs

crt.Screen.Send("display ip interface brief"& vbcr)       ' send command
info = crt.Screen.ReadString(">")                         ' read string until found >
crt.Dialog.MessageBox(info)                               ' show all 
lines = Split(info, vbCrLf)                               ' split by new line
For each aline in lines                                   ' loop
    crt.Dialog.MessageBox(aline)                          ' show each line in dialog
Next

Chapter 4.2_loop_split.py

crt.Screen.Send("display ip interface brief\n")           # send command 
info = crt.Screen.ReadString(">")                         # read string until found >
crt.Dialog.MessageBox(info)                               # show all 
lines = info.split("\n")                                  # split by new line
for aline in lines:                                       # loop
    crt.Dialog.MessageBox(aline) 	                  # show each line in dialog

บทที่ 5 Telnet


บทที่ 6 SSH

Chapter 6_ssh.py

hostip = "192.168.44.102"
username = "admin"
password = "admin"
crt.Session.ConnectInTab('/SSH2 /ACCEPTHOSTKEYS /PASSWORD %s %s@%s '%(password, username, hostip), True)

บทที่ 7 VBScript เขียนและอ่านข้อมูลลง Excel

บทที่ 8 Python อ่านและเขียนลงใน csv

บทที่ 9 Python การใช้ Subprocess เพื่อเขียนข้อมูลลง Excel

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

จบ บริบูรณ์

Saturday, January 13, 2024

การคอนฟิก MC-LAG Multihome Active/Active ร่วมกับ EVPN-ELAN, OSPF-SR TI-LFA และ Fail-Over Test บนอุปกรณ์ ZTE


 การคอนฟิก MC-LAG Multihome active/active ที่ใช้ร่วมกับ L2VPN EVPN-ELAN, OSPF-SR TI-LFA และ Fail-Over Test บนอุปกรณ์ ZTE

Topo MC-LAG Multihome ActiveActive EVPN-ELAN OSPF-SR Ti-LFA
 ในแล๊ปนี้จะแสดงการคอนฟิกและผลลัพธ์ทีละสเต็ป ส่วนทฤษฎีผมแนะนำให้แยกอ่านแต่ละหัวข้อเองในอินเตอร์เน็ตเพราะผมเองก็รู้พอที่จะทำแล๊บให้สำเร็จได้ ผมจะแสดงตัวอย่างฝั่งเดียวคือ PE1, PE2, Switch_HQ, Client_HQ นะครับ ถ้าแสดงทั้งหมดกลัวจะยาวเกินไป ส่วนคอนฟิกและผลลัพธ์ทั้งหมด ผมแนบไว้ในอ้างอิงโหลดดูได้เลย

ขั้นตอนการคอนฟิก

  1. คอนฟิก IP, OSPF-SR, TI-LFA 
  2. คอนฟิก MP-BGP address-family evpn
  3. คอนฟิก Targeted-LDP สำหรับ MC-LAG ICCP
  4. คอนฟิก MC-LAG บน PE และ LACP บน Switch
  5. คอนฟิก EVPN-ELAN บน PE และ Allow vlan 100 บน Switch
  6. คอนฟิก IP บน Client HQ/Brance, ping test และเช็ค MAC บนทุกอุปกรณ์
Fail-Over Test
  1. Link PE1 - SW_HQ down
  2. Link PE2 - SW_HQ down
  3. PE1 down
  4. PE2 down
อ้างอิง

คอนฟิก IP, OSPF-SR, TI-LFA

PE1 Config

hostname PE1
interface loopback0
  ip address 10.10.10.1 255.255.255.255
$
interface xxvgei-1/1/0/1
  description To_PE3
  ip address 192.168.13.1 255.255.255.0
$
interface xxvgei-1/1/0/2
  description To_PE2
  ip address 192.168.12.1 255.255.255.0
$
segment-routing
  ipv4-mpls prefix-sid 10.10.10.1/32 index 10001 node-flag
$
router ospf 1
  router-id 10.10.10.1
  area 0.0.0.0
    mpls traffic-eng
    interface loopback0
      passive
    $
    interface xxvgei-1/1/0/1
      network point-to-point
    $
    interface xxvgei-1/1/0/2
      network point-to-point
    $
  $
  ti-lfa capability enable
  ti-lfa protection-type node-protecting
  fast-reroute ti-lfa priority 1
  microloop-prevention segment-routing mpls enable
  segment-routing mpls enable
$

PE2 Config

hostname PE2
interface xxvgei-1/1/0/1
  description To_PE4
  ip address 192.168.24.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
$
segment-routing
  ipv4-mpls prefix-sid 10.10.10.2/32 index 10002 node-flag
$
router ospf 1
  router-id 10.10.10.2
  area 0.0.0.0
    mpls traffic-eng
    interface loopback0
      passive
    $
    interface xxvgei-1/1/0/1
      network point-to-point
    $
    interface xxvgei-1/1/0/2
      network point-to-point
    $
  $
  ti-lfa capability enable
  ti-lfa protection-type node-protecting
  fast-reroute ti-lfa priority 1
  microloop-prevention segment-routing mpls enable
  segment-routing mpls enable
$

PE1 verify

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

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

Neighbor ID     Pri State        DeadTime  Address         Interface
10.10.10.2      1   FULL/--      00:00:32  192.168.12.2    xxvgei-1/1/0/2
10.10.10.3      1   FULL/--      00:00:34  192.168.13.3    xxvgei-1/1/0/1

PE1#show ip forwarding route
Routes:  10           Route-paths:  11
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
*>  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     OSPF        110 1     
*>  10.10.10.3/32      192.168.13.3    xxvgei-1/1/0/1     OSPF        110 1     
*>  10.10.10.4/32      192.168.12.2    xxvgei-1/1/0/2     OSPF        110 2     
*>  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     
*>  192.168.13.0/24    192.168.13.1    xxvgei-1/1/0/1     Direct      0   0     
*>  192.168.13.1/32    192.168.13.1    xxvgei-1/1/0/1     Address     0   0     
*>  192.168.24.0/24    192.168.12.2    xxvgei-1/1/0/2     OSPF        110 2     
*>  192.168.34.0/24    192.168.13.3    xxvgei-1/1/0/1     OSPF        110 2     

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;
*>O 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
*>O 10.10.10.3/32                               SID:10003      SID-Flag:N
    Via:192.168.13.3                            Router-ID:10.10.10.3     
    NH-SID:10003                                NH-SID-Flag:N
*>O 10.10.10.4/32                               SID:10004      SID-Flag:N
    Via:192.168.12.2                            Router-ID:10.10.10.2     
    NH-SID:10004                                NH-SID-Flag:N
 *O 10.10.10.4/32                               SID:10004      SID-Flag:N
    Via:10.10.10.3                              Router-ID:10.10.10.3     
    NH-SID:10004                                NH-SID-Flag:N

PE2 verify

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

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

Neighbor ID     Pri State        DeadTime  Address         Interface
10.10.10.1      1   FULL/--      00:00:36  192.168.12.1    xxvgei-1/1/0/2
10.10.10.4      1   FULL/--      00:00:40  192.168.24.4    xxvgei-1/1/0/1

PE2#show ip forwarding route
Routes:  10           Route-paths:  11
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
*>  10.10.10.1/32      192.168.12.1    xxvgei-1/1/0/2     OSPF        110 1     
*>  10.10.10.2/32      10.10.10.2      loopback0          Address     0   0     
*>  10.10.10.3/32      192.168.12.1    xxvgei-1/1/0/2     OSPF        110 2     
*>  10.10.10.4/32      192.168.24.4    xxvgei-1/1/0/1     OSPF        110 1     
*>  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.13.0/24    192.168.12.1    xxvgei-1/1/0/2     OSPF        110 2     
*>  192.168.24.0/24    192.168.24.2    xxvgei-1/1/0/1     Direct      0   0     
*>  192.168.24.2/32    192.168.24.2    xxvgei-1/1/0/1     Address     0   0     
*>  192.168.34.0/24    192.168.24.4    xxvgei-1/1/0/1     OSPF        110 2     

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;
*>O 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
*>O 10.10.10.3/32                               SID:10003      SID-Flag:N
    Via:192.168.12.1                            Router-ID:10.10.10.1     
    NH-SID:10003                                NH-SID-Flag:N
 *O 10.10.10.3/32                               SID:10003      SID-Flag:N
    Via:10.10.10.4                              Router-ID:10.10.10.4     
    NH-SID:10003                                NH-SID-Flag:N
*>O 10.10.10.4/32                               SID:10004      SID-Flag:N
    Via:192.168.24.4                            Router-ID:10.10.10.4     
    NH-SID:10004                                NH-SID-Flag:N

คอนฟิก MP-BGP address-family evpn

PE1 config

router bgp 65000
  bgp router-id 10.10.10.1
  neighbor 10.10.10.2 remote-as 65000
  neighbor 10.10.10.2 activate disable
  neighbor 10.10.10.2 update-source loopback0
  neighbor 10.10.10.3 remote-as 65000
  neighbor 10.10.10.3 activate disable
  neighbor 10.10.10.3 update-source loopback0
  neighbor 10.10.10.4 remote-as 65000
  neighbor 10.10.10.4 activate disable
  neighbor 10.10.10.4 update-source loopback0
  address-family l2vpn evpn
    neighbor 10.10.10.2 activate
    neighbor 10.10.10.3 activate
    neighbor 10.10.10.4 activate
  $
$

PE2 config

router bgp 65000
  bgp router-id 10.10.10.2
  neighbor 10.10.10.1 remote-as 65000
  neighbor 10.10.10.1 activate disable
  neighbor 10.10.10.1 update-source loopback0
  neighbor 10.10.10.3 remote-as 65000
  neighbor 10.10.10.3 activate disable
  neighbor 10.10.10.3 update-source loopback0
  neighbor 10.10.10.4 remote-as 65000
  neighbor 10.10.10.4 activate disable
  neighbor 10.10.10.4 update-source loopback0
  address-family l2vpn evpn
    neighbor 10.10.10.1 activate
    neighbor 10.10.10.3 activate
    neighbor 10.10.10.4 activate
  $
$

PE1 verify

PE1#show bgp l2vpn evpn summary
BGP router ID  : 10.10.10.1
Local AS       : 65000
All peers      : 3
  Established  : 3
All prefixes   : 13
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State/PfxRcd
10.10.10.2      4   65000       11         11         00:04:48         4       
10.10.10.3      4   65000       11         10         00:04:39         4       
10.10.10.4      4   65000       12         9          00:04:44         5       

PE2 verify

PE2#show bgp l2vpn evpn summary
BGP router ID  : 10.10.10.2
Local AS       : 65000
All peers      : 3
  Established  : 3
All prefixes   : 14
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State/PfxRcd
10.10.10.1      4   65000       16         6          00:06:00         5       
10.10.10.3      4   65000       12         6          00:05:43         4       
10.10.10.4      4   65000       13         6          00:05:29         5       

คอนฟิก Targeted-LDP สำหรับ MC-LAG ICCP

PE1 config

mpls ldp instance 1
  router-id loopback0
  target-session 10.10.10.2
$

PE2 config

mpls ldp instance 1
  router-id loopback0
  target-session 10.10.10.1
$

PE1 verify

PE1#show mpls ldp neighbor brief instance 1 | one-line
Codes: D:Direct, T:Targeted, D&T:Direct&Targeted
Total number of neigbors:2
  Operational:2 (D:0,T:2,D&T:0) (IPv4:2,IPv6:0,IPv4&IPv6:0)
  Not operational:0 (D:0,T:0,D&T:0) (IPv4:0,IPv6:0,IPv4&IPv6:0)
Peer-LDP-ID     State Up-time   Discovery GR Address IPv4/IPv6 Local-LDP-ID    Type  
                                                      Label                          
10.10.10.2:0     Oper  00:05:51  1         N  1       8/0       10.10.10.1:0     T     
10.10.10.2:65535 Oper  00:05:51  1         N  0       0/0       10.10.10.1:65535 T     

PE2 verify

PE2#show mpls ldp neighbor brief instance 1 | one-line
Codes: D:Direct, T:Targeted, D&T:Direct&Targeted
Total number of neigbors:2
  Operational:2 (D:0,T:2,D&T:0) (IPv4:2,IPv6:0,IPv4&IPv6:0)
  Not operational:0 (D:0,T:0,D&T:0) (IPv4:0,IPv6:0,IPv4&IPv6:0)
Peer-LDP-ID     State Up-time   Discovery GR Address IPv4/IPv6 Local-LDP-ID    Type  
                                                      Label                          
10.10.10.1:0     Oper  00:07:04  1         N  1       8/0       10.10.10.2:0     T     
10.10.10.1:65535 Oper  00:07:04  1         N  0       0/0       10.10.10.2:65535 T

คอนฟิก MC-LAG บน PE และ LACP บน Switch

PE1 config

interface smartgroup1
  description To_SW_HQ
$
lacp
  interface smartgroup1
    lacp mode 802.3ad
    mc-lag iccp 1
    mc-lag mode force-master
    mc-lag priority 200
    mc-lag roid 1 node-id 1
    mc-lag sys-id 0000.1111.2222 sys-priority 1
  $
  interface xxvgei-1/1/0/3
    smartgroup 1 mode active
  $
$
redundancy interchassis group 1
  apply mc-port
  apply mc-pw
  apply mlacp
  hostname PE1
  peer 10.10.10.2
$
icbg smg1
  bind interface smartgroup1
  bind rg 1
$

PE2 config

interface smartgroup1
  description To_SW_HQ
$
lacp
  interface smartgroup1
    lacp mode 802.3ad
    mc-lag iccp 1
    mc-lag mode force-master
    mc-lag priority 200
    mc-lag roid 1 node-id 2
    mc-lag sys-id 0000.1111.2222 sys-priority 1
  $
  interface xxvgei-1/1/0/4
    smartgroup 1 mode active
  $
$
redundancy interchassis group 1
  apply mc-port
  apply mc-pw
  apply mlacp
  hostname PE2
  peer 10.10.10.1
$
icbg smg1
  bind interface smartgroup1
  bind rg 1
$

SW_HQ config

interface xxvgei-1/1/0/3
  description To_PE3
$
interface xxvgei-1/1/0/4
  description To_PE4
$
interface smartgroup1
  description To_PE
$
switchvlan-configuration
  interface xxvgei-1/1/0/3
    switchport mode trunk
  $
  interface xxvgei-1/1/0/4
    switchport mode trunk
  $
  interface smartgroup1
    switchport mode trunk
  $
$
lacp
  interface smartgroup1
    lacp mode 802.3ad
  $
  interface xxvgei-1/1/0/3
    smartgroup 1 mode active
  $
  interface xxvgei-1/1/0/4
    smartgroup 1 mode active
  $
$

PE1 verify

PE1#show lacp mc-lag
Smartgroup id:              1
Mc-lag iccp id:             1
Mc-lag IPv4 source:         
Mc-lag IPv4 destination:    
Mc-lag IPv6 source:         
Mc-lag IPv6 destination:    
Mc-lag VRF name:            
Mc-lag priority:            200
Mc-lag sys-priority:        1
Mc-lag sys-mac:             0000.1111.2222
Mc-lag restore mode:        MCLAG_IMMEDIATELY_MODE
Mc-lag restore delay time:  0
Mc-lag mode:                Force-master
Mc-lag work-mode:           Force-master
Mc-lag roid:                1
Mc-lag node-id:             1
Mc-lag state:               LOAD-SHARING
Mc-lag actor smartgroup state:   UP
Mc-lag partner smartgroup state: UP
Mc-lag error down:          NO

PE1#show lacp internal
Smartgroup:1
Flags:              * - Port is Active member Port
                    S - Port is requested in Slow LACPDUs
                    F - Port is requested in Fast LACPDUs   
                    A - Port is in Active mode             
                    P - Port is in Passive mode      
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST

PE2 verify

PE2#show lacp mc-lag
Smartgroup id:              1
Mc-lag iccp id:             1
Mc-lag IPv4 source:         
Mc-lag IPv4 destination:    
Mc-lag IPv6 source:         
Mc-lag IPv6 destination:    
Mc-lag VRF name:            
Mc-lag priority:            200
Mc-lag sys-priority:        1
Mc-lag sys-mac:             0000.1111.2222
Mc-lag restore mode:        MCLAG_IMMEDIATELY_MODE
Mc-lag restore delay time:  0
Mc-lag mode:                Force-master
Mc-lag work-mode:           Force-master
Mc-lag roid:                1
Mc-lag node-id:             2
Mc-lag state:               LOAD-SHARING
Mc-lag actor smartgroup state:   UP
Mc-lag partner smartgroup state: UP
Mc-lag error down:          NO

PE2#show lacp internal
Smartgroup:1
Flags:              * - Port is Active member Port
                    S - Port is requested in Slow LACPDUs
                    F - Port is requested in Fast LACPDUs   
                    A - Port is in Active mode             
                    P - Port is in Passive mode      
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST

SW_HQ verify

SW_HQ#show lacp internal
Smartgroup:1
Flags:              * - Port is Active member Port
                    S - Port is requested in Slow LACPDUs
                    F - Port is requested in Fast LACPDUs   
                    A - Port is in Active mode             
                    P - Port is in Passive mode      
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST

คอนฟิก EVPN-ELAN บน PE และ Allow vlan 100 บน Switch

PE1 config

interface smartgroup1.100
  description vpls_cotton
$
vlan-configuration
  interface smartgroup1.100
    encapsulation-dot1q 100
  $
$
mpls l2vpn enable
vpls cotton evpn
  rd 100:1
  auto-discovery mpls-evpn
    route-target import 100:1
    route-target export 100:1
  $
  access-point smartgroup1.100
    access-params ethernet
    $
  $
$
ethernet-segments
  es-instance 1
    es-id static octets aa.11.11.22.22.00.00.00.00
    interface smartgroup1.100
    rd 10:1
    redundancy-mode all-active
    route-target import 10:1
    route-target export 10:1
  $
$

PE2 config

interface smartgroup1.100
  description vpls_cotton
$
vlan-configuration
  interface smartgroup1.100
    encapsulation-dot1q 100
  $
$
mpls l2vpn enable
vpls cotton evpn
  rd 100:1
  auto-discovery mpls-evpn
    route-target import 100:1
    route-target export 100:1
  $
  access-point smartgroup1.100
    access-params ethernet
    $
  $
$
ethernet-segments
  es-instance 1
    es-id static octets aa.11.11.22.22.00.00.00.00
    interface smartgroup1.100
    rd 10:1
    route-target import 10:1
    route-target export 10:1
  $
$

SW_HQ config

switchvlan-configuration
  interface xxvgei-1/1/0/5
    switchport access vlan 100
  $
  interface smartgroup1
    switchport mode trunk
    switchport trunk vlan 100
  $
  vlan 100
  $
$

PE1 verify

PE1#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:53505
Activation Status:ENABLE
Default VCID:-
Default Cword:DISABLE
Default Encapsulation:-
Description:
VPN ID:1
RD:100:1

Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: UP
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 

PE2 verify

PE2#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:27785
Activation Status:ENABLE
Default VCID:-
Default Cword:DISABLE
Default Encapsulation:-
Description:
VPN ID:1
RD:100:1

Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: UP
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 

SW_HQ verify

SW_HQ#show vlan id 100
VLAN     Name     PvidPorts           UntagPorts          TagPorts          
--------------------------------------------------------------------------------
100      vlan0100 xxvgei-1/1/0/5                          smartgroup1        
                                                          xxvgei-1/1/0/3-4

คอนฟิก IP บน Client HQ/Brance, ping test และเช็ค MAC บนทุกอุปกรณ์

Client_HQ config

interface xxvgei-1/1/0/5
  description To_SW_HQ_xxvgei-1/1/0/5
  ip address 192.168.0.1 255.255.255.0
$

Client_Brance config

interface xxvgei-1/1/0/5
  description To_SW_Brance_xxvgei-1/1/0/5
  ip address 192.168.0.2 255.255.255.0
$

Client_HQ verify

Client_HQ#ping 192.168.0.2
sending 5,100-byte ICMP echo(es) to 192.168.0.2,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 58/69/87 ms.
[finish]
Client_HQ#Client_HQ#show interface xxvgei-1/1/0/5
xxvgei-1/1/0/5 is up, ifindex: 8196
  Description: To_SW_HQ_xxvgei-1/1/0/5 
  Line protocol is up, IPv4 protocol is up, IPv6 protocol is down,
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2d01
  Internet address is 192.168.0.1/24 

Client_Brance verify

Client_Brance#ping 192.168.0.1
sending 5,100-byte ICMP echo(es) to 192.168.0.1,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 69/93/101 ms.
[finish]
Client_Brance#show interface xxvgei-1/1/0/5
xxvgei-1/1/0/5 is up, ifindex: 8196
  Description: To_SW_Brance_xxvgei-1/1/0/5 
  Line protocol is up, IPv4 protocol is up, IPv6 protocol is down,
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2a01
  Internet address is 192.168.0.2/24 

SW_HQ verify

SW_HQ#show mac table
Total MAC address : 2       

Flags: Src--Source filter, Dst--Destination filter, *--Switch to peerlink,
       From:0,driver;1,config;2,VPN;3,802.1X;4,micro;5,DHCP;
            6,PBT;7,EVB;8,OTV;9,TRILL;10,ESADI;11,MC-LAG,
       Time--Day:Hour:Min:Sec

MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2a01 100  smartgroup1                  Dynamic        0    00:00:08:39
0016.3e64.2d01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:10:03

SW_Brance verify

SW_Brance#show mac table
Total MAC address : 2       

Flags: Src--Source filter, Dst--Destination filter, *--Switch to peerlink,
       From:0,driver;1,config;2,VPN;3,802.1X;4,micro;5,DHCP;
            6,PBT;7,EVB;8,OTV;9,TRILL;10,ESADI;11,MC-LAG,
       Time--Day:Hour:Min:Sec

MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2d01 100  smartgroup1                  Dynamic        0    00:00:08:11
0016.3e64.2a01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:09:54

PE1 verify

PE1#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2a01][0]
                          10.10.10.4                 100        200     ?
*>    [2][0][48][0016.3e64.2d01][0]
                          0.0.0.0                               0       ?

PE1#show mac vpls instance cotton
Total MAC Entries:  2       

Headers: Src--Source filter, Dst--Destination filter
         Age--Day:Hour:Min:Sec
         $vxlan_tunnel--Auto discovered VXLAN tunnel
         VLAN--Different broadcast domains in VPN domain
         E--Exter-VLAN ID  I--Inter-VLAN ID
         *--Switch to peerlink
         BH--Black-Hole

MAC            VLAN Outgoing Information                Attribute    Age           
0016.3e64.2d01 0    smartgroup1.100                     Dynamic      00:00:00:13   
0016.3e64.2a01 0    ESI:0:bb3333444400000000            Dynamic      00:00:03:17   

PE2 verify

PE2#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2a01][0]
                          10.10.10.4                 100        200     ?
*>i   [2][0][48][0016.3e64.2d01][0]
                          10.10.10.1                 100        200     ?

PE2#show mac vpls instance cotton
Total MAC Entries:  2       

Headers: Src--Source filter, Dst--Destination filter
         Age--Day:Hour:Min:Sec
         $vxlan_tunnel--Auto discovered VXLAN tunnel
         VLAN--Different broadcast domains in VPN domain
         E--Exter-VLAN ID  I--Inter-VLAN ID
         *--Switch to peerlink
         BH--Black-Hole

MAC            VLAN Outgoing Information                Attribute    Age           
0016.3e64.2d01 0    ESI:0:aa1111222200000000            Dynamic      00:00:00:39   
0016.3e64.2a01 0    ESI:0:bb3333444400000000            Dynamic      00:00:13:59   

PE3 verify

PE3#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2a01][0]
                          10.10.10.4                 100        200     ?
*>i   [2][0][48][0016.3e64.2d01][0]
                          10.10.10.1                 100        200     ?

PE3#show mac vpls instance cotton
Total MAC Entries:  2       

Headers: Src--Source filter, Dst--Destination filter
         Age--Day:Hour:Min:Sec
         $vxlan_tunnel--Auto discovered VXLAN tunnel
         VLAN--Different broadcast domains in VPN domain
         E--Exter-VLAN ID  I--Inter-VLAN ID
         *--Switch to peerlink
         BH--Black-Hole

MAC            VLAN Outgoing Information                Attribute    Age           
0016.3e64.2d01 0    ESI:0:aa1111222200000000            Dynamic      00:00:01:16   
0016.3e64.2a01 0    ESI:0:bb3333444400000000            Dynamic      00:00:04:21   

PE4 verify

PE4#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>    [2][0][48][0016.3e64.2a01][0]
                          0.0.0.0                               0       ?
*>i   [2][0][48][0016.3e64.2d01][0]
                          10.10.10.1                 100        200     ?

PE4#show mac vpls instance cotton
Total MAC Entries:  2       

Headers: Src--Source filter, Dst--Destination filter
         Age--Day:Hour:Min:Sec
         $vxlan_tunnel--Auto discovered VXLAN tunnel
         VLAN--Different broadcast domains in VPN domain
         E--Exter-VLAN ID  I--Inter-VLAN ID
         *--Switch to peerlink
         BH--Black-Hole

MAC            VLAN Outgoing Information                Attribute    Age           
0016.3e64.2a01 0    smartgroup1.100                     Dynamic      00:00:02:00   
0016.3e64.2d01 0    ESI:0:aa1111222200000000            Dynamic      00:00:02:03   

จบ สำหรับคอนฟิกและปิงเทส

Fail-Over Test

1. Link PE1 - SW_HQ down

Client_HQ Ping test

Client_HQ#ping 192.168.0.2
sending 5,100-byte ICMP echo(es) to 192.168.0.2,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 77/97/131 ms.
[finish]
Client_HQ#show interface xxvgei-1/1/0/5 | include address
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2e01
  Internet address is 192.168.0.1/24 

Client_Brance Ping test

Client_Brance#ping 192.168.0.1
sending 5,100-byte ICMP echo(es) to 192.168.0.1,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 68/91/101 ms.
[finish]
Client_Brance#show interface xxvgei-1/1/0/5 | include address
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2f01
  Internet address is 192.168.0.2/24 

SW_HQ check interface, lacp and mac table

SW_HQ#show interface brief include smartgroup1|1/1/0/3|1/1/0/4
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/3 optical    Duplex/full  25000  down  down  down  To_PE1
xxvgei-1/1/0/4 optical    Duplex/full  25000  up    up    up    To_PE2
smartgroup1    N/A        N/A          25000  up    up    up    To_PE
SW_HQ#show lacp 1 internal
Smartgroup:1  
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[ A ] INACTIVE 30       32768 0x101  0x45  PORT_DISABLED DETACHED
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
SW_HQ#show mac table
Total MAC address : 2       
MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2e01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:08:20
0016.3e64.2f01 100  smartgroup1                  Dynamic        0    00:00:19:18

SW_Brance check lacp and mac table

SW_Brance#show lacp 1 internal
Smartgroup:1
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
SW_Brance#show mac table
Total MAC address : 2       
MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2e01 100  smartgroup1                  Dynamic        0    00:00:17:02
0016.3e64.2f01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:00:51

PE1 check interface status, lacp and mac table

PE1#show interface brief include smartgroup1|xxvgei-1/1/0/3
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/3 optical    Duplex/full  25000  up    down  down  To_SW-CE1_HQ1
smartgroup1    N/A        N/A          N/A    up    up    down  To_SW_HQ
PE1#show lacp 1 internal
Smartgroup:1
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[ A ] INACTIVE 30       32768 0x101  0x45  PORT_DISABLED DETACHED
PE1#show lacp mc-lag
Smartgroup id:              1
Mc-lag iccp id:             1
Mc-lag IPv4 source:         
Mc-lag IPv4 destination:    
Mc-lag IPv6 source:         
Mc-lag IPv6 destination:    
Mc-lag VRF name:            
Mc-lag priority:            200
Mc-lag sys-priority:        1
Mc-lag sys-mac:             0000.1111.2222
Mc-lag restore mode:        MCLAG_IMMEDIATELY_MODE
Mc-lag restore delay time:  0
Mc-lag mode:                Force-master
Mc-lag work-mode:           Force-master
Mc-lag roid:                1
Mc-lag node-id:             1
Mc-lag state:               M/S
Mc-lag actor smartgroup state:   DOWN
Mc-lag partner smartgroup state: UP
Mc-lag error down:          NO
PE1#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.2                 100        200     ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE1#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:456825
Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: DOWN
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 
PE1#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    ESI:0:bb3333444400000000      Dynamic      00:00:00:22   
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:00:49   

PE2 check interface status, lacp and mac table

PE2#show interface brief include smartgroup1|xxvgei-1/1/0/4
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/4 optical    Duplex/full  25000  up    up    up    To_SW-CE1_HQ1
smartgroup1    N/A        N/A          25000  up    up    up    To_SW_HQ
PE2#show lacp 1 internal
Smartgroup:1   
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
PE2#show lacp mc-lag
Smartgroup id:              1
Mc-lag iccp id:             1
Mc-lag IPv4 source:         
Mc-lag IPv4 destination:    
Mc-lag IPv6 source:         
Mc-lag IPv6 destination:    
Mc-lag VRF name:            
Mc-lag priority:            200
Mc-lag sys-priority:        1
Mc-lag sys-mac:             0000.1111.2222
Mc-lag restore mode:        MCLAG_IMMEDIATELY_MODE
Mc-lag restore delay time:  0
Mc-lag mode:                Force-master
Mc-lag work-mode:           Force-master
Mc-lag roid:                1
Mc-lag node-id:             2
Mc-lag state:               M/S
Mc-lag actor smartgroup state:   UP
Mc-lag partner smartgroup state: DOWN
Mc-lag error down:          NO

PE2#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>    [2][0][48][0016.3e64.2e01][0]
                          0.0.0.0                               0       ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE2#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:27784
Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: UP
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 
PE2#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    ESI:0:bb3333444400000000      Dynamic      00:00:01:10   
0016.3e64.2e01 0    smartgroup1.100               Dynamic      00:00:01:37 

PE3 check bgp mac-route and mac table

PE3#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.2                 100        200     ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE3#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    ESI:0:bb3333444400000000      Dynamic      00:00:01:36   
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:02:03 

PE4 check bgp mac-route and mac table

PE4#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.2                 100        200     ?
*>    [2][0][48][0016.3e64.2f01][0]
                          0.0.0.0                               0       ?
PE4#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:00:02   
0016.3e64.2f01 0    smartgroup1.100               Dynamic      00:00:02:09   
2. Link PE2 - SW_HQ down

Client_HQ Ping test

Client_HQ#ping 192.168.0.2
sending 5,100-byte ICMP echo(es) to 192.168.0.2,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 77/96/114 ms.
[finish]
Client_HQ#show interface xxvgei-1/1/0/5 | include address
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2e01
  Internet address is 192.168.0.1/24 

Client_SW Ping test

Client_Brance#ping 192.168.0.1
sending 5,100-byte ICMP echo(es) to 192.168.0.1,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 71/83/100 ms.
[finish]
Client_Brance#show interface xxvgei-1/1/0/5 | include address
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2f01
  Internet address is 192.168.0.2/24 

SW_HQ check lacp and mac table

SW_HQ#show interface brief include smartgroup1|1/1/0/3|1/1/0/4
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/3 optical    Duplex/full  25000  up    up    up    To_PE1
xxvgei-1/1/0/4 optical    Duplex/full  25000  down  down  down  To_PE2
smartgroup1    N/A        N/A          25000  up    up    up    To_PE
SW_HQ#show lacp 1 internal
Smartgroup:1   
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
xxvgei-1/1/0/4[ A ] INACTIVE 30       32768 0x101  0x45  PORT_DISABLED DETACHED
SW_HQ#show mac table
Total MAC address : 2       
MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2e01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:14:28
0016.3e64.2f01 100  smartgroup1                  Dynamic        0    00:00:25:26

SW_Brance check lacp and mac table

SW_Brance#show interface brief include smartgroup1|1/1/0/3|1/1/0/4
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/3 optical    Duplex/full  25000  up    up    up    To_PE3
xxvgei-1/1/0/4 optical    Duplex/full  25000  up    up    up    To_PE4
smartgroup1    N/A        N/A          50000  up    up    up    
SW_Brance#show lacp 1 internal
Smartgroup:1 
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
SW_Brance#show mac table
Total MAC address : 2       
MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2e01 100  smartgroup1                  Dynamic        0    00:00:23:23
0016.3e64.2f01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:00:48

PE1 check interface status, lacp and mac table

PE1#show interface brief include smartgroup1|xxvgei-1/1/0/3
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/3 optical    Duplex/full  25000  up    up    up    To_SW-CE1_HQ1
PE1#show lacp 1 internal
Smartgroup:1 
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
PE1#show lacp mc-lag
Smartgroup id:              1
Mc-lag iccp id:             1
Mc-lag IPv4 source:         
Mc-lag IPv4 destination:    
Mc-lag IPv6 source:         
Mc-lag IPv6 destination:    
Mc-lag VRF name:            
Mc-lag priority:            200
Mc-lag sys-priority:        1
Mc-lag sys-mac:             0000.1111.2222
Mc-lag restore mode:        MCLAG_IMMEDIATELY_MODE
Mc-lag restore delay time:  0
Mc-lag mode:                Force-master
Mc-lag work-mode:           Force-master
Mc-lag roid:                1
Mc-lag node-id:             1
Mc-lag state:               M/S
Mc-lag actor smartgroup state:   UP
Mc-lag partner smartgroup state: DOWN
Mc-lag error down:          NO

PE1#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>    [2][0][48][0016.3e64.2e01][0]
                          0.0.0.0                               0       ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE1#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:456825
Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: UP
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 
PE1#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    ESI:0:bb3333444400000000      Dynamic      00:00:01:36   
0016.3e64.2e01 0    smartgroup1.100               Dynamic      00:00:00:45  

PE2 check interface status, lacp and mac table

PE2#show interface brief include smartgroup1|xxvgei-1/1/0/4
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/4 optical    Duplex/full  25000  up    down  down  To_SW-CE1_HQ1
smartgroup1    N/A        N/A          N/A    up    up    down  To_SW_HQ
PE2#show lacp 1 internal
Smartgroup:1
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/4[ A ] INACTIVE 30       32768 0x101  0x45  PORT_DISABLED DETACHED
PE2#show lacp mc-lag
Smartgroup id:              1
Mc-lag iccp id:             1
Mc-lag IPv4 source:         
Mc-lag IPv4 destination:    
Mc-lag IPv6 source:         
Mc-lag IPv6 destination:    
Mc-lag VRF name:            
Mc-lag priority:            200
Mc-lag sys-priority:        1
Mc-lag sys-mac:             0000.1111.2222
Mc-lag restore mode:        MCLAG_IMMEDIATELY_MODE
Mc-lag restore delay time:  0
Mc-lag mode:                Force-master
Mc-lag work-mode:           Force-master
Mc-lag roid:                1
Mc-lag node-id:             2
Mc-lag state:               M/S
Mc-lag actor smartgroup state:   DOWN
Mc-lag partner smartgroup state: UP
Mc-lag error down:          NO

PE2#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.1                 100        200     ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE2#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:27784
Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: DOWN
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 
PE2#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    ESI:0:bb3333444400000000      Dynamic      00:00:02:14   
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:01:23  

PE3 check interface status, lacp and mac table

PE3#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.1                 100        200     ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE3#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    ESI:0:bb3333444400000000      Dynamic      00:00:00:15   
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:01:57 

PE4 lacp and mac table

PE4#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.1                 100        200     ?
*>    [2][0][48][0016.3e64.2f01][0]
                          0.0.0.0                               0       ?
PE4#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    smartgroup1.100               Dynamic      00:00:00:44   
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:02:26
3. PE1 down

Client_HQ Ping test

Client_HQ#ping 192.168.0.2
sending 5,100-byte ICMP echo(es) to 192.168.0.2,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 68/71/73 ms.
[finish]
Client_HQ#show interface xxvgei-1/1/0/5 | include address
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2e01
  Internet address is 192.168.0.1/24 

Client_Brance Ping test

Client_Brance#ping 192.168.0.1
sending 5,100-byte ICMP echo(es) to 192.168.0.1,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 86/97/101 ms.
[finish]
Client_Brance#show interface xxvgei-1/1/0/5 | include address
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2f01
  Internet address is 192.168.0.2/24 

SW_HQ check lacp and mac table

SW_HQ#show interface brief include smartgroup1|1/1/0/3|1/1/0/4
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/3 optical    Duplex/full  25000  up    down  down  To_PE1
xxvgei-1/1/0/4 optical    Duplex/full  25000  up    up    up    To_PE2
smartgroup1    N/A        N/A          25000  up    up    up    To_PE
SW_HQ#show lacp 1 internal
Smartgroup:1  
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[ A ] INACTIVE 30       32768 0x101  0x45  PORT_DISABLED DETACHED
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
SW_HQ#show mac table
Total MAC address : 2       
MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2e01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:04:01
0016.3e64.2f01 100  smartgroup1                  Dynamic        0    00:00:37:59

SW_Brance check lacp and mac table

SW_Brance#show lacp 1 internal
Smartgroup:1  
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
SW_Brance#show mac table
Total MAC address : 2       
MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2e01 100  smartgroup1                  Dynamic        0    00:00:35:54
0016.3e64.2f01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:01:47

PE1 status is DOWN

PE2 check interface status, lacp and mac table

PE2#terminal length 0
PE2#show interface brief 
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/1 optical    Duplex/full  25000  up    up    up    To_PE4
xxvgei-1/1/0/2 optical    Duplex/full  25000  up    down  down  To_PE1
xxvgei-1/1/0/3 optical    Duplex/full  25000  up    down  down  
xxvgei-1/1/0/4 optical    Duplex/full  25000  up    up    up    To_SW-CE1_HQ1
xxvgei-1/1/0/5 optical    Duplex/full  25000  up    down  down  
smartgroup1    N/A        N/A          25000  up    up    up    To_SW_HQ
PE2#show mpls ldp neighbor brief instance 1 | one-line
Codes: D:Direct, T:Targeted, D&T:Direct&Targeted
Total number of neigbors:0
  Operational:0 (D:0,T:0,D&T:0) (IPv4:0,IPv6:0,IPv4&IPv6:0)
  Not operational:0 (D:0,T:0,D&T:0) (IPv4:0,IPv6:0,IPv4&IPv6:0)
PE2#show ip ospf neighbor
Codes: *: Multi-Area Interface

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

Neighbor ID     Pri State        DeadTime  Address         Interface
10.10.10.4      1   FULL/--      00:00:38  192.168.24.4    xxvgei-1/1/0/1
PE2#show lacp 1 internal
Smartgroup:1
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
PE2#show lacp mc-lag
Smartgroup id:              1
Mc-lag iccp id:             1
Mc-lag IPv4 source:         
Mc-lag IPv4 destination:    
Mc-lag IPv6 source:         
Mc-lag IPv6 destination:    
Mc-lag VRF name:            
Mc-lag priority:            200
Mc-lag sys-priority:        1
Mc-lag sys-mac:             0000.1111.2222
Mc-lag restore mode:        MCLAG_IMMEDIATELY_MODE
Mc-lag restore delay time:  0
Mc-lag mode:                Force-master
Mc-lag work-mode:           Force-master
Mc-lag roid:                1
Mc-lag node-id:             2
Mc-lag state:               PEER-UNKNOWN
Mc-lag actor smartgroup state:   UP
Mc-lag partner smartgroup state: UNKNOWN
Mc-lag error down:          NO

PE2#show bgp l2vpn evpn summary
BGP router ID  : 10.10.10.2
Local AS       : 65000
All peers      : 3
  Established  : 3
All prefixes   : 13
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State/PfxRcd
10.10.10.1      4   65000       52         72         00:00:03     Connect
10.10.10.3      4   65000       46         29         00:35:40         4       
10.10.10.4      4   65000       69         29         00:35:38         5  
PE2#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>    [2][0][48][0016.3e64.2e01][0]
                          0.0.0.0                               0       ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE2#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:27784
Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: UP
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 
PE2#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    ESI:0:bb3333444400000000      Dynamic      00:00:01:56   
0016.3e64.2e01 0    smartgroup1.100               Dynamic      00:00:02:23   

PE3 check interface status, lacp and mac table

PE3#show bgp l2vpn evpn summary
BGP router ID  : 10.10.10.3
Local AS       : 65000
All peers      : 3
  Idle         : 1
  Established  : 2
All prefixes   : 10
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State/PfxRcd
10.10.10.1      4   65000       55         47         00:00:01     Idle
10.10.10.2      4   65000       70         6          00:36:16         5       
10.10.10.4      4   65000       69         6          00:35:34         5 
PE3#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.2                 100        200     ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE3#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:00:24   
0016.3e64.2f01 0    ESI:0:bb3333444400000000      Dynamic      00:00:02:31   

PE4 lacp and mac table

PE4#show bgp l2vpn evpn summary
BGP router ID  : 10.10.10.4
Local AS       : 65000
All peers      : 3
  Connect      : 1
  Established  : 2
All prefixes   : 9
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State/PfxRcd
10.10.10.1      4   65000       52         72         00:00:03     Connect
10.10.10.2      4   65000       71         31         00:36:50         5       
10.10.10.3      4   65000       45         32         00:36:10         4       
PE4#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.2                 100        200     ?
*>    [2][0][48][0016.3e64.2f01][0]
                          0.0.0.0                               0       ?
PE4#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    smartgroup1.100               Dynamic      00:00:00:35   
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:01:02 
4. PE2 down

Client_HQ Ping test
Client_HQ#ping 192.168.0.2
sending 5,100-byte ICMP echo(es) to 192.168.0.2,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 72/84/110 ms.
[finish]
Client_HQ#show interface xxvgei-1/1/0/5 | include address
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2e01
  Internet address is 192.168.0.1/24 

Client_Brance Ping test

Client_Brance#ping 192.168.0.1
sending 5,100-byte ICMP echo(es) to 192.168.0.1,timeout is 2 second(s).
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max= 99/99/100 ms.
[finish]
Client_Brance#show interface xxvgei-1/1/0/5 | include address
  Hardware is XXVGigabit Ethernet, address is 0016.3e64.2f01
  Internet address is 192.168.0.2/24 

SW_HQ check lacp and mac table

SW_HQ#show interface brief include smartgroup1|1/1/0/3|1/1/0/4
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/3 optical    Duplex/full  25000  up    up    up    To_PE1
xxvgei-1/1/0/4 optical    Duplex/full  25000  up    down  down  To_PE2
smartgroup1    N/A        N/A          25000  up    up    up    To_PE
SW_HQ#show lacp 1 internal
Smartgroup:1  
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
xxvgei-1/1/0/4[ A ] INACTIVE 30       32768 0x101  0x45  PORT_DISABLED DETACHED
SW_HQ#show mac table
Total MAC address : 2       
MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2f01 100  smartgroup1                  Dynamic        0    00:00:03:31
0016.3e64.2e01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:14:13

SW_Brance check lacp and mac table

SW_Brance#show lacp 1 internal
Smartgroup:1
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
xxvgei-1/1/0/4[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
SW_Brance#show mac table
Total MAC address : 2       
MAC            VLAN Outgoing Information         Attribute      From Time
-------------- ---- ---------------------------- -------------- ---- -----------
0016.3e64.2e01 100  smartgroup1                  Dynamic        0    00:00:45:27
0016.3e64.2f01 100  xxvgei-1/1/0/5               Dynamic        0    00:00:02:26

PE1 check interface status, lacp and mac table

PE1#show interface brief
Interface      Portattribute  Mode  BW(Mbps)  Admin Phy   Prot  Description 
xxvgei-1/1/0/1 optical    Duplex/full  25000  up    up    up    To_PE3
xxvgei-1/1/0/2 optical    Duplex/full  25000  up    down  down  To_PE2
xxvgei-1/1/0/3 optical    Duplex/full  25000  up    up    up    To_SW-CE1_HQ1
xxvgei-1/1/0/4 optical    Duplex/full  25000  up    down  down  
xxvgei-1/1/0/5 optical    Duplex/full  25000  up    down  down  
smartgroup1    N/A        N/A          25000  up    up    up    To_SW_HQ
PE1#show mpls ldp neighbor brief instance 1 | one-line
Codes: D:Direct, T:Targeted, D&T:Direct&Targeted
Total number of neigbors:0
  Operational:0 (D:0,T:0,D&T:0) (IPv4:0,IPv6:0,IPv4&IPv6:0)
  Not operational:0 (D:0,T:0,D&T:0) (IPv4:0,IPv6:0,IPv4&IPv6:0)
PE1#show ip ospf neighbor
Codes: *: Multi-Area Interface

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

Neighbor ID     Pri State        DeadTime  Address         Interface
10.10.10.3      1   FULL/--      00:00:31  192.168.13.3    xxvgei-1/1/0/1
PE1#show lacp 1 internal
Smartgroup:1 
Actor               Agg      LACPDUs  Port  Oper   Port  RX            Mux
Port[Flags]         State    Interval Pri   Key    State Machine       Machine
--------------------------------------------------------------------------------
xxvgei-1/1/0/3[SA*] ACTIVE   30       32768 0x101  0x3d  CURRENT       COLL&DIST
PE1#show lacp mc-lag
Smartgroup id:              1
Mc-lag iccp id:             1
Mc-lag IPv4 source:         
Mc-lag IPv4 destination:    
Mc-lag IPv6 source:         
Mc-lag IPv6 destination:    
Mc-lag VRF name:            
Mc-lag priority:            200
Mc-lag sys-priority:        1
Mc-lag sys-mac:             0000.1111.2222
Mc-lag restore mode:        MCLAG_IMMEDIATELY_MODE
Mc-lag restore delay time:  0
Mc-lag mode:                Force-master
Mc-lag work-mode:           Force-master
Mc-lag roid:                1
Mc-lag node-id:             1
Mc-lag state:               NONE
Mc-lag actor smartgroup state:   UP
Mc-lag partner smartgroup state: UNKNOWN
Mc-lag error down:          NO

PE1#show bgp l2vpn evpn summary
BGP router ID  : 10.10.10.1
Local AS       : 65000
All peers      : 3
  Connect      : 1
  Established  : 2
All prefixes   : 9
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State/PfxRcd
10.10.10.2      4   65000       0          0          00:03:28     Connect
10.10.10.3      4   65000       4          6          00:00:54         4       
10.10.10.4      4   65000       6          6          00:00:53         5       
PE1#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>    [2][0][48][0016.3e64.2e01][0]
                          0.0.0.0                               0       ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE1#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:53505
Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: UP
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 
PE1#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information        Attribute    Age           
0016.3e64.2e01 0    smartgroup1.100             Dynamic      00:00:00:52   
0016.3e64.2f01 0    ESI:0:bb3333444400000000    Dynamic      00:00:00:53   

PE2 status is down

PE3 check interface status, lacp and mac table
PE3#show bgp l2vpn evpn summary
BGP router ID  : 10.10.10.3
Local AS       : 65000
All peers      : 3
  Connect      : 1
  Established  : 2
All prefixes   : 10
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State/PfxRcd
10.10.10.1      4   65000       7          4          00:01:31         5       
10.10.10.2      4   65000       77         56         00:03:12     Connect
10.10.10.4      4   65000       88         45         00:45:32         5       
PE3#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.1                 100        200     ?
*>i   [2][0][48][0016.3e64.2f01][0]
                          10.10.10.4                 100        200     ?
PE3#show l2vpn instance-name cotton
Name:cotton  Type:VPLS
PW count:0  AC count:1  Kompella PW count:0
MPLS EVPN label:53504
Attachment Circuit(AC):
  InterfaceName                   Client/Server
  smartgroup1.100                    Server
    Description: 
    Admin Status: UP            Prot Status: UP
    Vlan Encapsulation DOT1Q:
      Vlan id: 100 
PE3#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information         Attribute    Age           
0016.3e64.2e01 0    ESI:0:aa1111222200000000     Dynamic      00:00:01:28   
0016.3e64.2f01 0    ESI:0:bb3333444400000000     Dynamic      00:00:02:14  

PE4 lacp and mac table

PE4#show bgp l2vpn evpn summary
BGP router ID  : 10.10.10.4
Local AS       : 65000
All peers      : 3
  Connect      : 1
  Established  : 2
All prefixes   : 9
Neighbor        Ver As          MsgRcvd    MsgSend    Up/Down      State/PfxRcd
10.10.10.1      4   65000       6          7          00:02:00         5       
10.10.10.2      4   65000       77         84         00:03:50     Connect
10.10.10.3      4   65000       57         80         00:46:02         4       
PE4#show bgp l2vpn evpn mac
Status codes: * valid, > best, i - internal, s - stale, d - duplication
Origin codes: i - IGP, e - EGP, ? - incomplete
      Network             Next Hop        Metric     LocPrf     RtPrf   Path

Route Distinguisher:100:1
*>i   [2][0][48][0016.3e64.2e01][0]
                          10.10.10.1                 100        200     ?
*>    [2][0][48][0016.3e64.2f01][0]
                          0.0.0.0                               0       ?
PE4#show mac vpls instance cotton
Total MAC Entries:  2       
MAC            VLAN Outgoing Information          Attribute    Age           
0016.3e64.2f01 0    smartgroup1.100               Dynamic      00:00:00:13   
0016.3e64.2e01 0    ESI:0:aa1111222200000000      Dynamic      00:00:01:59 

จบ บริบูรณ์

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

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