A. Mô hình 1
Cấu hình MPLS domain giữa PE01 – P – PE02
(IGP = RIPv2)
Cấu hình BGP AS 1 giữa PE01 và PE02
Trên PE01 tạo vrf A1 và B1 tương ứng với mỗi
Router A1,B1
Trên PE02 tạo vrf A2 và B2 tương ứng với mỗi
Router A2,B2
A1 – A2 – B1 – B2 chạy giao thức định tuyến
EIGRP
A1 : AS = 10
A2 : AS = 30
B1 : AS = 20
B2 : AS = 40
(1)192.168.1.0/24
(2)192.168.2.0/24 (3)192.168.3.0/24 (4)192.168.4.0/24 (5)192.168.5.0/24 (6)192.168.6.0/24 (7)Lo0: 10.10.10.10/24 |
(8)Lo0:
20.20.20.20/24
(9)Lo0: 1.1.1.1/24 (10)Lo0: 3.3.3.3/24 (11)Lo0: 2.2.2.2/24 (12)Lo0: 30.30.30.30/24 (13)Lo0: 40.40.40.40/24 |
hostname PE01
!
ip
cef
! no ip domain lookup ip vrf A1 rd 1:100 route-target export 1:100 route-target import 1:100 ! ip vrf B1 rd 1:200 route-target export 1:200 route-target import 1:200 ! interface Loopback0 ip address 1.1.1.1 255.255.255.0 ! interface Serial1/0 //cổng nối A1 ip vrf forwarding A1 ip address 192.168.1.2 255.255.255.0
mpls
label protocol ldp
mpls
ip
tag-switching
ip
clock rate 64000
! interface Serial1/1 //cổng nối B1 ip vrf forwarding B1 ip address 192.168.2.2 255.255.255.0
mpls
label protocol ldp
mpls
ip
tag-switching
ip
clock rate 64000 !
interface serial1/2 //cổng nối P
ip address 192.168.3.1 255.255.255.0 mpls label protocol ldp
mpls
ip
tag-switching ip
clock rate 64000
!
router
eigrp 100
no auto-summary !
address-family
ipv4 vrf B1
redistribute bgp 1 metric 1000 100 100 100 100
network 192.168.2.0 no auto-summary autonomous-system 20 exit-address-family address-family ipv4 vrf A1
redistribute bgp 1 metric 1000 100 100 100 100
network 192.168.1.0 no auto-summary autonomous-system 10 exit-address-family ! router rip version 2 network 1.0.0.0 network 192.168.3.0 no auto-summary ! router bgp 1 no synchronization bgp log-neighbor-changes neighbor 2.2.2.2 remote-as 1 //IP Lo cua PE2 neighbor 2.2.2.2 update-source Loopback0 no auto-summary address-family vpnv4 neighbor 2.2.2.2 activate neighbor 2.2.2.2 send-community extended exit-address-family address-family ipv4 vrf B1 redistribute eigrp 20 no auto-summary no synchronization exit-address-family address-family ipv4 vrf A1 redistribute eigrp 10 no auto-summary no synchronization exit-address-family
hostname A1
!
ip
cef
!
no
ip domain lookup
! interface Loopback0 ip address 10.10.10.10 255.255.255.0 ! interface Serial1/0 //cong noi voi PE1 ip address 192.168.1.1 255.255.255.0
mpls label protocol ldp
! router eigrp 10 network 10.0.0.0 network 192.168.1.0 no auto-summary
hostname B1
! ip cef ! no ip domain lookup ! interface Loopback0 ip address 20.20.20.20 255.255.255.0 ! interface Serial1/0 //cong noi voi PE1 ip address 192.168.2.1 255.255.255.0 clock rate 2000000 !
!
router eigrp 20 network 20.0.0.0 network 192.168.2.0 no auto-summary
hostname P
! ! ip cef ! interface Loopback0 ip address 3.3.3.3 255.255.255.0 ! interface Serial1/0 ip address 192.168.3.2 255.255.255.0 mpls label protocol ldp
mpls
ip
tag-switching ip ! interface Serial1/1 ip address 192.168.4.1 255.255.255.0 mpls label protocol ldp
mpls
ip
tag-switching ip ! router rip version 2 network 3.0.0.0 network 192.168.3.0 network 192.168.4.0 no auto-summary |
hostname PE02
! ip cef ! no ip domain lookup ip vrf A2 rd 1:100 route-target export 1:100 route-target import 1:100 ! ip vrf B2 rd 1:200 route-target export 1:200 route-target import 1:200 ! interface Loopback0 ip address 2.2.2.2 255.255.255.0 ! interface Serial1/1 //cổng nối A2 ip vrf forwarding A2 ip address 192.168.5.1 255.255.255.0
mpls
label protocol ldp
mpls
ip
tag-switching
ip
clock rate 64000 ! interface Serial1/2 //cổng nối B2 ip vrf forwarding B2 ip address 192.168.6.1 255.255.255.0 mpls label protocol ldp
mpls
ip
tag-switching
ip
clock rate 64000 !
interface Serial1/0
//cổng nối
P
ip address 192.168.4.2 255.255.255.0 mpls label protocol ldp
mpls
ip
tag-switching ip
clock rate 64000
! router eigrp 100 no auto-summary ! address-family ipv4 vrf B2 redistribute bgp 1 metric 1000 100 100 100 100 network 192.168.6.0 no auto-summary autonomous-system 40 exit-address-family ! address-family ipv4 vrf A2 redistribute bgp 1 metric 1000 100 100 100 100 network 192.168.5.0 no auto-summary autonomous-system 30 exit-address-family ! router rip version 2 network 2.0.0.0 network 192.168.4.0 no auto-summary ! router bgp 1 no synchronization bgp log-neighbor-changes neighbor 1.1.1.1 remote-as 1 //IP Lo cua PE1 neighbor 1.1.1.1 update-source Loopback0 no auto-summary ! address-family vpnv4 neighbor 1.1.1.1 activate neighbor 1.1.1.1 send-community extended exit-address-family ! address-family ipv4 vrf B2 redistribute eigrp 40 no auto-summary no synchronization exit-address-family ! address-family ipv4 vrf A2 redistribute eigrp 30 no auto-summary no synchronization exit-address-family
hostname A2
! ip cef ! no ip domain lookup ! interface Loopback0 ip address 30.30.30.30 255.255.255.0 ! interface Serial1/0 ip address 192.168.5.2 255.255.255.0 mpls label protocol ldp
!
router eigrp 30 network 30.0.0.0 network 192.168.5.0 no auto-summary
hostname B2
! ip cef ! no ip domain lookup ! interface Loopback0 ip address 40.40.40.40 255.255.255.0 ! interface Serial1/0 //cong noi voi PE2 ip address 192.168.6.2 255.255.255.0 duplex auto speed auto ! ! router eigrp 40 network 40.0.0.0 network 192.168.6.0 no auto-summary |
TEST MÔ HÌNH 1
B .Mô hình 2
Cấu hình
hostname PE1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip cef
!
!
!
!
ip vrf A1
rd 64999:1
route-target export 64999:1
route-target import 64999:1
!
ip vrf B1
rd 64999:2
route-target export 64999:2
route-target import 64999:2
!
no ip domain lookup
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip vrf forwarding A1
ip address 10.10.10.2 255.255.255.252
mpls label protocol ldp
mpls ip
clock rate 64000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
ip vrf forwarding B1
ip address 10.10.10.2 255.255.255.252
mpls label protocol ldp
mpls ip
clock rate 64000
!
interface Serial0/2
ip address 192.168.1.1 255.255.255.0
mpls label protocol ldp
mpls ip
clock rate 64000
!
interface Serial0/3
no ip address
shutdown
clock rate 2000000
!
router eigrp 100
no auto-summary
!
address-family ipv4 vrf B1
redistribute bgp 1 metric 1000 100 100 100 100
network 10.0.0.0
no auto-summary
autonomous-system 20
exit-address-family
!
address-family ipv4 vrf A1
redistribute bgp 1 metric 1000 100 100 100 100
network 10.0.0.0
no auto-summary
autonomous-system 10
exit-address-family
!
router rip
version 2
network 1.0.0.0
network 192.168.1.0
no auto-summary
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 1
neighbor 2.2.2.2 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf B1
redistribute eigrp 20
no synchronization
exit-address-family
!
address-family ipv4 vrf A1
redistribute eigrp 10
no synchronization
exit-address-family
hostname PE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip cef
!
!
!
!
ip vrf A2
rd 64999:1
route-target export 64999:1
route-target import 64999:1
!
ip vrf B2
rd 64999:2
route-target export 64999:2
route-target import 64999:2
!
no ip domain lookup
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip vrf forwarding A2
ip address 10.10.10.6 255.255.255.252
mpls label protocol ldp
mpls ip
clock rate 64000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
ip vrf forwarding B2
ip address 10.10.10.6 255.255.255.252
mpls label protocol ldp
mpls ip
clock rate 64000
!
interface Serial0/2
ip address 192.168.2.2 255.255.255.0
mpls label protocol ldp
mpls ip
clock rate 64000
!
interface Serial0/3
no ip address
shutdown
clock rate 2000000
!
router eigrp 100
no auto-summary
!
address-family ipv4 vrf B2
redistribute bgp 1 metric 1000 100 100 100 100
network 10.0.0.0
no auto-summary
autonomous-system 40
exit-address-family
!
address-family ipv4 vrf A2
redistribute bgp 1 metric 1000 100 100 100 100
network 10.0.0.0
no auto-summary
autonomous-system 30
exit-address-family
!
router rip
version 2
network 2.0.0.0
network 192.168.2.0
no auto-summary
!
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 1
neighbor 1.1.1.1 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf B2
redistribute eigrp 40
no synchronization
exit-address-family
!
address-family ipv4 vrf A2
redistribute eigrp 30
no synchronization
exit-address-family
!
hostname CE_A1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
!
interface Loopback0
ip address 11.11.11.11 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip address 10.10.10.1 255.255.255.252
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
router eigrp 10
network 10.0.0.0
network 11.0.0.0
no auto-summary
hostname CE_A2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
!
interface Loopback0
ip address 12.12.12.12 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip address 10.10.10.5 255.255.255.252
mpls label protocol ldp
mpls ip
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
router eigrp 30
network 10.0.0.0
network 12.0.0.0
no auto-summary
!
hostname CE_B1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
!
interface Loopback0
ip address 20.20.20.20 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip address 10.10.10.1 255.255.255.252
mpls label protocol ldp
mpls ip
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
router eigrp 10
auto-summary
!
router eigrp 20
network 10.0.0.0
network 20.0.0.0
no auto-summary
hostname CE_B2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
!
interface Loopback0
ip address 30.30.30.30 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip address 10.10.10.5 255.255.255.252
mpls label protocol ldp
mpls ip
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
clock rate 2000000
!
router eigrp 40
network 10.0.0.0
network 30.0.0.0
no auto-summary
hostname P
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
ip address 192.168.1.2 255.255.255.0
mpls label protocol ldp
mpls ip
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
ip address 192.168.2.1 255.255.255.0
mpls label protocol ldp
mpls ip
clock rate 2000000
!
router rip
version 2
network 192.168.1.0
network 192.168.2.0
no auto-summary