You are on page 1of 15

BÀI THÍ NGHIỆM

Tên bài thí nghiệm: MPLS L3 VPN


Môn học:....................................................
Họ tên sinh viên:................................................Mã số:.....................
Lớp – khóa:.................... Ngày thí nghiệm:......../......./.....
1. Mục tiêu
Trong khuôn khổ học phần, bài thí nghiệm này giúp sinh viên:
- Hiểu được nguyên lý chuyển mạch nhãn
- Hiểu được nguyên lý hoạt động của L3VPN, biết cách cấu hình triển khai
L3VPN
- Phát triển kỹ năng tự đánh giá/phân tích/giải thích kết quả thí nghiệm

2. Topology và yêu cầu bài Lab


Sơ đồ thực hiện bài LAB

Bảng subnet và địa chỉ IP các interface:


Thiết bị Interface Subnet IP
MX1 Lo0.0 10.10.10.10/32
Ae11.11 192.168.11.0/24 192.168.11.1
Lo0.1 10.0.0.0/16 10.0.0.1/32
Lo0.2 10.255.0.0/16 10.255.0.1/32

1
H1 Loopback 0 1.1.1.1/32
Vlanif 11 192.168.11.0/24 192.168.11.2
Vlanif 13 192.168.13.0/24 192.168.13.1
H2 Loopback 0 2.2.2.2/32
Vlanif 23 192.168.23.0/24 192.168.23.1
Vlanif 22 192.168.22.0/24 192.168.22.2
H3 Loopback 0 3.3.3.3/32
Vlanif 13 192.168.13.0/24 192.168.13.2
Vlanif 23 192.168.23.0/24 192.168.23.2
MX2 Lo0.0 20.20.20.20/32
Ae22.22 192.168.22.0/24 192.168.22.1
Lo0.1 10.1.0.0/16 10.1.0.1/32
Lo0.2 10.254.0.0/16 10.254.0.1/32

Yêu cầu:
- Cấu hình được IGP (OSPF) giữa các thiết bị
- Cấu hình được MPLS, LDP giữa các thiết bị
- Cấu hình được MP-BGP giữa các router chạy VPN (PE)
- Ping thông giữa các site thuộc cùng khách hàng
- Các site của 2 khách hàng khác nhau không ping được nhau
3. Thao tác
Sinh viên tiến hành các bước sau:
Công Nội dung Hướng dẫn thao tác Kết quả trông đợi
việc
1 Chuẩn bị 1.1. Khởi động các thiết bị Thiết bị UP, đèn
Switch và Router theo như sơ thiết bị sáng bình
đồ đính kèm thường
1.2. Shutdown port xg0/0/11,
xg0/0/12, xg0/0/13, xg0/0/14
trên H3, xg0/0/1 và xg0/0/2 trên
H1 và H2
1.3. Thực hiện đấu nối các kênh
như sơ đồ
2 Cấu hình cơ bản 2.1. Các bước thực hiện tương Ping được giữa 2 P
(LACP, đặt IP), tự bài Lab Chuyển mạch nhãn router (MX), kết
định tuyến MPLS quả trace thể hiện rõ

2
OSPF, chuyển (Xem phụ lục hướng dẫn cấu label được gán cho
mạch nhãn hình) từng hop
MPLS LDP
3 Cấu hình MP- 3.1. Cấu hình iBGP cho MX1 2 MX lên thiết lập
BGP cho các PE và MX2, với peer là MX đối được phiên iBGP,
(MX1, MX2) diện, update-source là IP bật VPNv4
loopback 0 unit 0, AS 2345
3.2. Bật tính năng VPNv4
4 Tạo VRF cho 4.1. Tạo VRF customerA và VRF được tạo với
từng khách hàng customerB trên MX1, MX2 đúng RD, RT
4.2. Cấu hình RT, RD theo quy import/export
hoạch, import route của site đối Interface được đặt
diện vào đúng VRF
4.3. Gán các interface loopback
như đã quy hoạch vào VRF
5 Kiểm tra kết nối 5.1. Ping test giữa 2 interface Site thuộc cùng 1
irb thuộc cùng khách hàng khách hàng ping
5.2. Ping test giữa 2 interface được đến nhau và
irb thuộc 2 khách hàng khác không ping được tới
nhau site của khách hàng
khác

