Hướng dẫn triển khai EVPN E-Tree trên thiết bị Juniper Networks

Hướng dẫn triển khai EVPN E-Tree trên thiết bị Juniper Networks

Ví dụ này hướng dẫn cách cấu hình dịch vụ Ethernet VPN (EVPN) kiểu Ethernet-Tree (E-Tree).

Yêu cầu hệ thống

Ví dụ này sử dụng các thành phần phần cứng và phần mềm sau:

  • Ba thiết bị định tuyến Juniper MX Series 5G Universal Routing Platforms được cấu hình làm router biên nhà cung cấp (PE).
  • Ba thiết bị router biên khách hàng (CE), mỗi thiết bị được kết nối với các router PE.
  • Junos OS phiên bản 17.2 hoặc mới hơn đang chạy trên tất cả các thiết bị PE.

Trước khi cấu hình EVPN E-Tree, bạn cần thực hiện các bước sau:

  • Cấu hình các giao diện vật lý trên thiết bị.
  • Cấu hình giao thức định tuyến nội bộ (IGP), chẳng hạn như OSPF, trên tất cả thiết bị.
  • Thiết lập phiên BGP giữa các thiết bị PE.
  • Cấu hình MPLS và LDP trên các thiết bị PE.

Tổng quan

Tính năng EVPN E-Tree cho phép bạn tạo một dịch vụ kiểu rooted-multipoint (đa điểm có gốc) được hỗ trợ bởi EVPN-MPLS trong mạng lõi, theo định nghĩa của Metro Ethernet Forum (MEF) trong tài liệu RFC 8317. Trong dịch vụ EVPN E-Tree, bạn sẽ phân loại các giao diện trong routing instance thành hai loại root or leaf interfaces Mỗi thiết bị CE cũng được định nghĩa là một thiết bị root hoặc leaf. Nguyên tắc chuyển tiếp trong EVPN E-Tree

  • Một thiết bị leaf chỉ được phép gửi hoặc nhận lưu lượng từ thiết bị root.
  • Một thiết bị root có thể gửi lưu lượng đến root khác hoặc đến bất kỳ leaf nào.

Các thiết bị CE (dù là root hay leaf) đều có thể kết nối với PE theo kiểu single-homed hoặc multihomed

Hình 1: Dịch vụ E-Tree của EVPN

Hành vi EVPN E-Tree theo nền tảng thiết bị

Sử dụng bảng sau để xem xét các hành vi cụ thể theo từng nền tảng thiết bị bạn đang sử dụng.

Thiết bịKhác biệt
Router ACX5448Khi bạn bật dịch vụ EVPN E-Tree trên router ACX5448, bạn cũng cần thiết lập tùy chọn hệ thống evpn-mh-profile tại cấp cấu hình [edit system packet-forwarding-options firewall-profile], sau đó thực hiện commit cấu hình. Để khởi động hồ sơ mới, hãy chạy lệnh CLI restart chassis-control để khởi động lại tiến trình quản lý chassis (mgd). Bạn sẽ thấy một cảnh báo syslog yêu cầu khởi động lại Packet Forwarding Engine.

Cấu hình

Cấu hình nhanh qua CLI

Để cấu hình nhanh ví dụ này, bạn hãy sao chép các lệnh sau, dán vào một tệp văn bản, loại bỏ các dấu xuống dòng nếu cần, điều chỉnh các thông tin cần thiết để phù hợp với cấu hình mạng của bạn, sau đó sao chép và dán các lệnh đó vào CLI ở cấp cấu hình [edit], và cuối cùng nhập lệnh commit để áp dụng cấu hình.

Lưu ý: Khi bạn muốn thay đổi etree-ac-role từ leaf sang root hoặc ngược lại, hãy thực hiện theo quy trình sau:

  1. Vô hiệu hóa (deactivate) cấu hình interface unit tương ứng.
  2. Thay đổi tùy chọn etree-ac-role trong cấu hình của interface unit đã được vô hiệu hóa.
  3. Kích hoạt lại (reactivate) cấu hình interface unit đã cập nhật.

Việc vô hiệu hóa interface unit trước khi thay đổi tùy chọn etree-ac-role đảm bảo rằng hệ thống sẽ áp dụng đúng vai trò mới cho tất cả các thành phần trong dịch vụ E-Tree.

CE1

