1. Trang chủ
  2. » Thể loại khác

Lab Cấu hình MPLS cơ bản pptx

17 247 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 17
Dung lượng 53 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Success rate is 0 percent 0/5 Ping không thành công là do các router P1 và P2 không hề biết đến các mạng LAN của 2 router CE1 và CE2.. Để giải quyết vấn đề này, ta sử dụng MPLS trên các

Trang 1

+ Sơ đồ cấu hình như sau:

Như đã đề cập trong phần 3.1 thì quá trình cấu hình MPLS có thể được thể hiện gói gọn trong lược đồ sau:

+ Cấu hình toàn bộ

Do tính chất cấu hình giống nhau giữa CE1, PE1, P1 v CE2, PE2, P2 nn chỉ minh họa cấu hình tồn bộ của CE1, PE1, P1

+ Cấu hình CE1

Current configuration : 1467 bytes

!

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname CE1

!

no ip domain lookup

!

ip cef

ip audit po max-events 100

!

interface FastEthernet0/0

ip address 192.168.70.1 255.255.255.0

duplex half

no keepalive

!

interface Serial0/1

ip address 192.168.1.1 255.255.255.0

serial restart-delay 0

clock rate 64000

!

ip classless

ip route 0.0.0.0 0.0.0.0 192.168.1.2

no ip http server

no ip http secure-server

!

Trang 2

line con 0

exec-timeout 0 0

logging synchronous

stopbits 1

line aux 0

stopbits 1

line vty 0 4

exec-timeout 0 0

privilege level 15

logging synchronous

no login

!

!

end

+ Cấu hình PE1:

Current configuration : 1814 byte

!

version 12.3

service timestamps debug datetime service timestamps log datetime m

no service password-encryption

!

hostname PE1

!

no ip domain lookup

!

ip cef

ip audit po max-events 100

tag-switching tdp router-id Loopb

!

interface Loopback0

ip address 1.1.1.1 255.255.255.2

!

interface Serial0/1

ip address 192.168.1.2 255.255.2 serial restart-delay 0

!

!

router ospf 1

log-adjacency-changes

network 0.0.0.0 255.255.255.255

!

router bgp 1

no synchronization

Trang 3

bgp log-neighbor-changes

network 1.1.1.1 mask 255.255.255 redistribute static

neighbor 4.4.4.4 remote-as 1

neighbor 4.4.4.4 update-source L

no auto-summary

!

line con 0

exec-timeout 0 0

logging synchronous

stopbits 1

line aux 0

stopbits 1

line vty 0 4

exec-timeout 0 0

privilege level 15

logging synchronous

no login

!

!

end

+ Cấu hình P1

Current configuration : 1637 bytes

!

version 12.3

service timestamps debug datetime msec service timestamps log datetime msec

no service password-encryption

!

hostname P1

!

no ip domain lookup

!

ip cef

ip audit po max-events 100

tag-switching tdp router-id Loopback0

!

interface Loopback0

ip address 2.2.2.2 255.255.255.255

!

interface Serial0/0

ip address 10.0.0.1 255.255.255.0

tag-switching ip

serial restart-delay 0

clock rate 64000

Trang 4

interface Serial0/1

ip address 11.0.0.1 255.255.255.0

tag-switching ip

serial restart-delay 0

clock rate 64000

!

router ospf 1

log-adjacency-changes

network 0.0.0.0 255.255.255.255 area 0

!

line con 0

exec-timeout 0 0

logging synchronous

stopbits 1

line aux 0

stopbits 1

line vty 0 4

exec-timeout 0 0

privilege level 15

logging synchronous

no login

!

!

end

+ Cấu hình chi tiết

+ Bước 1 : cấu hình địa chỉ cho các router

CE1(config)#interface s0/1

CE1(config-if)#ip address 192.168.1.1 255.255.255.0 CE1(config-if)#clock rate 64000

CE1(config-if)#no shutdown

CE1(config-if)#exit

CE1(config)#interface e0/0

CE1(config-if)#ip address 192.168.70.1 255.255.255.0 CE1(config-if)#no keepalive

CE1(config-if)#no shutdown

Trang 5