4. Báo cáo kết quả


Sinh viên chụp lại kết quả đã thao tác và nộp cùng báo cáo theo mẫu:
Stt Kịch bản Kết quả
1 Cấu hình MPLS LDP Kết quả trace từ MX1 tới MX2
với các label
(hoặc kết quả bắt gói tin trên
laptop với các label trong phần
header)
2 Cấu hình 2 site cho 2 khách hàng Kết quả ping giữa 2 site thuộc
cùng khách hàng
Kết quả ping giữa site 1 khách
hàng A tới site 2 khách hàng B
*** Sinh viên được yêu cầu thoát ứng dụng, tắt các thiết bị.
5. Câu hỏi

3
Sau buổi thí nghiệm, sinh viên được yêu cầu trả lời các câu hỏi sau:
Stt Câu hỏi Trả lời của sinh viên Điểm
1 Giải thích ngắn gọn cơ quá trình
thiết lập 1 kênh L3VPN giữa 2 site
khách hàng
2 Cơ chế nào giúp các site khách hàng
khác nhau không ping được đến
nhau?

6. Phụ lục: Hướng dẫn thực hành


Phụ lục 1: Cấu hình cơ bản
#MX1
configure
set interfaces ae11 vlan-tagging //Cấu hình encapsulation theo chuẩn 802.1Q
set interfaces ae11 unit 11 vlan-id 11 // Tag vlan 11 với subinterface unit 11
set interfaces ae11 unit 11 family inet address 192.168.11.1/24 //Đặt ip address cho
subinterface
set interfaces lo0 unit 0 family inet address 10.10.10.10/32 //Đặt ip address cho interface
loopback 0 unit 0

#MX2
configure
set interfaces ae22 vlan-tagging //Cấu hình encapsulation theo chuẩn 802.1Q
set interfaces ae22 unit 22 vlan-id 22 // Tag vlan 22 với subinterface unit 22
set interfaces ae22 unit 22 family inet address 192.168.22.1/24 //Đặt ip address cho
subinterface
set interfaces lo0 unit 0 family inet address 20.20.20.20/32 //Đặt ip address cho interface
loopback 0 unit 0

4
#H1
system-view

interface XGigabitEthernet0/0/1
shutdown //Shutdown interface
quit
interface XGigabitEthernet0/0/2
shutdown //Shutdown interface
quit

vlan batch 11 13 //tạo vlan

interface vlan 11
ip address 192.168.11.2 255.255.255.0 //Đặt ip cho interface vlan
quit
interface vlan 13
ip address 192.168.13.1 255.255.255.0 //Đặt ip cho interface vlan
quit

interface Eth-Trunk 11
port link-type trunk
port trunk allow-pass vlan 11 //Allow vlan 11 trên Eth-Trunk
quit
interface Eth-Trunk 13
port trunk allow-pass vlan 13 //Allow vlan 13 trên Eth-Trunk
quit

interface LoopBack0
ip address 1.1.1.1 255.255.255.255

5
quit

#H2
system-view
interface XGigabitEthernet0/0/1
shutdown //Shutdown interface
quit
interface XGigabitEthernet0/0/2
shutdown //Shutdown interface
quit

vlan batch 22 23 //tạo vlan

interface vlan 22
ip address 192.168.22.2 255.255.255.0 //Đặt ip cho interface vlan
quit
interface vlan 23
ip address 192.168.23.1 255.255.255.0 //Đặt ip cho interface vlan
quit

interface Eth-Trunk 22
port link-type trunk
port trunk allow-pass vlan 22 //Allow vlan 22 trên Eth-Trunk
quit
interface Eth-Trunk 23
port trunk allow-pass vlan 23 //Allow vlan 23 trên Eth-Trunk
quit

interface LoopBack0

6
ip address 2.2.2.2 255.255.255.255
quit

#H3
system-view
vlan batch 13 23 //tạo vlan

interface vlan 13
ip address 192.168.13.2 255.255.255.0 //Đặt ip cho interface vlan
quit
interface vlan 23
ip address 192.168.23.2 255.255.255.0 //Đặt ip cho interface vlan
quit