set  interfaces xe-0/0/1 vlan-tagging

set  interfaces xe-0/0/1 unit 100 vlan-id 100

set  interfaces xe-0/0/1 unit 100 family inet address 10.100.0.1/24

PE1

set interfaces xe-2/0/0 unit 0 family inet address 10.0.0.1/30

set interfaces xe-2/0/0 unit 0 family mpls

set interfaces xe-2/1/3 unit 0 family inet address 10.0.0.5/30

set interfaces xe-2/1/3 unit 0 family mpls

set interfaces lo0 unit 0 family inet address 10.255.0.1/32 primary

set interfaces lo0 unit 0 family inet address 10.255.0.1/32 preferred

set interfaces xe-2/1/1 flexible-vlan-tagging

set interfaces xe-2/1/1 encapsulation flexible-ethernet-services

set interfaces xe-2/1/1 unit 100 encapsulation vlan-bridge

set interfaces xe-2/1/1 unit 100 vlan-id 100

set interfaces xe-2/1/1 unit 100 etree-ac-role root

set routing-options router-id 10.255.0.1

set routing-options autonomous-system 65000

set protocols mpls interface all

set protocols mpls interface fxp0.0 disable

set protocols bgp group evpn local-address 10.255.0.1

set protocols bgp group evpn family evpn signaling

set protocols bgp group evpn peer-as 65000

set protocols bgp group evpn local-as 65000

set protocols bgp group evpn neighbor 10.255.0.2

set protocols bgp group evpn neighbor 10.255.0.3

set protocols ospf area 0.0.0.0 interface all

set protocols ospf area 0.0.0.0 interface fxp0.0 disable

set protocols ldp interface all

set protocols ldp interface fxp0.0 disable

set routing-instances evpna instance-type evpn

set routing-instances evpna vlan-id 100

set routing-instances evpna interface xe-2/1/1.100

set routing-instances evpna route-distinguisher 10.255.0.1:100

set routing-instances evpna vrf-target target:65000:100

set routing-instances evpna protocols evpn interface xe-2/1/1.100

set routing-instances evpna protocols evpn evpn-etree

PE2

set interfaces xe-2/1/6 unit 0 family inet address 10.0.0.2/30

set interfaces xe-2/1/6 unit 0 family mpls

set interfaces xe-2/0/9 unit 0 family inet address 10.0.0.9/30

set interfaces xe-2/0/9 unit 0 family mpls

set interfaces lo0 unit 0 family inet address 10.255.0.2/32 primary

set interfaces lo0 unit 0 family inet address 10.255.0.2/32 preferred

set interfaces xe-2/0/0 flexible-vlan-tagging

set interfaces xe-2/0/0 encapsulation flexible-ethernet-services

set interfaces xe-2/0/0 unit 100 encapsulation vlan-bridge

set interfaces xe-2/0/0 unit 100 vlan-id 100

set interfaces xe-2/0/0 unit 100 etree-ac-role leaf

set routing-options router-id 10.255.0.2

set routing-options autonomous-system 65000

set protocols mpls interface all

set protocols mpls interface fxp0.0 disable

set protocols bgp group evpn local-address 10.255.0.2

set protocols bgp group evpn family evpn signaling

set protocols bgp group evpn peer-as 65000

set protocols bgp group evpn local-as 65000

set protocols bgp group evpn neighbor 10.255.0.1

set protocols bgp group evpn neighbor 10.255.0.3

set protocols ospf area 0.0.0.0 interface all

set protocols ospf area 0.0.0.0 interface fxp0.0 disable

set protocols ldp interface all

set protocols ldp interface fxp0.0 disable

set routing-instances evpna instance-type evpn

set routing-instances evpna vlan-id 100

set routing-instances evpna interface xe-2/0/0.100

set routing-instances evpna route-distinguisher 10.255.0.2:100

set routing-instances evpna vrf-target target:65000:100

set routing-instances evpna protocols evpn interface xe-2/0/0.100

set routing-instances evpna protocols evpn evpn-etree

PE3

set  interfaces xe-1/3/1 unit 0 family inet address 10.0.0.6/30

set  interfaces xe-1/3/1 unit 0 family mpls

set  interfaces xe-2/1/1:1 unit 0 family inet address 10.0.0.10/30

set  interfaces xe-2/1/1:1 unit 0 family mpls

