User's Manual

498
Switch_config_vrf_vpn1# route-target import 300:1
Switch_config_vrf_vpn1# exit
Switch_config# ip vrf vpn2
Switch_config_vrf_vpn2# rd 300:2
Switch_config_vrf_vpn2# route-target export 300:2
Switch_config_vrf_vpn2# route-target import 300:2
Switch_config_vrf_vpn2# exit
Configure the loopback port and the physical port, and use the address of the loopback port as the router ID
of the BGP protocol.
Switch_config# interface loopback 0
Switch_config_l0# ip address 103.0.0.1 255.255.255.255
Switch_config_l0# exit
S2 connects S13 through the F0/1 port, S22 through the G0/3 port and PE through the G0/2 port.
Switch_config# interface gigaEthernet 0/1
Switch_config_g0/1# switchport pvid 41
Switch_config_g0/1# exit
Switch_config# interface gigaEthernet 0/3
Switch_config_g0/3# switchport pvid 46
Switch_config_g0/3# exit
Switch_config# interface gigaEthernet 0/2
Switch_config_g0/2# switchport mode trunk
Switch_config_g0/2# exit
Set the L3 VLAN port of a switch, bind the VRF to the VLAN port and set the IP address. S2 connects PE
through two logical ports, VLAN31 and VLAN32. The two ports, VLAN41 and VLAN46, connect VPN1 and
VPN2 respectively.
Switch_config# interface VLAN41
Switch_config_v41# ip vrf forwarding vpn1
Switch_config_v41# ip address 41.0.0.1 255.0.0.0
Switch_config_v41# exit
Switch_config# interface VLAN46
Switch_config_v46# ip vrf forwarding vpn2
Switch_config_v46# ip address 46.0.0.1 255.0.0.0
Switch_config_v46# exit
Switch_config# interface VLAN31
Switch_config_v31# ip vrf forwarding vpn1
Switch_config_v31# ip address 31.0.0.2 255.0.0.0
Switch_config_v31# exit
Switch_config# interface VLAN32
Switch_config_v32# ip vrf forwarding vpn2
Switch_config_v32# ip address 32.0.0.2 255.0.0.0
Switch_config_v32# exit
Configure the OSPF route between CE and customer device.
Switch_config# router ospf 1 vrf vpn1
Switch_config_ospf_1# network 41.0.0.0 255.0.0.0 area 0
Switch_config_ospf_1# redistribute bgp 300