interface Eth-Trunk 13
port trunk allow-pass vlan 13 //Allow vlan 13 trên Eth-Trunk
quit
interface Eth-Trunk 23
port trunk allow-pass vlan 23 //Allow vlan 23 trên Eth-Trunk
quit

interface LoopBack0
ip address 3.3.3.3 255.255.255.255
quit

Phụ lục 2: Cấu hình OSPF


#MX1
set routing-options router-id 10.10.10.10
set protocols ospf area 0 interface ae11.11

7
set protocols ospf area 0 interface lo0.0
commit

#MX2
set routing-options router-id 20.20.20.20
set protocols ospf area 0 interface ae22.22
set protocols ospf area 0 interface lo0.0
commit

#H1
ospf 1 router-id 1.1.1.1
area 0
network 1.1.1.1 0.0.0.0
network 192.168.11.0 0.0.0.255
network 192.168.13.0 0.0.0.255
quit
quit
quit
reset ospf process graceful-restart

#H2
ospf 1 router-id 2.2.2.2
area 0
network 2.2.2.2 0.0.0.0
network 192.168.23.0 0.0.0.255
network 192.168.22.0 0.0.0.255
quit
quit
quit

8
reset ospf process graceful-restart

#H3
ospf 1 router-id 3.3.3.3
area 0
network 3.3.3.3 0.0.0.0
network 192.168.23.0 0.0.0.255
network 192.168.13.0 0.0.0.255
quit
quit
quit
reset ospf process graceful-restart

Phụ lục 3: Cấu hình MPLS LDP trên các cổng đấu nối PE và P
#MX1
set interfaces ae11 unit 11 family mpls //Enable mpls
set protocol ldp interface ae11.11 //Enable ldp trên từng interface
set protocol ldp interface lo0.0
set protocol mpls interface ae11.11 //Enable mpls trên từng interface
set protocol mpls interface lo0.0
commit

#MX2
set interfaces ae22 unit 22 family mpls //Enable mpls
set protocol ldp interface ae22.22 //Enable ldp trên từng interface
set protocol ldp interface lo0.0
set protocol mpls interface ae22.22 //Enable mpls trên từng interface
set protocol mpls interface lo0.0
commit

9
commit

#H1
mpls lsr-id 1.1.1.1
mpls //Enable mpls
quit
mpls ldp //Enable mpls ldp
quit
interface vlan 13
mpls
mpls ldp //Enable mpls và mpls ldp trên interface vlan 13
interface vlan 11
mpls
mpls ldp //Enable mpls và mpls ldp trên interface vlan 11

quit

route recursive-lookup tunnel

#H2
mpls lsr-id 2.2.2.2
mpls //Enable mpls
quit
mpls ldp //Enable mpls ldp
quit
interface vlan 23
mpls
mpls ldp //Enable mpls và mpls ldp trên interface vlan 23

10
interface vlan 22
mpls
mpls ldp //Enable mpls và mpls ldp trên interface vlan 22
quit

route recursive-lookup tunnel //Enable iterate static routes cho MPLS LSPs

#H3
mpls lsr-id 3.3.3.3
mpls //Enable mpls
quit
mpls ldp //Enable mpls ldp
quit
interface vlan 13
mpls
mpls ldp //Enable mpls và mpls ldp trên interface vlan 13
quit
interface vlan 23
mpls
mpls ldp //Enable mpls và mpls ldp trên interface vlan 23
quit

Phụ lục 4: Kiểm tra cấu hình


Trên switch HW:
dis ospf peer brief //kiểm tra neighbor ospf
dis ip routing-table //kiểm tra các route đã học qua ospf, các neighbor cần biết route tới
loopback của nhau (full reachability)
dis mpls ldp adjacency //kiểm tra LDP neighbor trên các link, tất cả các thiết bị kết nối
trực tiếp phải lên neighbor với nhau

11
dis mpls ldp lsp all //kiểm tra LDP database
dis mpls lsp //kiểm tra LSP trên các switch phân đoạn core
<H2> tracert lsp -a 1.1.1.1 ip 2.2.2.2 32 //trace route từ H2 tới H1 để xem LSP