set  interfaces lo0 unit 0 family inet address 10.255.0.3/32 primary

set  interfaces lo0 unit 0 family inet address 10.255.0.3/32 preferred

set  interfaces xe-2/1/1:0 flexible-vlan-tagging

set  interfaces xe-2/1/1:0 encapsulation flexible-ethernet-services

set  interfaces xe-2/1/1:0 unit 100 encapsulation vlan-bridge

set  interfaces xe-2/1/1:0 unit 100 vlan-id 100

set  interfaces xe-2/1/1:0 unit 100 etree-ac-role leaf

set  routing-options router-id 10.255.0.3

set  routing-options autonomous-system 65000

set  protocols mpls interface all

set  protocols mpls interface fxp0.0 disable

set  protocols bgp group evpn local-address 10.255.0.3

set  protocols bgp group evpn family evpn signaling

set  protocols bgp group evpn peer-as 65000

set  protocols bgp group evpn local-as 65000

set  protocols bgp group evpn neighbor 10.255.0.1

set  protocols bgp group evpn neighbor 10.255.0.2

set  protocols ospf area 0.0.0.0 interface all

set  protocols ospf area 0.0.0.0 interface fxp0.0 disable

set  protocols ldp interface all

set  protocols ldp interface fxp0.0 disable

set  routing-instances evpna instance-type evpn

set  routing-instances evpna vlan-id 100

set  routing-instances evpna interface xe-2/1/1:0.100

set  routing-instances evpna route-distinguisher 10.255.0.3:100

set  routing-instances evpna vrf-target target:65000:100

set  routing-instances evpna protocols evpn interface xe-2/1/1:0.100

set  routing-instances evpna protocols evpn evpn-etree

CE2

set interfaces xe-0/0/0 vlan-tagging

set interfaces xe-0/0/0 unit 100 vlan-id 100

set interfaces xe-0/0/0 unit 100 family inet address 10.100.0.2/24

CE3

set interfaces xe-2/0/2 vlan-tagging

set interfaces xe-2/0/2 unit 100 vlan-id 100

set interfaces xe-2/0/2 unit 100 family inet address 10.100.0.3/24

Quy trình thực hiện

Các bước cấu hình chi tiết (Step-by-Step Procedure)

Ví dụ sau yêu cầu bạn phải di chuyển qua nhiều cấp trong cây cấu hình (configuration hierarchy). Để biết thêm thông tin về cách di chuyển trong CLI, vui lòng tham khảo phần "Sử dụng CLI Editor trong Chế độ Cấu hình (Using the CLI Editor in Configuration Mode)".

Cấu hình Router PE1

**Lưu ý: Hãy lặp lại quy trình này cho các router PE2 và PE3, sau khi chỉnh sửa tên giao diện, địa chỉ IP và các tham số phù hợp với từng thiết bị.

1. Cấu hình các giao diện trên Router PE1

[edit interfaces]

user@PE1#set xe-2/0/0 unit 0 family inet address 10.0.0.1/30

user@PE1#set xe-2/0/0 unit 0 family mpls

user@PE1#set xe-2/1/3 unit 0 family inet address 10.0.0.5/30

user@PE1#set xe-2/1/3 unit 0 family mpls

user@PE1#set lo0 unit 0 family inet address 10.255.0.1/32 primary

user@PE1#set lo0 unit 0 family inet address 10.255.0.1/32 preferred

user@PE1#set xe-2/1/1 flexible-vlan-tagging

user@PE1#set xe-2/1/1 encapsulation flexible-ethernet-services

user@PE1#set xe-2/1/1 unit 100 encapsulation vlan-bridge

user@PE1#set xe-2/1/1 unit 100 vlan-id 100

2. Gán vai trò cho giao diện là leaf hoặc root

user@PE1#[edit interfaces]

set xe-2/1/1 unit 100 etree-ac-role root

3. Đặt router ID và số hệ tự trị (AS number) cho Router PE1

[edit routing-options]

user@PE1#set  routing-options router-id 10.255.0.1

user@PE1#set  routing-options autonomous-system 65000

4. Bật LDP trên tất cả các giao diện của Router PE1, ngoại trừ giao diện quản lý

[edit protocols]

user@PE1# set ldp interface all

user@PE1# set ldp interface fxp0.0 disable

