Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

Lab 2: VxLAN trên CSR1000v

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lab 2: VxLAN trên CSR1000v

    Lab 2: VxLAN trên CSR1000v

    Click image for larger version  Name:	image.png Views:	0 Size:	20.3 KB ID:	429203

    1. Mô tả

    Trong bài thực hành này, chúng ta sẽ tiến hành cấu hình VxLAN trên router CSR1000V. Tính năng VxLAN trên CSR1000V chỉ hỗ trợ chế độ Multicast trong một vài trường hợp và cần phải có Feature License. Phiên bản hệ điều hành trên CSR1000v mà chúng ta sẽ sử dụng trong bài lab là phiên bản 3.12

    CSR1K-1 và CSR1K-3 đóng vai trò VTEPs. VTEPs sẽ truyền các giá trị domains của giao thức layer 2 PGALL-VS0 và PGALL-VS1 thông qua giao thức multicast routing lớp 3 của môi trường IP giữa 2 VTEPs trên.

    Chúng ta sẽ cấu hình PIM-BIDIR cho CSR1K-2 trở thành RP. PIM-BIDIR thì thích hợp cho hệ thống mạng với nhiều nguồn lưu lượng multicast và nhiều host tham gia vào multicast (multicast source và multicast receivers). VxLAN sẽ được sử dụng để cung cấp kết nối L2 giữa PGALL-VS0 và PGALL-VS1.

    2. Các bước thực hiện

    Tiến hành bật tính năng Multicast-routingBidirectional PIM trên các Router, chúng ta sẽ sử dụng Static RP để đơn giản hóa bài lab.

    Code:CSR1K-1(config)#ip multicast-routing distributed
    CSR1K-1(config)#ip pim bidir-enable
    CSR1K-1(config)#ip pim rp-address 2.2.2.2 bidir
    Code:CSR1K-2(config)#ip multicast-routing distributed
    CSR1K-2(config)#ip pim bidir-enable
    CSR1K-2(config)#ip pim rp-address 2.2.2.2 bidir
    Code:CSR1K-3(config)#ip multicast-routing distributed
    Code:CSR1K-3(config)#ip pim bidir-enable
    CSR1K-3(config)#ip pim rp-address 2.2.2.2 bidir
    Tiếp theo chúng ta sẽ sử dụng giao thức định tuyến động OSPF kết hợp Multicast routingPim với chế độ sparse mode.

    Code:CSR1K-1(config)#router ospf 1
    CSR1K-1(config-router)#router-id 1.1.1.1

    CSR1K-1(config)#int lo0
    CSR1K-1(config-if)#ip add 1.1.1.1 255.255.255.255
    CSR1K-1(config-if)#ip pim sparse-mode
    CSR1K-1(config-if)#ip ospf 1 area 0

    CSR1K-1(config)#int g1
    CSR1K-1(config-if)#ip add 10.1.1.1 255.255.255.0
    CSR1K-1(config-if)#ip pim sparse-mode
    CSR1K-1(config-if)#ip ospf 1 area 0
    Code:CSR1K-2(config)#router ospf 1
    CSR1K-2(config-router)#router-id 2.2.2.2

    CSR1K-2(config)#int lo0
    CSR1K-2(config-if)#ip add 2.2.2.2 255.255.255.255
    CSR1K-2(config-if)#ip pim sparse-mode
    CSR1K-2(config-if)#ip ospf 1 area 0

    CSR1K-2(config)#int g1
    CSR1K-2(config-if)#ip add 10.1.1.2 255.255.255.0
    CSR1K-2(config-if)#ip pim sparse-mode
    CSR1K-2(config-if)#ip ospf 1 area 0
    CSR1K-2(config-if)#no shut

    CSR1K-2(config)#int g2
    CSR1K-2(config-if)#ip add 10.2.2.2 255.255.255.0
    CSR1K-2(config-if)#no shut

    CSR1K-2(config-if)#ip pim sparse-mode
    CSR1K-2(config-if)#ip ospf 1 area 0
    Code:CSR1K-3(config)#router ospf 1
    CSR1K-3(config-router)#router-id 3.3.3.3


    CSR1K-3(config)#int lo0
    CSR1K-3(config-if)#ip address 3.3.3.3 255.255.255.255
    CSR1K-3(config-if)#ip pim sparse-mode
    CSR1K-3(config-if)#ip ospf 1 area

    CSR1K-3(config)#int g2
    CSR1K-3(config-if)#ip add 10.2.2.3 255.255.255.0
    CSR1K-3(config-if)#ip pim sparse-mode
    CSR1K-3(config-if)#ip ospf 1 area 0
    CSR1K-3(config-if)#no shut
    Trên các Router: chúng ta gán interface tham gia vào các nhóm multicast ip Multicast group 239.10.10.1 thông qua giao thực IGMP với lệnh ip igmp join-group 230.1.1.1.

    Code:CSR1K-1(config)#int g1
    CSR1K-1(config-if)#ip igmp join-group 239.10.10.1
    Code:CSR1K-2(config)#int range g1-2
    CSR1K-2(config-if-range)#ip igmp join-group 239.10.10.1
    Code:CSR1K-3(config)#int g2
    CSR1K-3(config-if)#ip igmp join-group 239.10.10.1
    Tiến hành tạo interface nve1, vni 10000 cũng như ánh xạ vni này cho Multicast-group 239.10.10.1 trên 2 router VTEPs.

    Code:CSR1K-1(config)#int nve 1
    CSR1K-1(config-if)#member vni 10000 mcast-group 239.10.10.1
    CSR1K-1(config-if)#source-interface loopback 0
    *Dec 20 14:09:41.685: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up à đường tunnel nve đã được thiết lập và ở trạng thái up.
    Code:CSR1K-3(config)#int nve 1
    Code:CSR1K-3(config-if)#member vni 10000 mcast-group 239.10.10.1
    CSR1K-3(config-if)#source-interface loopback 0
    Tiếp theo chúng ta tạo một môi trường Layer 2 bridge-domain có id10.

    Code:CSR1K-1(config)#int g3
    CSR1K-1(config-if)#service instance 10 ethernet
    CSR1K-1(config-if-srv)#encapsulation untagged
    CSR1K-1(config)#bridge-domain 10
    CSR1K-1(config-bdomain)#member vni 10000
    CSR1K-1(config-bdomain)#member gigabitEthernet 3 service-instance 10
    Code:CSR1K-3(config)#int g3
    CSR1K-3(config-if)#service instance 10 ethernet
    CSR1K-3(config-if-srv)#encapsulation untagged
    CSR1K-3(config)#bridge-domain 10
    CSR1K-3(config-bdomain)#member vni 10000
    CSR1K-3(config-bdomain)#member gigabitEthernet 3 service-instance 10

    3. Kiểm tra cấu hình

    Trước hết cần đảm bảo các Interface được sử dụng đều ở trạng thái Up.

    Code:CSR1K-1#show ip int br
    Interface IP-Address OK? Method Status Protocol
    GigabitEthernet1 10.1.1.1 YES NVRAM up up
    GigabitEthernet2 unassigned YES NVRAM administratively down down
    GigabitEthernet3 unassigned YES NVRAM up up
    GigabitEthernet4 unassigned YES NVRAM administratively down down
    Loopback0 1.1.1.1 YES NVRAM up up
    Tunnel0 1.1.1.1 YES unset up up
    nve1 unassigned YES unset up up
    Code:CSR1K-2#show ip int br
    Interface IP-Address OK? Method Status Protocol
    GigabitEthernet1 10.1.1.2 YES NVRAM up up
    GigabitEthernet2 10.2.2.2 YES NVRAM up up
    GigabitEthernet3 unassigned YES NVRAM administratively down down
    GigabitEthernet4 unassigned YES NVRAM administratively down down
    Loopback0 2.2.2.2 YES NVRAM up up
    Code:CSR1K-3#show ip int br
    Interface IP-Address OK? Method Status Protocol
    GigabitEthernet1 unassigned YES NVRAM administratively down down
    GigabitEthernet2 10.2.2.3 YES NVRAM up up
    GigabitEthernet3 unassigned YES NVRAM up up
    GigabitEthernet4 unassigned YES NVRAM administratively down down
    Loopback0 3.3.3.3 YES NVRAM up up
    Tunnel0 3.3.3.3 YES unset up up
    nve1 unassigned YES unset up up
    Thực hiện đặt ip và ping test giữa 2 PC trong LAN, có thể thấy 2 PC đã trao đổi được với nhau.
    Click image for larger version