-PE1(config)#interface s0/1

PE1(config-if)#ip address 192.168.1.2 255.255.255.0

PE1(config-if)#clock rate 64000

PE1(config-if)#no shutdown

PE1(config-if)#exit

PE1(config)#interface s0/0

PE1(config-if)#ip address 10.0.0.2 255.255.255.0

PE1(config-if)#no shutdown

PE1(config)#interface lo0

PE1(config-if)#ip address 1.1.1.1 255.255.255.255

- P1(config)#interface s0/0

P1(config-if)#ip address 10.0.0.1 255.255.255.0

P1(config-if)#clock rate 64000

P1(config-if)#no shutdown

P1(config-if)#exit

P1(config)#interface s0/1

P1(config-if)#ip address 11.0.0.1 255.255.255.0

P1(config-if)#clock rate 64000

P1(config-if)#no shutdown

P1(config)#interface lo0

P1(config-if)#ip address 2.2.2.2 255.255.255.255

-P2(config)#interface s0/1

P2(config-if)#ip address 11.0.0.2 255.255.255.0

Trang 6

P2(config-if)#clock rate 64000

P2(config-if)#no shutdown

P2(config-if)#exit

P2(config)#interface s0/0

P2(config-if)#ip address 12.0.0.2 255.255.255.0

P2(config-if)#clock rate 64000

P2(config-if)#no shutdown

P2(config)#interface lo0

P2(config-if)#ip address 3.3.3.3 255.255.255.255

- PE2(config)#interface s0/0

PE2(config-if)#ip address 12.0.0.2 255.255.255.0

PE2(config-if)#clock rate 64000

PE2(config-if)#no shutdown

PE2(config-if)#exit

PE2(config)#interface s0/1

PE2(config-if)#ip address 192.168.2.2 255.255.255.0

PE2(config-if)#no shutdown

PE2(config)#interface lo0

PE2(config-if)#ip address 4.4.4.4 255.255.255.255

- CE2(config)#interface s0/1

CE2(config-if)#ip address 192.168.2.1 255.255.255.0

CE2(config-if)#clock rate 64000

CE2(config-if)#no shutdown

Trang 7

CE2(config)#interface e0/0

CE2(config-if)#ip address 192.168.80.1 255.255.255.0

CE2(config-if)#no keepalive

CE2(config-if)#no shutdown

+ bước 2 : cấu hình định tuyến cho các router Router CE1 , CE2 chỉ sửdụng định tuyến tĩnh để đi đến mạng của ISP Router PE1 , PE2 chạy giao thức BGP , router P1 , P2 chạy giao thức OSPF.

CE1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2

-

PE1(config)#router ospf 1

PE1(config-router)#network 0.0.0.0 0.0.0.0 area 0

PE1(config)#router bgp 1

PE1(config-router)#no synchronization

PE1(config-router)#network 1.1.1.1 mask 255.255.255.255

PE1(config-router)#neighbor 4.4.4.4 remote-as 1

PE1(config-router)#neighbor 4.4.4.4 update-source lo0

PE1(config-router)#redistribute static

-

P1(config)#router ospf 1

P1(config-router)# network 2.2.2.2 0.0.0.0 area 0

P1(config-router)# network 10.0.0.0 0.0.0.255 area 0

P1(config-router)# network 11.0.0.0 0.0.0.255 area 0

P1(config-router)# network 0.0.0.0 255.255.255.255 area 0

-

P2(config)#router ospf 1

P2(config-router)#network 3.3.3.3 0.0.0.0 area 0

Trang 8

P2(config-router)#network 11.0.0.0 0.0.0.255 area 0

P2(config-router)#network 12.0.0.0 0.0.0.255 area 0

P2(config-router)#network 0.0.0.0 255.255.255.255 area 0

-

PE2(config)#router ospf 1

PE2(config-router)#network 0.0.0.0 0.0.0.0 area 0

PE2(config)#router bgp 1

PE2(config-router)#no synchronization

PE2(config-router)#network 4.4.4.4 mask 255.255.255.255

PE2(config-router)#neighbor 1.1.1.1 remote-as 1

PE2(config-router)#neighbor 1.1.1.1 update-source lo0