Trên Juniper:
show ospf neighbor //kiểm tra neighbor ospf
show ldp database //kiểm tra bảng nhãn tới các route
<MX1> ping mpls lsp-end-point 20.20.20.20 source 10.10.10.10 detail //ping từ
loopback0 của MX1 sang MX2, option detail cho thấy label được gán
<MX1> traceroute mpls ldp 20.20.20.20 source 10.10.10.10 no-res //trace từ loopback0
của MX1 sang MX2, thấy rõ được các hop và label được gán cho từng hop

Phụ lục 5: Cấu hình MP-BGP giữa 2 PE


#MX1
configure

set routing-options autonomous-system 2345


set protocols bgp group MPBGP local-address 10.10.10.10 //local id là IP loopback 0 unit 0
set protocols bgp group MPBGP family inet-vpn any
set protocols bgp group MPBGP peer-as 2345
set protocols bgp group MPBGP neighbor 20.20.20.20 //neighbor là IP loopback 0 unit 0
của MX2

commit

#MX2
Configure

set routing-options autonomous-system 2345

12
set protocols bgp group MPBGP local-address 20.20.20.20
set protocols bgp group MPBGP family inet-vpn any
set protocols bgp group MPBGP peer-as 2345
set protocols bgp group MPBGP neighbor 10.10.10.10

commit

Phụ lục 6: Tạo VRF và gán các interface vào VRF


#MX1
configure
set interfaces lo0 unit 1 family inet address 10.0.0.1/16 //gán IP theo quy hoạch, unit 1
cho khách hàng A
set interfaces lo0 unit 2 family inet address 10.255.0.1/16 //unit 2 cho khách hàng B

set routing-instances customerA instance-type vrf //tạo VRF


set routing-instances customerA interface lo0.1 //gán IP vào VRF
set routing-instances customerA route-distinguisher 10.10.10.10:1 //cấu hình RD
set routing-instances customerA vrf-target target:2345:1 //cấu hình RT
set routing-instances customerA vrf-table-label //tạo bảng định tuyến riêng

set routing-instances customerB instance-type vrf


set routing-instances customerB interface lo0.2
set routing-instances customerB route-distinguisher 10.10.10.10:2
set routing-instances customerB vrf-target target:2345:2
set routing-instances customerB vrf-table-label
commit

#MX2
configure

13
set interfaces lo0 unit 1 family inet address 10.1.0.1/16
set interfaces lo0 unit 2 family inet address 10.254.0.1/16

set routing-instances customerA instance-type vrf


set routing-instances customerA interface lo0.1
set routing-instances customerA route-distinguisher 20.20.20.20:1
set routing-instances customerA vrf-target target:2345:1
set routing-instances customerA vrf-table-label

set routing-instances customerB instance-type vrf


set routing-instances customerB interface lo0.2
set routing-instances customerB route-distinguisher 10.10.10.10:2
set routing-instances customerB vrf-target target:2345:2
set routing-instances customerB vrf-table-label
commit

Phụ lục 7: Kiểm tra cấu hình


Trên thiết bị Juniper
show configuration protocols bgp //kiểm tra cấu hình BGP
show bgp neighbor //kiểm tra trạng thái BGP peer sau khi cấu hình
show configuration routing-instances customerA | display set //kiểm tra cấu hình VRF,
option display set cho phép xem cấu hình dưới dạng lệnh
show route table bgp.l3vpn.0 //xem bảng routing-table các route được phân phối qua MP-
BGP
show route table customerA.inet.0 //xem bảng routing-table các route được phân phối
giữa 2 site VRF customerA, cần có các route connected và route phía site đầu xa
show route table customerB.inet.0 //tương tự với customerB

14
<MX1> traceroute 10.1.0.1 interface lo0.1 //trace tới địa chỉ lo0.1 (nằm trong VRF
customerA) của MX2, với source là lo0.1 (nằm trong VRF customerA) của MX1, kết quả gồm
các hop và label tương ứng được gán
<MX1> traceroute 10.1.0.1 interface lo0.2 //ping giữa 2 site của 2 khách hàng khác nhau

15

You might also like