Name:	image.png
Views:	0
Size:	0
ID:	429206

    Trên 1 thiết bị có vai trò làm VTEP bất kỳ, chúng ta thực hiện các câu lệnh show nve vni – để theo dõi thông tin VNI và trạng thái của VNI đó.

    Code:CSR1K-1#show nve vni
    Interface VNI Multicast-group VNI state
    nve1 10000 239.10.10.1 Up

    CSR1K-1#show nve peers
    Interface Peer-IP VNI Peer state
    nve1 3.3.3.3 10000 -

    CSR1K-1#show nve int nve 1 detail
    Interface: nve1, State: Admin Up, Oper Up Encapsulation: Vxlan
    source-interface: Loopback0 (primary:1.1.1.1 vrf:0)
    Pkts In Bytes In Pkts Out Bytes Out
    4 390 4 390
    Code:CSR1K-1#show ip route
    Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2
    i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
    ia - IS-IS inter area, * - candidate default, U - per-user static route
    o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
    a - application route
    + - replicated route, % - next hop override, p - overrides from PfR

    Gateway of last resort is not set

    1.0.0.0/32 is subnetted, 1 subnets
    C 1.1.1.1 is directly connected, Loopback0
    2.0.0.0/32 is subnetted, 1 subnets
    O 2.2.2.2 [110/2] via 10.1.1.2, 00:35:25, GigabitEthernet1
    3.0.0.0/32 is subnetted, 1 subnets
    O 3.3.3.3 [110/3] via 10.1.1.2, 00:35:15, GigabitEthernet1
    10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
    C 10.1.1.0/24 is directly connected, GigabitEthernet1
    L 10.1.1.1/32 is directly connected, GigabitEthernet1
    O 10.2.2.0/24 [110/2] via 10.1.1.2, 00:35:15, GigabitEthernet1​
    Last edited by nguyentienquynh; 2 weeks ago.
Working...
X