PE2(config-router)#redistribute static

-

CE2(config)#ip route 0.0.0.0 0.0.0.0 128.107.10.5

+ Bước 3 : Kiểm tra bảng định tuyến

Tag-switching hay MPLS sẽ không làm việc nếu trong mạng service provider phần định tuyến không chạy

CE1#sh ip route

Gateway of last resort is 192.168.1.2 to network 0.0.0.0

C 192.168.1.0/24 is directly connected, Serial0/1

C 192.168.70.0/24 is directly connected, FastEthernet0/0

S* 0.0.0.0/0 [1/0] via 192.168.1.2

PE1#sh 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/65] via 10.0.0.1, 01:39:11, Serial0/0

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/129] via 10.0.0.1, 01:39:11, Serial0/0

4.0.0.0/32 is subnetted, 1 subnets

Trang 9

O 4.4.4.4 [110/193] via 10.0.0.1, 01:39:11, Serial0/0

10.0.0.0/24 is subnetted, 1 subnets

C 10.0.0.0 is directly connected, Serial0/0

11.0.0.0/24 is subnetted, 1 subnets

O 11.0.0.0 [110/128] via 10.0.0.1, 01:39:11, Serial0/0 12.0.0.0/24 is subnetted, 1 subnets

O 12.0.0.0 [110/192] via 10.0.0.1, 01:39:16, Serial0/0

C 192.168.1.0/24 is directly connected, Serial0/1

O 192.168.2.0/24 [110/256] via 10.0.0.1, 01:39:16, Serial0/0 P1#sh ip route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets

O 1.1.1.1 [110/65] via 10.0.0.2, 01:41:11, Serial0/0

2.0.0.0/32 is subnetted, 1 subnets

C 2.2.2.2 is directly connected, Loopback0

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/65] via 11.0.0.2, 01:41:11, Serial0/1

4.0.0.0/32 is subnetted, 1 subnets

O 4.4.4.4 [110/129] via 11.0.0.2, 01:41:11, Serial0/1

10.0.0.0/24 is subnetted, 1 subnets

C 10.0.0.0 is directly connected, Serial0/0

11.0.0.0/24 is subnetted, 1 subnets

C 11.0.0.0 is directly connected, Serial0/1

12.0.0.0/24 is subnetted, 1 subnets

O 12.0.0.0 [110/128] via 11.0.0.2, 01:41:14, Serial0/1

O 192.168.1.0/24 [110/128] via 10.0.0.2, 01:41:14, Serial0/0

O 192.168.2.0/24 [110/192] via 11.0.0.2, 01:41:14, Serial0/1 P2#sh ip route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets

O 1.1.1.1 [110/129] via 11.0.0.1, 01:42:13, Serial0/1

2.0.0.0/32 is subnetted, 1 subnets

O 2.2.2.2 [110/65] via 11.0.0.1, 01:42:13, Serial0/1

3.0.0.0/32 is subnetted, 1 subnets

C 3.3.3.3 is directly connected, Loopback0

4.0.0.0/32 is subnetted, 1 subnets

O 4.4.4.4 [110/65] via 12.0.0.2, 01:42:13, Serial0/0

10.0.0.0/24 is subnetted, 1 subnets

O 10.0.0.0 [110/128] via 11.0.0.1, 01:42:13, Serial0/1 11.0.0.0/24 is subnetted, 1 subnets

C 11.0.0.0 is directly connected, Serial0/1

12.0.0.0/24 is subnetted, 1 subnets

Trang 10

C 12.0.0.0 is directly connected, Serial0/0

O 192.168.1.0/24 [110/192] via 11.0.0.1, 01:42:18, Serial0/1

O 192.168.2.0/24 [110/128] via 12.0.0.2, 01:42:18, Serial0/0

PE2#sh ip route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets

O 1.1.1.1 [110/193] via 12.0.0.1, 01:43:12, Serial0/0

2.0.0.0/32 is subnetted, 1 subnets

O 2.2.2.2 [110/129] via 12.0.0.1, 01:43:12, Serial0/0

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/65] via 12.0.0.1, 01:43:12, Serial0/0

