6509--VRF ip vrf red rd 65000:1 route-target export 65000:1 route-target import 65000:1
G3/1的配置 interface GigabitEthernet3/1 ip address 172.16.4.1 255.255.255.0 mpls label protocol ldp tag-switching ip
MPLS和BGP以及OSPF interface Vlan1 ip vrf forwarding red ip address 10.229.8.1 255.255.255.0 ! interface Vlan10 ip vrf forwarding red ip address 10.229.1.1 255.255.255.0 ! router ospf 1 log-adjacency-changes network 172.16.4.0 0.0.0.255 area 0 network 192.168.100.0 0.0.0.255 area 0 ! router ospf 25 vrf red log-adjacency-changes redistribute bgp 65000 subnets network 10.229.1.0 0.0.0.255 area 0 network 10.229.8.0 0.0.0.255 area 0 ! router bgp 65000 no synchronization bgp router-id 192.168.100.5 bgp log-neighbor-changes neighbor 192.168.100.4 remote-as 65000 neighbor 192.168.100.4 update-source Loopback0 neighbor 192.168.100.4 next-hop-self no auto-summary ! address-family vpnv4 neighbor 192.168.100.4 activate neighbor 192.168.100.4 send-community both exit-address-family ! address-family ipv4 vrf red redistribute ospf 25 metric 50 match external 1 external 2 no auto-summary no synchronization exit-address-family
JUNIPER VRF的配置 policy-options { policy-statement MY_IMPORT { term 1 { from { protocol bgp; community VPN-RED; } then accept; } term 2 { then reject; } } policy-statement MY_EXPORT { term 1 { then { community add VPN-RED;