• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
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.

Chương 3- Democấu hình mpls vpn (end)

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

  • Chương 3- Democấu hình mpls vpn (end)

    3.2 Demo cấu hình MPLS VPN điển hình :


    -Bài lab này minh họa nhà cung cấp dịch vụ cung cấp các kết nối cho các khách hàng qua mạng trục MPLS. Bằng cách sử dụng công nghệ MPLS VPN để đảm bảo tính riêng tư của khách hàng.
    Trong bài lab này, ta sẽ cấu hình cho toàn mô hình bao gồm phía khách hàng và nhà cung cấp dịch vụ. Trong đó:
    • A1_CE và A2_CE là 2 router của cùng 1 khách hàng A (Customer A).
    • B1_CE và B2_CE là 2 router của cùng 1 khách hàng B (Customer B).

    Cấu hình :
    Bước 1: Cấu hình cơ bản
    - Đặt hostname cho các router.
    - Đặt IP cho Router theo mô hình trong bài lab.
    Bước 2: Định tuyến IP trong mạng lõi của nhà cung cấp dịch vụ bằng cách dùng giao thức định tuyến OSPF.


    Trên ISP1_PE:
    ISP1_PE(config)#router ospf 1
    ISP1_PE(config-router)# network 5.5.5.5 0.0.0.0 area 0
    ISP1_PE(config-router)# network 192.168.12.0 0.0.0.255 area 0


    Trên ISP_P:
    ISP_P(config)#router ospf 1
    ISP_P(config-router)# network 192.168.23.0 0.0.0.255 area 0

    ISP_P(config-router)# network 192.168.12.0 0.0.0.255 area 0


    Trên ISP2_PE:
    ISP_P(config)#router ospf 1
    ISP_P(config-router)# network 7.7.7.7 0.0.0.0 area 0
    ISP_P(config-router)# network 192.168.23.0 0.0.0.255 area 0


    Kiểm tra bảng định tuyến trên ISP1_PE:
    ISP1_PE#show ip route
    Gateway of last resort is not set
    C 192.168.12.0/24 is directly connected, Serial0/0
    5.0.0.0/24 is subnetted, 1 subnets
    C 5.5.5.0 is directly connected, Loopback0
    6.0.0.0/32 is subnetted, 1 subnets
    O 6.6.6.6 [110/65] via 192.168.12.1, 00:15:13, Serial0/0
    7.0.0.0/32 is subnetted, 1 subnets
    O 7.7.7.7 [110/129] via 192.168.12.1, 00:11:52, Serial0/0
    O 192.168.23.0/24 [110/128] via 192.168.12.1, 00:13:56, Serial0/0
    Ping kiểm tra.
    ISP1_PE#ping 7.7.7.7 source 5.5.5.5
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 7.7.7.7, timeout is 2 seconds:
    Packet sent with a source address of 5.5.5.5
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 16/51/88 ms

    Bước 3: Cấu hình MPLS trong mạng lõi nhà cung cấp dịch vụ
    Ta thưc hiện theo thứ tự:
    • Chạy giao thức phân phối nhãn :
    - Lệnh cấu hình : mpls label protocol {ldp|tdp}
    - Trong đó LDP là giao thức phân phối nhãn phổ biến nhất hiện nay trên các Router của các hãng sản xuất khác nhau - TDP là giao thức chuẩn đóng, chỉ có trên các Router của Cisco. Do đó, khi cấu hình nên dùng giao thức LDP để có thể sử dụng Router Cisco và Router Non-Cisco trong cùng MPLS Domain được, nhằm nâng tính linh động của hệ thống mạng.
    - Ta có thể gán giao thức phân phối nhãn toàn cục cho MPLS Router
    (config)#mpls label protocol {ldp|tdp}
    Hoặc cũng có thể gán cho từng giao tiếp:
    (config-if)#mpls label protocol {ldp|tdp}

    • Bật tính năng MPLS trên cổng : (config-if)#mpls ip
    ISP1_PE(config)# interface s0/0
    ISP1_PE(config-if)#mpls label protocol ldp
    ISP1_PE(config-if)#mpls ip

    ISP_P(config)# interface s0/0
    ISP_P(config-if)#mpls label protocol ldp
    ISP_P(config-if)#mpls ip
    ISP_P(config)# interface s0/1
    ISP_P(config-if)#mpls label protocol ldp
    ISP_P(config-if)#mpls ip

    ISP2_PE(config)# interface s0/0
    ISP2_PE(config-if)#mpls label protocol ldp
    ISP2_PE(config-if)#mpls ip
    Kiểm tra việc MPLS đã thiết lập được láng giềng chưa. Thực hiện trên ISP2_PE
    ISP2_PE #show mpls ldp neighbor
    Peer LDP Ident: 6.6.6.6:0; Local LDP Ident 7.7.7.7:0
    TCP connection: 6.6.6.6.646 - 7.7.7.7.28929
    State: Oper; Msgs sent/rcvd: 15/13; Downstream
    Up time: 00:04:30
    LDP discovery sources:
    Serial0/0, Src IP addr: 192.168.23.1
    Addresses bound to peer LDP Ident:
    192.168.12.1 192.168.23.1 6.6.6.6
    Xem bảng forwarding-table trên ISP1_PE
    ISP1_PE #show mpls forwarding-table
    Local Outgoing Prefix Bytes tag Outgoing Next Hop
    tag tag or VC or Tunnel Id switched interface
    16 Untagged 6.6.6.6/32 0 Se0/0 point2point
    17 17 7.7.7.7/32 0 Se0/0 point2point
    18 Pop tag 192.168.23.0/24 0 Se0/0 point2point

    Bước 4: Tạo bảng VRF tương ứng cho từng khách hàng trên các router PE
    Trình tự khai báo gồm các bước như sau:
    • Tạo bảng VRF
    • Đăng kí Route Distinguisher cho VRF
    • Chỉ ra các giá trị Route target xuất và nhập

    Tạo bảng VRF :
    Sử dụng câu lệnh: (config)# ip vrf [vrf_name]
    Trong đó vrf_name là tên của vrf cần tạo, tên của vrf là case-sensitive, tức là có sự phân biệt chữ thường và chữ hoa. Nó chỉ có ý nghĩa cục bộ
    Muốn xoá vrf ra khỏi router: no ip vrf [vrf_name]

    Đăng kí RD:
    VRF sẽ không hoạt động nếu không có giá trị RD đăng kí cho nó. Đăng kí rd vào VRF bằng câu lệnh sau: (config-vrf)# rd [route-distinguisher]
    + Mỗi VRF chỉ có một giá trị rd duy nhất.
    + Có thể sử dụng format ASN:nn hoặc A.B.C.D:nn để đăng kí cho RD.

    Chỉ ra giá trị Route Target import và export:
    Để tạo route-target extended community cho VRF :(config-vrf)# route-target
    Để tắt cấu hình route-target, sử dụng lệnh no.
    Cú pháp câu lệnh :
    route-target {import | export | both} route-target-ext-community
    no route-target {import | export | both} route-target-ext-community
    + Import: nhập thông tin định tuyến từ target VPN extended community
    + Export: xuất thông tin định tuyến đến target VPN extended community
    + Both: nhập cả thông tin định tuyến nhập và xuất đến target VPN extended
    community.
    + Route-tartget-ext-community: là giá trị của route-target, format của route-target cũng tương tự như route-distinguisher, có thể là AS:nn hoặc A.B.C.D:nn.
    Customer A:
    ISP1_PE (config)#ip vrf A
    ISP1_PE (config-vrf)#rd 12:12
    ISP1_PE(config-vrf)#route-target export 1:1
    ISP1_PE(config-vrf)#route-target import 2:2

    ISP2_PE(config)#ip vrf A
    ISP2_PE(config-vrf)#rd 12:12
    ISP2_PE(config-vrf)#route-target export 2:2
    ISP2_PE(config-vrf)#route-target import 1:1


    Customer B
    ISP1_PE(config)#ip vrf B
    ISP1_PE(config-vrf)#rd 34:34
    ISP1_PE(config-vrf)#route-target export 3:3
    ISP1_PE(config-vrf)#route-target import 4:4

    ISP2_PE(config)#ip vrf B
    ISP2_PE(config-vrf)#rd 34:34
    ISP2_PE(config-vrf)#route-target export 3:3
    ISP2_PE(config-vrf)#route-target import 4:4




    Kiểm tra bảng VRF đã được tạo trên ISP1_PE:
    ISP1_PE#show ip vrf
    Name Default RD Interfaces
    A 12:12
    B 34:34

    Bước 5: Kết hợp (associate) bảng VRF với các interface của từng khách hàng.
    Đăng ký interface vào VRF: Router(config-if)# ip vrf forwarding [vrf-name]
    Khi áp đặt interface vào vrf, địa chỉ ip trên interface sẽ bị loại bỏ đi, lúc đó ta cần cấu hình lại địa chỉ ip.
    Chuyển mạch CEF phải được bật lên trên interface.

    Customer A:
    ISP1_PE(config)# interface s0/1
    ISP1_PE(config-if)#ip vrf forwarding A
    ISP1_PE(config-if)#ip address 192.168.1.2 255.255.255.0

    ISP2_PE(config)# interface s0/1
    ISP2_PE(config-if)#ip vrf forwarding A
    ISP2_PE(config-if)#ip address 192.168.2.2 255.255.255.0

    Customer B:
    ISP1_PE(config)# interface s0/2
    ISP1_PE(config-if)#ip vrf forwarding B
    ISP1_PE(config-if)#ip address 192.168.3.2 255.255.255.0

    ISP2_PE(config)# interface s0/2
    ISP2_PE(config-if)#ip vrf forwarding B
    ISP2_PE(config-if)#ip address 192.168.4.2 255.255.255.0


    Kiểm tra bảng định tuyến VRF và ping:
    ISP1_PE#show ip route vrf A
    Routing Table: A
    Gateway of last resort is not set
    C 192.168.1.0/24 is directly connected, Serial0/1


    ISP1_PE#show ip route vrf B
    Routing Table: B
    Gateway of last resort is not set
    C 192.168.3.0/24 is directly connected, Serial0/2
    ISP1_PE#


    ISP1_PE#ping vrf A 192.168.1.1
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 1/22/72 m
    ISP1_PE#ping vrf B 192.168.3.1
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 20/44/76 ms
    ISP1_PE#


    Bước 6: Định tuyến giữa PE và CE. Bằng cách sử dụng giao thức định tuyến EIGRP
    Cấu hình trên các router PE phía nhà cung cấp dịch vụ:
    ISP1_PE(config)#router eigrp 1
    ISP1_PE(config-router)#address-family ipv4 vrf A
    ISP1_PE(config-router-af)#network 192.168.1.0
    ISP1_PE(config-router-af)#redistribute bgp 24 metric 1000 100 255 1 1200
    ISP1_PE(config-router-af)#autonomous-system 101
    ISP1_PE(config-router-af)#no auto-summary
    ISP1_PE(config-router-af)#exit
    ISP1_PE(config-router)#address-family ipv4 vrf B
    ISP1_PE(config-router-af)#network 192.168.3.0
    ISP1_PE(config-router-af)#redistribute bgp 24 metric 1000 100 255 1 1200
    ISP1_PE(config-router-af)#autonomous-system 202
    ISP1_PE(config-router-af)#no auto-summary
    ISP1_PE(config-router-af)#end

    ISP2_PE(config)#router eigrp 1
    ISP2_PE(config-router)#address-family ipv4 vrf A
    ISP2_PE(config-router-af)#network 192.168.2.0
    ISP2_PE(config-router-af)#redistribute bgp 24 metric 1000 100 255 1 1200
    ISP2_PE(config-router-af)#autonomous-system 101
    ISP2_PE(config-router-af)#no auto-summary
    ISP2_PE(config-router-af)#exit
    ISP2_PE(config-router)#address-family ipv4 vrf B
    ISP2_PE(config-router-af)#network 192.168.4.0
    ISP2_PE(config-router-af)#redistribute bgp 24 metric 1000 100 255 1 1200
    ISP2_PE(config-router-af)#autonomous-system 202
    ISP2_PE(config-router-af)#no auto-summary
    ISP2_PE(config-router-af)#end

    Cấu hình định tuyến EIGRP phía khách hàng:
    A1_CE(config)#router eigrp 101
    A1_CE(config-router)#network 192.168.1.0
    A1_CE(config-router)#network 1.0.0.0
    A1_CE(config-router)#no auto-summary

    A2_CE(config)#router eigrp 101
    A2_CE(config-router)#network 192.168.2.0
    A2_CE(config-router)#network 2.0.0.0
    A2_CE(config-router)#no auto-summary

    B1_CE(config)#router eigrp 202
    B1_CE(config-router)#network 192.168.3.0
    B1_CE(config-router)#network 3.0.0.0
    B1_CE(config-router)#no auto-summary

    B2_CE(config)#router eigrp 202
    B2_CE(config-router)#network 192.168.4.0
    B2_CE(config-router)#network 4.0.0.0
    B2_CE(config-router)#no auto-summary

    Kiểm tra sự thiết lập quan hệ láng giềng trên router ISP1_PE.

    ISP1_PE#show ip eigrp vrf A neighbors
    IP-EIGRP neighbors for process 101
    H Address Interface Hold Uptime SRTT RTO Q Seq
    (sec) (ms) Cnt Num
    0 192.168.1.1 Se0/1 13 00:11:07 123 738 0 4

    ISP1_PE#show ip eigrp vrf B neighbors
    IP-EIGRP neighbors for process 202
    H Address Interface Hold Uptime SRTT RTO Q Seq
    (sec) (ms) Cnt Num
    0 192.168.3.1 Se0/2 12 00:12:18 158 948 0 7


    Bước 7: Định tuyến PE-PE bằng cách sử dụng giao thức định tuyến MP-BGP.
    Cấu hình tiến trình định tuyến BGP global:
    (config)#router bgp [autonomous-system]
    Tất cả láng giềng MP-BGP phải được cấu hình ở mode cấu hình định tuyến global BGP. Phiên MP-BGP phải chạy giữa các interface loopback.

    Thiết lập láng giềng MP-BGP giữa ISP1_PE và ISP2_PE:
    ISP1_PE(config)#router bgp 24
    ISP1_PE(config-router)#neighbor 7.7.7.7 remote-as 24
    ISP1_PE(config-router)#neighbor 7.7.7.7 update-source loopback 0

    ISP2_PE(config)#router bgp 24
    ISP2_PE(config-router)#neighbor 5.5.5.5 remote-as 24
    ISP2_PE(config-router)#neighbor 5.5.5.5 update-source loopback 0


    Cấu hình trao đổi các route VPNv4 address family:
    Bật tính năng trao đổi các prefix vpnv4
    (config-router)#address-family vpnv4
    (config-router-af)#neighbor {ip-address| peer-group-name} activate

    ISP1_PE(config)#router bgp 24
    ISP1_PE(config-router)#address-family vpnv4
    ISP1_PE(config-router-af)#neighbor 7.7.7.7 activate

    ISP2_PE(config)#router bgp 24
    ISP2_PE(config-router)#address-family vpnv4
    ISP2_PE(config-router-af)#neighbor 5.5.5.5 activate


    Kiểm tra thiết lập láng giềng:
    ISP1_PE# show ip bgp summary
    BGP router identifier 5.5.5.5, local AS number 24
    BGP table version is 1, main routing table version 1
    Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
    7.7.7.7 4 24 12 12 1 0 0 00:00:41 0

    Cấu hình IPv4 address family để trao đổi định tuyến giữa PE và CE:
    Cấu hình các tham số trên vrf giữa PE và CE:
    (config-router)#address-family ipv4 vrf [vrf-name]
    (config-router-af)#redistribute [router protocol]

    ISP1_PE(config)#router bgp 24
    ISP1_PE(config-router)#address-family ipv4 vrf A
    ISP1_PE(config-router-af)#redistribute eigrp 101
    ISP1_PE(config-router-af)#exit
    ISP1_PE(config-router)#address-family ipv4 vrf B
    ISP1_PE(config-router-af)#redistribute eigrp 202
    ISP1_PE(config-router-af)#end
    ISP1_PE#

    ISP2_PE(config)#router bgp 24
    ISP2_PE(config-router)#address-family ipv4 vrf A
    ISP2_PE(config-router-af)#redistribute eigrp 101
    ISP2_PE(config-router-af)#exit
    ISP2_PE(config-router)#address-family ipv4 vrf B
    ISP2_PE(config-router-af)#redistribute eigrp 202
    ISP2_PE(config-router-af)#end
    ISP2_PE#

    Kiểm tra bảng định tuyến của các router khách hàng và thực hiện ping kiểm tra:
    Trên A1_CE customer A:
    A1_CE#show ip route
    Gateway of last resort is not set
    1.0.0.0/24 is subnetted, 1 subnets
    C 1.1.1.0 is directly connected, Loopback0
    2.0.0.0/24 is subnetted, 1 subnets
    D 2.2.2.0 [90/2809856] via 192.168.1.2, 00:05:43, Serial0/0
    C 192.168.1.0/24 is directly connected, Serial0/0
    D 192.168.2.0/24 [90/2681856] via 192.168.1.2, 00:05:43, Serial0/0A1_CE#


    A1_CE#ping 2.2.2.2 source 1.1.1.1
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
    Packet sent with a source address of 1.1.1.1
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 28/77/180 msA1_CE#

    Trên B1_CE customer B:
    B1_CE#show ip route
    3.0.0.0/24 is subnetted, 1 subnets
    C 3.3.3.0 is directly connected, Loopback0
    4.0.0.0/24 is subnetted, 1 subnets
    D 4.4.4.0 [90/2809856] via 192.168.3.2, 00:05:30, Serial0/0
    D 192.168.4.0/24 [90/2681856] via 192.168.3.2, 00:05:30, Serial0/0
    C 192.168.3.0/24 is directly connected, Serial0/0
    B1_CE#
    B1_CE#ping 4.4.4.4 source 3.3.3.3
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 4.4.4.4 timeout is 2 seconds:
    Packet sent with a source address of 3.3.3.3
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 124/222/288 ms
    B1_CE#
    Lâm Văn Tú
    Email :
    cntt08520610@gmail.com
    Viet Professionals Co. Ltd. (VnPro)
    149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
    Tel: (08) 35124257 (5 lines)
    Fax (08) 35124314
    Tập tành bước đi....


Working...
X