Tác giả:
Trần Thị Tố Uyên
Trần Thị Tố Uyên
LAB: OSPF SHAM-LINK
Mô tả:
Thực hiện
- Cấu hình địa chỉ ip và định nghĩa các VRF trên các PE.
- Cấu hình OSPF Sham-link theo các bước sau:
(1) Tạo các đầu cuối (endpoint) của sham-link:
- Tạo các giao tiếp loopback trên mỗi router PE và gắn kết nó vào VRF CustomerA của VPN. Địa chỉ loopback là một địa chỉ trong không gian địa chỉ của VPN, không được là không gian địa chỉ của nhà cung cấp dịch vụ MPLS VPN vì sham-link là một kết nối của khách hàng (CustomerA). - Tạo endpoint thực hiện trên PE1-AS1 và PE2-AS1 như sau:
PE1-AS1(config)#interface Loopback101
PE1-AS1(config-if)# description sham-link Endpoint on PE1-AS1
PE1-AS1(config-if)# ip vrf forwarding Cust_A
PE1-AS1(config-if)# ip address 172.16.101.1 255.255.255.255
PE2-AS1(config)#interface Loopback101
PE2-AS1(config-if)# description sham-link Endpoint on PE2-AS1
PE2-AS1(config-if)# ip vrf forwarding Cust_A
PE2-AS1(config-if)# ip address 172.16.102.1 255.255.255.255
PE1-AS1(config-if)# description sham-link Endpoint on PE1-AS1
PE1-AS1(config-if)# ip vrf forwarding Cust_A
PE1-AS1(config-if)# ip address 172.16.101.1 255.255.255.255
PE2-AS1(config)#interface Loopback101
PE2-AS1(config-if)# description sham-link Endpoint on PE2-AS1
PE2-AS1(config-if)# ip vrf forwarding Cust_A
PE2-AS1(config-if)# ip address 172.16.102.1 255.255.255.255
(2) Redistribute endpoint vào MP-BGP:
PE1-AS1(config)#router bgp 1
PE1-AS1(config-router)#address-family ipv4 vrf Cust_A
PE1-AS1(config-router-af)# redistribute connected
PE2-AS1(config)#router bgp 1
PE2-AS1(config-router)#address-family ipv4 vrf Cust_A
PE2-AS1(config-router-af)# redistribute connected
PE1-AS1(config-router)#address-family ipv4 vrf Cust_A
PE1-AS1(config-router-af)# redistribute connected
PE2-AS1(config)#router bgp 1
PE2-AS1(config-router)#address-family ipv4 vrf Cust_A
PE2-AS1(config-router-af)# redistribute connected
(3) Cho phép sham-link qua tiến trình OSPF VRF:
PE1-AS1(config)#router ospf 101 vrf Cust_A
PE1-AS1(config-router)#area 0 sham-link 172.16.101.1 172.16.102.1 cost 1
PE2-AS1(config)#router ospf 101 vrf Cust_A
PE2-AS1(config-router)#area 0 sham-link 172.16.102.1 172.16.101.1 cost 1
PE1-AS1(config-router)#area 0 sham-link 172.16.101.1 172.16.102.1 cost 1
PE2-AS1(config)#router ospf 101 vrf Cust_A
PE2-AS1(config-router)#area 0 sham-link 172.16.102.1 172.16.101.1 cost 1
Cấu hình
Router P1-AS1
!hostname P1-AS1
!
ip subnet-zero
!
ip cef
mpls ldp logging neighbor-changes
!
interface Loopback0
ip address 10.10.10.200 255.255.255.255
!
interface Serial0/0
description Connected to PE1-AS1
ip address 10.10.10.2 255.255.255.252
tag-switching ip
clockrate 64000
!
interface Serial0/1
description Connected to PE2-AS1
ip address 10.10.10.6 255.255.255.252
tag-switching ip
clockrate 64000
!
router ospf 1
log-adjacency-changes
network 10.0.0.0 0.255.255.255 area 0
!
ip http server
ip classless
!
end
Router PE1-AS1
!hostname PE1-AS1
!
ip subnet-zero
!
!
!
ip vrf CustomerA
rd 1:100
route-target export 1:100
route-target import 1:100
!
ip cef
mpls ldp logging neighbor-changes
!
interface Loopback0
ip address 10.10.10.101 255.255.255.255
!
interface Loopback101
description Sham-link Endpoint on PE1-AS1
ip vrf forwarding CustomerA
ip address 172.16.101.1 255.255.255.255
!
interface Serial0/0
description Connected to P1-AS1
ip address 10.10.10.1 255.255.255.252
tag-switching ip
!
interface Serial1/1
description Connected to CE1-A
ip vrf forwarding CustomerA
ip address 172.16.1.1 255.255.255.252
clockrate 64000
!
interface Serial1/3
description Connected to CE3-A
ip vrf forwarding CustomerA
ip address 172.16.3.1 255.255.255.252
!
router ospf 101 vrf CustomerA
router-id 172.16.101.1
log-adjacency-changes
area 0 sham-link 172.16.101.1 172.16.102.1
redistribute bgp 1 subnets
network 172.16.1.0 0.0.0.255 area 0
network 172.16.3.0 0.0.0.255 area 0
!
router ospf 1
router-id 10.10.10.101
log-adjacency-changes
network 10.0.0.0 0.255.255.255 area 0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 10.10.10.102 remote-as 1
neighbor 10.10.10.102 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 10.10.10.102 activate
neighbor 10.10.10.102 send-community both
no auto-summary
exit-address-family
!
address-family ipv4 vrf CustomerA
redistribute connected
redistribute ospf 101 match internal external 1 external 2
no auto-summary
no synchronization
exit-address-family
!
ip http server
ip classless
!
end
(còn tiếp)
Comment