Lab 4 – VxLAN trên CSR1000v
Trong bài thực hành này, học viên 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.
Tiếp theo chúng ta sẽ sử dụng giao thức định tuyến động OSPF kết hợp Multicast routing là Pim với chế độ sparse mode.
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.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.
Tiếp theo chúng ta tạo một môi trường Layer 2 bridge-domain có id là 10.
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.
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 đó.
- Sơ đồ
- Mô tả
Trong bài thực hành này, học viên 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.
- Các bước thực hiện
| 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 |
| 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 |
| CSR1K-3(config)#ip multicast-routing distributed CSR1K-3(config)#ip pim bidir-enable CSR1K-3(config)#ip pim rp-address 2.2.2.2 bidir |
| 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)#no shut CSR1K-1(config-if)#ip pim sparse-mode CSR1K-1(config-if)#ip ospf 1 area 0 |
| 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 |
| 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 |
| CSR1K-1(config)#int g1 CSR1K-1(config-if)#ip igmp join-group 239.10.10.1 |
| CSR1K-2(config)#int range g1-2 CSR1K-2(config-if-range)#ip igmp join-group 239.10.10.1 |
| CSR1K-3(config)#int g2 CSR1K-3(config-if)#ip igmp join-group 239.10.10.1 |
| 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. |
| CSR1K-3(config)#int nve 1 CSR1K-3(config-if)#member vni 10000 mcast-group 239.10.10.1 CSR1K-3(config-if)#source-interface loopback 0 |
| 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 |
| 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 |
- Kiểm tra cấu hình
| 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 |
| 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 |
| 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 |
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 đó.
| 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 |
| CSR1K-1#show ip route (……) 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 |