4.0.0.0/32 is subnetted, 1 subnets

C 4.4.4.4 is directly connected, Loopback0

10.0.0.0/24 is subnetted, 1 subnets

O 10.0.0.0 [110/192] via 12.0.0.1, 01:43:12, Serial0/0

11.0.0.0/24 is subnetted, 1 subnets

O 11.0.0.0 [110/128] via 12.0.0.1, 01:43:12, Serial0/0

12.0.0.0/24 is subnetted, 1 subnets

C 12.0.0.0 is directly connected, Serial0/0

O 192.168.1.0/24 [110/256] via 12.0.0.1, 01:43:13, Serial0/0

C 192.168.2.0/24 is directly connected, Serial0/1

CE2#sh ip route

Bây giờ ta kiểm tra xem mạng hoạt động như thế nào bằng cách dùng extended ping

từ mạng LAN của Router CE1 đến mạng LAN của Router CE2 :

CE1#ping

Gateway of last resort is 192.168.2.2 to network 0.0.0.0

C 192.168.80.0/24 is directly connected, FastEthernet0/0

C 192.168.2.0/24 is directly connected, Serial0/1

S* 0.0.0.0/0 [1/0] via 192.168.2.2

Protocol [ip]:

Target IP address: 192.168.80.1

Repeat count [5]:

Datagram size [100]:

Timeout in seconds [2]:

Extended commands [n]: y

Trang 11

Source address or interface: 192.168.70.1

Type of service [0]:

Set DF bit in IP header? [no]:

Validate reply data? [no]:

Data pattern [0xABCD]:

Loose, Strict, Record, Timestamp, Verbose[none]:

Sweep range of sizes [n]:

Type escape sequence to abort

Sending 5, 100-byte ICMP Echos to 192.168.80.1, timeout is 2 seconds:

Success rate is 0 percent (0/5)

Ping không thành công là do các router P1 và P2 không hề biết đến các mạng LAN của 2 router CE1 và CE2 Do đó nếu ta thực hiện ping từ CE1 đến CE2 thì gói tin sẽ bị P1 đánh rớt Để giải quyết vấn đề này, ta sử dụng MPLS trên các router của mạng ISP

+ Bước 4: Cấu hình MPLS trên các router

Cấu hình MPLS trên các router Như đã phân tích ở trên, vì các gói từ router CE1 và CE2 không cần phải gắn nhãn nên ta chỉ cấu hình MPLS trên các router của mạng ISP Cấu hình bằng cách sử dụng tag-switching Tag-switching phụ thuộc vào tag distribution protocol (TDP) để trao đổi gói tin giữa các tag switching router (TSR) Chỉ có các router của Cisco mới hiểu tag-switching Để cấu hình tag-switching, Cisco Express Forwarding (CEF) phải được bật lên cũng như tag-switching phải được bật trên các interface tương ứng

Lưu ý : Ta cũng có thể cấu hình MPLS thay vì cấu hình tag-switching, MPLS ra đời sau

tag-switching, hoạt động và có cấu hình tương tự như tag-switching Tuy nhiên MPLS phụ thuộc vào Label Distribution protocol (LDP) để trao đổi nhãn với các láng giềng Khi cấu hình MPLS, các câu lệnh đều giống như tag-switching nhưng chỉ khác ở chỗ thay vì

sử dụng lệnh tag-switching ip ta sử dụng câu lệnh mpls ip

P1(config)#ip cef

P1(config)#tag-switching advertise-tags

P1(config)#tag-switching ip

Trang 12

P1(config)#int s0/0

P1(config-if)#tag-switching ip

P1(config-if)#int s0/1

P1(config-if)#tag-switching ip

P1(config-if)#exit

-PE1(config)#ip cef

PE1(config)#tag-switching advertise-tags

PE1(config)#tag-switching ip

PE1(config)#int s0/0

PE1(config-if)#tag-switching ip

PE1(config-if)#exit

-P2(config)#ip cef

P2(config)#tag-switching advertise-tags

P2(config)#tag-switching ip

P2(config)#int s0/0

P2(config-if)#tag-switching ip

P2(config-if)#int s0/1