5. Gán địa chỉ local và địa chỉ neighbor cho nhóm BGP trên Router PE1 để thiết lập phiên BGP với các Router PE2 và PE3

[edit protocols]

user@PE1#set  bgp group evpn local-address 10.255.0.1

user@PE1#set  bgp group evpn neighbor 10.255.0.2

user@PE1#set  bgp group evpn neighbor 10.255.0.3

6. Thiết lập hệ tự trị (AS) local và của peer

user@PE1#set  protocols bgp group evpn peer-as 65000

user@PE1#set  protocols bgp group evpn local-as 65000

7. Thêm EVPN signaling Network Layer Reachability Information (NLRI) vào nhóm BGP

[edit protocols]

user@PE1#set  bgp group evpn family evpn signaling

8. Cấu hình OSPF trên tất cả các giao diện của Router PE1, ngoại trừ giao diện quản lý

[edit protocols]

user@PE1#set ospf area 0.0.0.0 interface all

user@PE1#set ospf area 0.0.0.0 interface fxp0.0 disable

9. Cấu hình MPLS trên tất cả các giao diện của Router PE1, ngoại trừ giao diện quản lý

[edit protocols]

user@PE1#set  mpls interface all

user@PE1#set  mpls interface fxp0.0 disable

 
10. Cấu hình phiên định tuyến EVPN.

[edit routing-instances]

user@PE1# set evpna instance-type evpn

11. Thiết lập VLAN ID cho bridging domain trong routing instance kiểu EVPN-A

[edit routing-instances]

user@PE1# set evpna vlan-id 100

12. Cấu hình tên giao diện cho routing instance evpna

[edit routing-instances]

user@PE1#set evpna interface xe-2/1/1.100

13. Cấu hình Route Distinguisher cho routing instance evpna

[edit routing-instances]

user@PE1#set evpna route-distinguisher 10.255.0.1:100

14. Gán tên giao diện kết nối site PE1 vào VPN

[edit routing-instances]

user@PE1#set evpna protocols evpn interface xe-2/1/1.100

15. Cấu hình dịch vụ Ethernet VPN E-Tree trên PE1

[edit routing-instances]

user@PE1#set evpna protocols evpn evpn-etree

16. Cấu hình cộng đồng VRF target cho routing instance evpna

[edit routing-instances]

user@PE1#set evpna vrf-target target:65000:100

Kết quả

Từ chế độ cấu hình (configuration mode), hãy xác nhận cấu hình của bạn bằng cách nhập các lệnh sau: show interfaces, show routing-options, show routing-instances. Nếu kết quả đầu ra không hiển thị đúng cấu hình như mong muốn, hãy lặp lại các bước hướng dẫn trong ví dụ này để sửa lại cấu hình cho chính xác.

user@PE1 show interfaces

xe-2/0/0 {

    unit 0 {

        family inet {

            address 10.0.0.1/30;

        }

        family mpls;

    }

}

xe-2/1/3 {

    unit 0 {

        family inet {

            address 10.0.0.5/30;

        }

        family mpls;

    }

}

 

lo0 {

    unit 0 {

        family inet {

            address 10.255.0.1/32 {

                primary;

                preferred;

            }

        }

    }

}

xe-2/1/1 {

    flexible-vlan-tagging;

    encapsulation flexible-ethernet-services;

    unit 100 {

        encapsulation vlan-bridge;

        vlan-id 100;

        etree-ac-role root;

    }

}

user@PE1 show routing-options

router-id 10.255.0.1;

autonomous-system 65000;

user@PE1 show protocols

mpls {

    interface all;

    interface fxp0.0 {

        disable;

    }

}

bgp {

    group evpn {

        local-address 10.255.0.1;

        family evpn {

            signaling;

        }

        peer-as 65000;

        local-as 65000;

        neighbor 10.255.0.2;

        neighbor 10.255.0.3;

    }

}

ospf {

    area 0.0.0.0 {

        interface all;

        interface fxp0.0 {

            disable;

        }

    }

}

ldp {

    interface all;

    interface fxp0.0 {

        disable;

    }

}

user@PE1 #show routing-instances

evpna {

    instance-type evpn;

    vlan-id 100;

    interface xe-2/1/1.100;

    route-distinguisher 10.255.0.1:100;

    vrf-target target:65000:100;

    protocols {

        evpn {

            interface xe-2/1/1.100;

            evpn-etree;

        }}}

