Configure CE Neighbor for the VPN (Using BGP/ OSPF)

To provide a VPN service, the PE-router must be configured so that any routing information learned from a VPN customer interface can be associated with a particular VRF. This is achieved using any standard routing protocol process (OSPF, BGP or static routes etc). Use any one of the following configurations (BGP, or OSPF) to configure the CE neighbor.

Using BGP

The BGP sessions between PE and CE routers can carry different types of routes (VPN-IPv4, IPv4 routes). Address families are used to control the type of BGP session. Configure a BGP address family for each VRF on the PE-router, and a separate address family to carry VPN-IPv4 routes between PE routers. All non-VPN BGP neighbors are defined using the IPv4 address mode. Each VPN BGP neighbor is defined under its associated address family mode.

A separate address family entry is used for every VRF, and each address family entry can have multiple CE routers within the VRF.

The PE and CE routers must be directly connected for BGP4 sessions; BGP multihop is not supported between PE and CE routers.

The following example places the router in address family mode, and specifies company names, ComA and ComB, as the names of the VRF instance to associate with subsequent IPv4 address family configuration mode commands. This configuration is used when BGP is used for PE and CE.

PE1

configure terminal

Enter configure mode

(config)#router bgp 100

Enter BGP router mode

(config-router)#address-family ipv4 unicast

Enter address family mode

(config-router-af)#redistribute connected

Redistribute connected addresses

(config-router-af)#exit-address-family

Exit address family mode

(config-router)#address-family ipv4 vrf ComA

Enter the IPv4 address family for VRF comA

(config-router)#neighbor 192.16.2.3 remote-as 65001

Specify the neighbor

(config-router-af)#neighbor 192.16.2.3 activate

Activate the neighbor

(config-router-af)#exit-address-family

Exit address family mode

(config-router)#address-family ipv4 vrf ComB

Enter the IPv4 address family for VRF comA

(config-router)#neighbor 168.12.0.2 remote-as 65003

Specify the neighbor

(config-router-af)#neighbor 192.12.0.2 activate

Activate the neighbor

(config-router-af)#exit-address-family

Exit address family mode

(config-router)#commit

Commit the transaction

PE2

configure terminal

Enter configure mode

(config)#router bgp 100

Enter BGP router mode

(config-router)#address-family ipv4 unicast

Enter address family mode

(config-router-af)#redistribute connected

Redistribute connected addresses

(config-router-af)#exit-address-family

Exit address family mode

(config-router)#address-family ipv4 vrf ComA

Enter the IPv4 address family for VRF comA

(config-router)#neighbor 192.16.4.3 remote-as 65004

Specify the neighbor

(config-router-af)#neighbor 192.16.4.3 activate

Activate the neighbor

(config-router-af)#exit-address-family

Exit address family mode

(config-router)#address-family ipv4 vrf ComB

Enter the IPv4 address family for VRF comA

(config-router)#neighbor 168.12.4.1 remote-as 65005

Specify the neighbor

(config-router-af)#neighbor 192.12.4.1 activate

Activate the neighbor

(config-router-af)#exit-address-family

Exit address family mode

(config-router)#commit

Commit the transaction

CE1: BGP

configure terminal

Enter configure mode

(config)#interface xe48

Enter interface mode for xe48

(config-if)#ip address 168.12.0.2/24

Assign IP address

(config-if)#exit

Exit interface mode

(config)#router bgp 65003

Enter BGP router mode

(config-router)#neighbor 168.12.0.3 remote-as 100

Specify the neighbor

(config-router)#address-family ipv4 unicast

Enter address family mode

(config-router-af)#neighbor 168.12.0.3 activate

Activate the neighbor

(config-router-af)#redistribute connected

Redistribute connected addresses

(config-router-af)#commit

Commit the transaction

CE2: BGP

configure terminal

Enter configure mode

(config)#interface xe23

Enter interface mode for xe48

(config-if)#ip address 192.12.4.1/24

Assign IP address

(config-if)#exit

Exit interface mode

(config)#router bgp 65005

Enter BGP router mode

(config-router)#neighbor 192.12.4.2 remote-as 100

Specify the neightbor

(config-router)#address-family ipv4 unicast

Enter address family mode

(config-router-af)#neighbor 192.12.4.2 activate

Activate the neighbor

(config-router-af)#redistribute connected

Redistribute connected addresses

(config-router-af)#commit

Commit the transaction