P2(config-if)#tag-switching ip

P2(config-if)#exit

-PE2(config)#ip cef

PE2(config)#tag-switching advertise-tags

PE2(config)#tag-switching ip

PE2(config)#int s0/0

Trang 13

PE2(config-if)#tag-switching ip

PE2(config-if)#exit

+ Bước 5:Kiểm tra tag-switching

Để kiểm tra xem switching đã được bật lên chưa , sử dụng câu lệnh show

tag-switching interfaces

PE1#sh tag-switching interfaces

Interface IP Tunnel Operational

Serial0/0 Yes (tdp) No Yes

P1#sh tag-switching interfaces

Interface IP Tunnel Operational

Serial0/0 Yes (tdp) No Yes

Serial0/1 Yes (tdp) No Yes

P2#sh tag-switching interfaces

Interface IP Tunnel Operational

Serial0/0 Yes (tdp) No Yes

Serial0/1 Yes (tdp) No Yes

CE2#sh tag-switching interfaces

Interface IP Tunnel Operational

Serial0/0 Yes (tdp) No Yes

+ Bước 6: Kiểm tra hoạt động mạng mpls

Cách tốt nhất để kiểm tra xem MPLS hoạt động hay chưa ta hãy thực hiện extended ping

từ mạng LAN của CE1 đến mạng LAN của CE2

CE1#ping

Protocol [ip]:

Target IP address: 192.168.80.1

Repeat count [5]:

Datagram size [100]:

Timeout in seconds [2]:

Extended commands [n]: y

Source address or interface: 192.168.70.1

Type of service [0]:

Trang 14

Set DF bit in IP header? [no]:

Validate reply data? [no]:

Data pattern [0xABCD]:

Loose, Strict, Record, Timestamp, Verbose[none]:

Sweep range of sizes [n]:

Type escape sequence to abort

Sending 5, 100-byte ICMP Echos to 192.168.80.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 92/93/96 ms

Ping thành công là nhờ vào quá trình chuyển mạch nhãn giữa các router trong mạng service provider Có thể giải thích quá trình này như sau :

Step 1 : Một host ở mạng 192.168.70.0 muốn gửi dữ liệu đến host ở mạng 192.168.80.0

Host này biết rằng host đích là ở đầu xa và chuyển frame đến default gateway của nó là CE1

Step 2 : CE1 nhận frame , bỏ qua thông tin lớp 2 , kiểm tra thông tin lớp 3 để xem thử có

đường đến mạng đích 192.168.80.0 hay không ? Không có route nào trong bảng định tuyến để đến mạng này (xem bảng định tuyến của CE1) nên nó chuyển gói tin đến router PE1 bằng route tĩnh

Step 3 : Router PE1 nhận gói tin và kiểm tra thông tin lớp 3 , nó biết có một route đến

mạng đích mà nó học được từ PE2 thông qua BGP Địa chỉ next-hop của mạng đầu xa là 4.4.4.4 Router PE1 gán nhãn vào gói tin và chuyển nó đến P1 :

PE1#sh tag-switching forwarding-table

Local Outgoing Prefix Bytes tag Outgoing Next Hop

tag tag or VC or Tunnel Id switched interface

16 Pop tag 2.2.2.2/32 0 Se2/0 point2point

17 17 3.3.3.3/32 0 Se2/0 point2point

18 19 4.4.4.4/32 0 Se2/0 point2point

19 Pop tag 11.0.0.0/24 0 Se2/0 point2point

20 19 12.0.0.0/24 0 Se2/0 point2point

21 21 192.168.2.0/24 0 Se2/0 point2point

Bằng cách quan sát ngõ ra của bảng trên , ta có thể thấy gói tin được gởi đi như một nhãn , hay trong trường hợp này là gói tin được tag Vì gói tin cần phải được chuyển đến 4.4.4.4 nên quan sát bảng trên ta thấy , router PE1 gắn nhãn 18 vào gói tin này , quan sát bảng trên ta biết được nhãn ngõ ra là 19 , interface ngõ ra là se0/0, chính là router P1

Ngày đăng: 25/07/2014, 07:21

TỪ KHÓA LIÊN QUAN

w