Xác minh

Xác nhận rằng cấu hình đang hoạt động đúng cách

Xác minh trạng thái của EVPN Instance

Mục đích

Xác minh các routing instance EVPN và trạng thái hoạt động của chúng.

Thao tác

Từ chế độ vận hành (operational mode), chạy lệnh sau:

user@PE1>show evpn instance extensive

Instance: __default_evpn__

  Route Distinguisher: 10.255.0.1:0

  Number of bridge domains: 0

  Number of neighbors: 0

Instance: evpna

  Route Distinguisher: 10.255.0.1:100

  VLAN ID: 100

  Per-instance MAC route label: 16

  Etree Leaf label: 20

  MAC database status                     Local  Remote

    MAC advertisements:                       1       1

    MAC+IP advertisements:                    0       0

    Default gateway MAC advertisements:       0       0

  Number of local interfaces: 1 (1 up)

    Interface name  ESI                            Mode             Status     AC-Role

    xe-2/1/1.100    00:00:00:00:00:00:00:00:00:00  single-homed     Up         Root

  Number of IRB interfaces: 0 (0 up)

  Number of bridge domains: 1

    VLAN  Domain ID   Intfs / up    IRB intf   Mode             MAC sync  IM route label  SG sync  IM core nexthop

    100                  1    1                Extended         Enabled   30              Disabled

  Number of neighbors: 2

    Address               MAC    MAC+IP        AD        IM        ES Leaf-label

    10.255.0.2              0         0         1         1         0        20

    10.255.0.3              1         0         1         1         0        20

  Number of ethernet segments: 0

Ý nghĩa

Kết quả đầu ra của lệnh cung cấp các thông tin sau:

  • Danh sách các routing instance EVPN và virtual switch
  • Chế độ hoạt động của từng giao diện (interface)
  • Các peer (neighbor) của từng routing instance
  • Số lượng route khác nhau nhận được từ mỗi peer
  • Số lượng Ethernet segment trong từng routing instance
  • VLAN ID và MAC label tương ứng cho từng routing instance

Xác minh thuộc tính MAC local và remote

Mục đích

Xác minh thông tin trong bảng MAC EVPN, bao gồm cả địa chỉ MAC cục bộ và học được từ xa.

Thao tác

Từ chế độ vận hành (operational mode), chạy lệnh sau:

user@PE1>show evpn mac-table

MAC flags       (S -static MAC, D -dynamic MAC, L -locally learned, C -Control MAC

    O -OVSDB MAC, SE -Statistics enabled, NM -Non configured MAC, R -Remote PE MAC, P -Pinned MAC)

Routing instance : evpn_100

 Bridging domain : __evpn_100__, VLAN : 100

   MAC                 MAC      Logical          NH     MAC

   address             flags    interface        Index  property

   00:1d:b5:a2:15:2c   DC                        1048579 Leaf   

   64:87:88:5f:05:c0   DC                        1048578 Leaf   

   a8:d0:e5:54:38:21   D        xe-2/1/1.100            Root

Ý nghĩa

Kết quả đầu ra của lệnh cung cấp các thông tin sau:

  • Danh sách các địa chỉ MAC được học cục bộ (local) và thông qua control-plane

  • Thuộc tính của từng địa chỉ MAC, bao gồm thông tin về việc địa chỉ đó được học trên giao diện leaf hay root

 

Nếu bạn đã hoàn tất việc cấu hình thiết bị, hãy nhập lệnh commit từ chế độ cấu hình.

Chúc các bạn thực hiện thành công. Hi vọng bài viết này sẽ giúp ích cho các bạn trong công việc. Nếu bạn có vấn đề gì thắc mắc đừng ngần ngại liên hệ với chúng tôi theo thông tin dưới đây để được hỗ trợ thêm.

Hẹn gặp lại các bạn trong các bài viết tiếp theo!

CÔNG TY CỔ PHẦN DỊCH VỤ CÔNG NGHỆ DATECH

• Địa chỉ: Số 23E4 KĐT Cầu Diễn, Tổ 7, Phú Diễn, Bắc Từ Liêm, Hà Nội

• Điện thoại: 02432012368

• Hotline: 098 115 6699

• Email: info@datech.vn

• Website: https://datech.vn