User's Manual

495
Switch_config# ip vrf vpn1
Switch_config_vrf_vpn1# rd 100:1
Switch_config_vrf_vpn1# route-target export 100:1
Switch_config_vrf_vpn1# route-target import 100:1
Switch_config_vrf_vpn1# exit
Switch_config# ip vrf vpn2
Switch_config_vrf_vpn2# rd 100:2
Switch_config_vrf_vpn2# route-target export 100:2
Switch_config_vrf_vpn2# route-target import 100: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 101.0.0.1 255.255.255.255
Switch_config_l0# exit
S1 connects S11 through the F0/1 port, S21 through the G0/4 port and PE through the G0/2 port.
Switch_config# interface gigaEthernet 0/1
Switch_config_g0/1# switchport pvid 11
Switch_config_g0/1# exit
Switch_config# interface gigaEthernet 0/4
Switch_config_g0/4# switchport pvid 15
Switch_config_g0/4# 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. S1 connects PE
through two logical ports, VLAN21 and VLAN22. The two ports, VLAN11 and VLAN15, connect VPN1 and
VPN2 respectively.
Switch_config# interface VLAN11
Switch_config_v11# ip vrf forwarding vpn1
Switch_config_v11# ip address 11.0.0.1 255.0.0.0
Switch_config_v11# exit
Switch_config# interface VLAN15
Switch_config_v15# ip vrf forwarding vpn2
Switch_config_v15# ip address 15.0.0.1 255.0.0.0
Switch_config_v15# exit
Switch_config# interface VLAN21
Switch_config_v21# ip vrf forwarding vpn1
Switch_config_v21# ip address 21.0.0.2 255.0.0.0
Switch_config_v21# exit
Switch_config# interface VLAN22
Switch_config_v22# ip vrf forwarding vpn2
Switch_config_v22# ip address 22.0.0.2 255.0.0.0
Switch_config_v22# exit
Configure the OSPF route between CE and customer device.