全局路由表应用( 二 )


router ospf 1
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
IGW
version 12.2
!
hostname IGW
!
ip subnet-zero
!
ip cef
!--- This enabled CEF switching.
!
interface Loopback0
ip address 10.1.1.6 255.255.255.255
!
interface Ethernet2/0
!--- This is connected to P router.
ip address 10.10.36.6 255.255.255.0
tag-switching ip
!
interface Serial8/0
!--- This is connected to Internet R7.
ip address 192.168.67.1 255.255.255.252
!
router ospf 1
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
network 11.11.11.0 mask 255.255.255.0
network 22.22.22.0 mask 255.255.255.0
neighbor 192.168.67.2 remote-as 200
no auto-summary
PE 2
version 12.2
!
hostname PE-2
!
ip subnet-zero
!
ip vrf customer1
!--- Customer1 VRF is configured.
rd 100:1
!--- Route Distinguisher for VRF is configured.
route-target export 1:1
route-target import 1:1
!--- This configured the import and export policies for customer1
!--- VRF.
!
ip cef
!--- This enabled CEF switching.
!
interface Loopback0
ip address 10.1.1.4 255.255.255.255
interface Ethernet1/0
!--- Connected to P router.
ip address 10.10.34.4 255.255.255.0
tag-switching ip
!--- MPLS switching is enabled.
!
interface Serial9/0
!--- Connected to CE 2 router.
ip vrf forwarding customer1
!--- This enables VRF forwarding on the interface.
ip address 192.168.20.1 255.255.255.252
!
router ospf 1
log-adjacency-changes
redistribute static subnets
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 10.1.1.2 remote-as 100
neighbor 10.1.1.2 update-source Loopback0
neighbor 10.1.1.2 next-hop-self
no auto-summary
!
address-family ipv4 vrf customer1
!--- This is the address-family IPv4 configuration of customer1 VRF.
no auto-summary
no synchronization
network 22.22.22.0 mask 255.255.255.0
!--- This announces the CE 2 network to PE 1.
exit-address-family
!
address-family vpnv4
!--- This is the address-family VPNV4 configuration for BGP Sessions
!--- with PE 1.
neighbor 10.1.1.2 activate
neighbor 10.1.1.2 send-community extended
no auto-summary
exit-address-family
!
ip classless
ip route 22.22.22.0 255.255.255.0 Serial9/0 192.168.20.2
!--- This is the static route for network 22.22.22.0/24 in the global
!--- routing table pointing to the interface connected to CE 2.
ip route vrf customer1 0.0.0.0 0.0.0.0 192.168.67.1 global
!--- This is the static default route for customer VRF
!--- for destinations outside the VPN.
ip route vrf customer1 22.22.22.0 255.255.255.0 192.168.20.2
!--- This is the static route within customer1 VRF for CE 2
!--- network for VPN connectivity.
CE 2
version 12.2
!
hostname CE-2
!
ip subnet-zero
!
interface Loopback0
ip address 22.22.22.22 255.255.255.0
!
interface Serial9/0
!--- This is connected to PE 2.
ip address 192.168.20.2 255.255.255.252
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.20.1
!--- This is the default route pointing to PE 2.

推荐阅读