OcNOS SP : Multi-Protocol Label Switching Guide : Layer 3 Virtual Private network Configuration : DHCP Relay Agent Over L3VPN Configuration
DHCP Relay Agent Over L3VPN Configuration
The DHCP Relay feature was designed to forward DHCP broadcast requests as unicast packets to a configured DHCP server or servers for redundancy. In the L3VPN case, there is a special tunnel which gets created through which all the communication happens. In OcNOS, the interface created is named as tunmpls. This tunnel name is not exposed to the OcNOS control plane.This interface is directly created in the kernel.
DHCP Relay Over L3 VPN for IPv4
Before configuring DHCP Relay, make sure DHCP server and client configurations are done.
DHCP Relay Over L3 VPN Configuration
DHCP Client
 
#configure terminal
Enter configure mode.
(config)#interface xe2
Enter interface mode.
(config-if)#ip address dhcp
Enable DHCP on interface
(config-if)#commit
Commit the candidate configuration to the running configuration
PE1 (DHCP Relay Agent)
 
#configure terminal
Enter configure mode.
(config)#ip dhcp relay
By default this will be enabled. It starts the ip dhcp relay service.
(config)#ip vrf vrf1
Configuring non default vrf vrf1
(config-vrf)#rd 10:10
Assign a route distinguisher to VRF
(config-vrf)#route-target both 10:10
Configure a route target for vrf1.
(config-vrf)#ip dhcp relay address 11.11.0.1
Configure DHCP server address.
(config-vrf)#ip dhcp relay uplink l3vpn
configure IPv4 DHCP Relay over L3VPN.
(config)#interface xe4
Enter interface mode.
(config-if)#ip vrf forwarding vrf1
Configure vrf forwarding for vrf1
(config-if)#ip address 50.50.50.1/24
Add IP address.
(config-if)#ip dhcp relay
Configure DHCP relay for the interface connecting to client.
(config-if)#commit
Commit the candidate configuration to the running configuration
(config-if)#exit
Exit from interface mode
(config)#interface lo
Enter interface mode
(config-if)#ip address 1.1.1.1/32 secondary
Set an IP address on the interface
(config-if)#commit
Commit the candidate configuration to the running configuration
(config-if)#exit
Exit from interface mode
(config)#router ldp
Enter the Router LDP mode.
(config-router)#router-id 1.1.1.1
Configure an LDP router ID.
(config-router)#exit
Exit from Router LDP mode
(config)#interface xe1
Enter interface mode
(config-if)#ip address 10.1.1.1/24
Add IP address.
(config-if)#label-switching
Enable label switching on the interface
(config-if)#enable-ldp ipv4
Enable IPv4 LDP configuration on the interface.
(config-if)#commit
Commit the candidate configuration to the running configuration
(config-if)#exit
Exit from interface mode
(config)#router ospf 100
Enter the Router OSPF mode.
(config-router)#network 1.1.1.1/32 area 0.0.0.0
Advertise loopback address in OSPF.
(config-router)#network 10.1.1.0/24 area 0.0.0.0
Advertise network address in OSPF.
(config-router)#exit
Exit Router OSPF mode and return to Configure mode.
(config)# router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)# bgp router-id 1.1.1.1
Configure a fixed Router ID (1.1.1.1)
(config-router)# neighbor 3.3.3.3 remote-as 100
Configuring PE2 as iBGP neighbor using it's loopback IP
(config-router)# neighbor 3.3.3.3 update-source lo
Source of routing updates as loopback
(config-router)# address-family ipv4 unicast
Entering into IPV4 unicast address family
(config-router-af)# neighbor 3.3.3.3 activate
Activate the neighbor in the IPV4 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)# address-family vpnv4 unicast
Entering into address family mode as vpnv4
(config-router-af)# neighbor 3.3.3.3 activate
Activate the neighbor in the vpnv4 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)# address-family ipv4 vrf vrf1
Entering into address family mode as ipv4 vrf vrf1
(config-router-af)# redistribute connected
Redistribute connected routes.
(config-router-af)#exit
Exiting of Address family mode
(config-router)# commit
Commit the candidate configuration to the running configuration
P
 
#configure terminal
Enter configure mode.
(config)#interface lo
Enter interface mode
(config-if)#ip address 2.2.2.2/32 secondary
Set an IP address on the interface
(config-if)#exit
Exit from interface mode
(config)#router ldp
Enter the Router LDP mode.
(config-router)#router-id 2.2.2.2
Configure an LDP router ID.
(config-router)#exit
Exit from Router LDP mode
(config)#interface xe14
Enter interface mode
(config-if)# ip address 20.1.1.1/24
Add IP address.
(config-if)# label-switching
Enable label switching on the interface
(config-if)# enable-ldp ipv4
Enable IPv4 LDP configuration on the interface.
(config-if)#exit
Exit from interface mode
(config)#interface xe1
Enter interface mode
(config-if)# ip address 10.1.1.2/24
Add IP address.
(config-if)# label-switching
Enable label switching on the interface
(config-if)# enable-ldp ipv4
Enable IPv4 LDP configuration on the interface.
(config-if)#exit
Exit from interface mode
(config)#router ospf 100
Enter the Router OSPF mode.
(config-router)#network 3.3.3.3/32 area 0.0.0.0
Advertise loopback address in OSPF.
(config-router)#network 20.1.1.0/24 area 0.0.0.0
Advertise network address in OSPF.
(config-router)#network 10.1.1.0/24 area 0.0.0.0
Advertise network address in OSPF.
(config-router)#exit
Exit Router OSPF mode and return to Configure mode.
(config)# commit
Commit the candidate configuration to the running configuration
PE2
 
#configure terminal
Enter configure mode.
(config)#ip vrf vrf1
Configuring non default vrf vrf1
(config-vrf)# rd 10:10
Assign a route distinguisher to VRF
(config-vrf)# route-target both 10:10
Configure a route target for vrf1.
(config)#interface xe48
Enter interface mode.
(config-if)#ip vrf forwarding vrf1
Configure vrf forwarding for vrf1
(config-if)# commit
Commit the candidate config
(config-if)#ip address 11.11.0.2/24
Add IP address.
(config-if)#exit
Exit from interface mode
(config)#interface lo
Enter interface mode
(config-if)#ip address 3.3.3.3/32 secondary
Set an IP address on the interface
(config-if)#exit
Exit from interface mode
(config)#router ldp
Enter the Router LDP mode.
(config-router)#router-id 3.3.3.3
Configure an LDP router ID.
(config-router)#exit
Exit from Router LDP mode
(config)#interface xe14
Enter interface mode
(config-if)# ip address 20.1.1.2/24
Add IP address.
(config-if)# label-switching
Enable label switching on the interface
(config-if)# enable-ldp ipv4
Enable IPv4 LDP configuration on the interface.
(config-if)#exit
Exit from interface mode
(config)#router ospf 100
Enter the Router OSPF mode.
(config-router)#network 3.3.3.3/32 area 0.0.0.0
Advertise loopback address in OSPF.
(config-router)#network 20.1.1.0/24 area 0.0.0.0
Advertise network address in OSPF.
(config-router)#exit
Exit Router OSPF mode and return to Configure mode.
(config)# router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)# bgp router-id 3.3.3.3
Configure a fixed Router ID (3.3.3.3)
(config-router)# neighbor 1.1.1.1 remote-as 100
Configuring PE1 as iBGP neighbor using it's loopback IP
(config-router)# neighbor 1.1.1.1 update-source lo
Source of routing updates as loopback
(config-router)# address-family ipv4 unicast
Entering into IPV4 unicast address family
(config-router-af)# neighbor 1.1.1.1 activate
Activate the neighbor in the IPV4 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)# address-family vpnv4 unicast
Entering into address family mode as vpnv4
(config-router-af)# neighbor 1.1.1.1 activate
Activate the neighbor in the vpnv4 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)# address-family ipv4 vrf vrf1
Entering into address family mode as ipv4 vrf vrf1
(config-router-af)# redistribute connected
Redistribute connected routes.
(config-router-af)#exit
Exiting of Address family mode
(config-router)# commit
Commit the candidate configuration to the running configuration
Validation
PE1 (DHCP Relay Agent)
PE1#show running-config dhcp
ip vrf vrf1
ip dhcp relay address 11.11.0.1
ip dhcp relay uplink l3vpn
interface xe4
ip dhcp relay
 
PE1#show ip dhcp relay
DHCP relay service is Enabled.
VRF Name: vrf1
Option 82: Disabled
DHCP Servers configured: 11.11.0.1
 
Interface Uplink/Downlink
--------- -------------
xe4 Downlink
l3vpn uplink
Incoming DHCPv4 packets which already contain relay agent option are FORWARDED and changed.
PE1#show ip dhcp relay address
VRF Name: vrf1
DHCP Servers configured: 11.11.0.1
 
Incoming DHCPv4 packets which already contain relay agent option are FORWARDED and changed.
DHCP Client
#show ip interface brief | include xe2
xe5 *50.50.50.2 up up
DHCP Relay Over L3 VPN for IPv6
Before configuring DHCP Relay, make sure DHCP server and client configurations are done.
DHCP Relay Over L3 VPN Configuration
DHCP Client
 
#configure terminal
Enter configure mode.
(config)#interface xe2
Enter interface mode.
(config-if)#ipv6 address dhcp
Enable DHCP on interface
(config-if)#commit
Commit the candidate configuration to the running configuration
PE1 (DHCP Relay Agent)
 
#configure terminal
Enter configure mode.
(config)#ipv6 dhcp relay
By default this will be enabled. It starts the ipv6 dhcp relay service.
(config)#ip vrf vrf1
Configuring non default vrf vrf1
(config-vrf)#rd 10:10
Assign a route distinguisher to VRF
(config-vrf)#route-target both 10:10
Configure a route target for vrf1.
(config-vrf)#ipv6 dhcp relay address 2002::1
Configure DHCP server address.
(config-vrf)#ipv6 dhcp relay uplink l3vpn
configure IPv6 DHCP Relay over L3VPN.
(config)#interface xe4
Enter interface mode.
(config-if)#ip vrf forwarding vrf1
Configure vrf forwarding for vrf1
(config-if)# ipv6 address 2001::1/64
Add IPv6 address.
(config-if)#ipv6 dhcp relay
Configure DHCP relay for the interface connecting to client.
(config-if)#exit
Exit from interface mode
(config)#interface lo
Enter interface mode
(config-if)#ip address 1.1.1.1/32 secondary
Set an IP address on the interface
(config-if)#exit
Exit from interface mode
(config)#router ldp
Enter the Router LDP mode.
(config-router)#router-id 1.1.1.1
Configure an LDP router ID.
(config-router)#exit
Exit from Router LDP mode
(config)#interface xe1
Enter interface mode
(config-if)# ip address 10.1.1.1/24
Add IP address.
(config-if)# label-switching
Enable label switching on the interface
(config-if)# enable-ldp ipv4
Enable IPv4 LDP configuration on the interface.
(config-if)#exit
Exit from interface mode
(config)#router ospf 100
Enter the Router OSPF mode.
(config-router)#network 1.1.1.1/32 area 0.0.0.0
Advertise loopback address in OSPF.
(config-router)#network 10.1.1.0/24 area 0.0.0.0
Advertise network address in OSPF.
(config-router)#exit
Exit Router OSPF mode and return to Configure mode.
(config)#router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)#bgp router-id 1.1.1.1
Configure a fixed Router ID (1.1.1.1)
(config-router)#neighbor 3.3.3.3 remote-as 100
Configuring PE2 as iBGP neighbor using it's loopback IP
(config-router)#neighbor 3.3.3.3 update-source lo
Source of routing updates as loopback
(config-router)#address-family ipv4 unicast
Entering into IPV4 unicast address family
(config-router-af)#neighbor 3.3.3.3 activate
Activate the neighbor in the IPV4 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)#address-family vpnv4 unicast
Entering into address family mode as vpnv4
(config-router-af)#neighbor 3.3.3.3 activate
Activate the neighbor in the vpnv4 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)#address-family vpnv6 unicast
Entering into address family mode as vpnv6
(config-router-af)#neighbor 3.3.3.3 activate
Activate the neighbor in the vpnv6 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)# address-family ipv4 vrf vrf1
Entering into address family mode as ipv4 vrf vrf1
(config-router-af)#redistribute connected
Redistribute connected routes.
(config-router-af)#exit
Exiting of Address family mode
(config-router)# address-family ipv6 vrf vrf1
Entering into address family mode as ipv6 vrf vrf1
(config-router-af)#redistribute connected
Redistribute connected routes.
(config-router-af)#exit
Exiting of Address family mode
(config-router)#commit
Commit the candidate configuration to the running configuration
P
 
#configure terminal
Enter configure mode.
(config)#interface lo
Enter interface mode
(config-if)#ip address 2.2.2.2/32 secondary
Set an IP address on the interface
(config-if)#exit
Exit from interface mode
(config)#router ldp
Enter the Router LDP mode.
(config-router)#router-id 2.2.2.2
Configure an LDP router ID.
(config-router)#exit
Exit from Router LDP mode
(config)#interface xe14
Enter interface mode
(config-if)#ip address 20.1.1.1/24
Add IP address.
(config-if)#label-switching
Enable label switching on the interface
(config-if)#enable-ldp ipv4
Enable IPv4 LDP configuration on the interface.
(config-if)#exit
Exit from interface mode
(config)#interface xe1
Enter interface mode
(config-if)#ip address 10.1.1.2/24
Add IP address.
(config-if)#label-switching
Enable label switching on the interface
(config-if)#enable-ldp ipv4
Enable IPv4 LDP configuration on the interface.
(config-if)#exit
Exit from interface mode
(config)#router ospf 100
Enter the Router OSPF mode.
(config-router)#network 3.3.3.3/32 area 0.0.0.0
Advertise loopback address in OSPF.
(config-router)#network 20.1.1.0/24 area 0.0.0.0
Advertise network address in OSPF.
(config-router)#network 10.1.1.0/24 area 0.0.0.0
Advertise network address in OSPF.
(config-router)#exit
Exit Router OSPF mode and return to Configure mode.
(config)# commit
Commit the candidate configuration to the running configuration
PE2
 
#configure terminal
Enter configure mode.
(config)#ip vrf vrf1
Configuring non default vrf vrf1
(config-vrf)#rd 10:10
Assign a route distinguisher to VRF
(config-vrf)#route-target both 10:10
Configure a route target for vrf1.
(config)#interface xe48
Enter interface mode.
(config-if)#ip vrf forwarding vrf1
Configure vrf forwarding for vrf1
(config-if)#commit
Commit the candidate config
(config-if)#ipv6 address 2002::2/64
Add IPv6 address.
(config-if)#exit
Exit from interface mode
(config)#interface lo
Enter interface mode
(config-if)#ip address 3.3.3.3/32 secondary
Set an IP address on the interface
(config-if)#exit
Exit from interface mode
(config)#router ldp
Enter the Router LDP mode.
(config-router)#router-id 3.3.3.3
Configure an LDP router ID.
(config-router)#exit
Exit from Router LDP mode
(config)#interface xe14
Enter interface mode
(config-if)#ip address 20.1.1.2/24
Add IP address.
(config-if)#label-switching
Enable label switching on the interface
(config-if)#enable-ldp ipv4
Enable IPv4 LDP configuration on the interface.
(config-if)#exit
Exit from interface mode
(config)#router ospf 100
Enter the Router OSPF mode.
(config-router)#network 3.3.3.3/32 area 0.0.0.0
Advertise loopback address in OSPF.
(config-router)#network 20.1.1.0/24 area 0.0.0.0
Advertise network address in OSPF.
(config-router)#exit
Exit Router OSPF mode and return to Configure mode.
(config)#router bgp 100
Enter the Router BGP mode, ASN: 100
(config-router)#bgp router-id 3.3.3.3
Configure a fixed Router ID (3.3.3.3)
(config-router)#neighbor 1.1.1.1 remote-as 100
Configuring PE1 as iBGP neighbor using it's loopback IP
(config-router)#neighbor 1.1.1.1 update-source lo
Source of routing updates as loopback
(config-router)#address-family ipv4 unicast
Entering into IPV4 unicast address family
(config-router-af)#neighbor 1.1.1.1 activate
Activate the neighbor in the IPV4 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)#address-family vpnv4 unicast
Entering into address family mode as vpnv4
(config-router-af)#neighbor 1.1.1.1 activate
Activate the neighbor in the vpnv4 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)#address-family vpnv6 unicast
Entering into address family mode as vpnv6
(config-router-af)#neighbor 1.1.1.1 activate
Activate the neighbor in the vpnv6 address family
(config-router-af)#exit
Exiting of Address family mode
(config-router)#address-family ipv4 vrf vrf1
Entering into address family mode as ipv4 vrf vrf1
(config-router-af)#redistribute connected
Redistribute connected routes.
(config-router-af)#exit
Exiting of Address family mode
(config-router)#address-family ipv6 vrf vrf1
Entering into address family mode as ipv6 vrf vrf1
(config-router-af)#redistribute connected
Redistribute connected routes.
(config-router-af)#exit
Exiting of Address family mode
(config-router)#commit
Commit the candidate configuration to the running configuration
Validation
PE1 (DHCP Relay Agent)
PE1#show running-config dhcp
ip vrf vrf1
ipv6 dhcp relay address 2002::1
ipv6 dhcp relay uplink l3vpn
interface xe4
ipv6 dhcp relay
 
PE1#show ipv6 dhcp relay
IPv6 DHCP relay service is Enabled.
VRF Name: vrf1
Option 82: Enabled
DHCPv6 Servers configured: 2002::1
DHCPv6 IA_PD Route injection: Disabled
Interface Uplink/Downlink
--------- -------------
xe4 Downlink
l3vpn uplink
PE1#show ip dhcp relay address
VRF Name: vrf1
DHCPv6 Servers configured: 2002::1
DHCP Client
#show ipv6 interface brief | include xe2
xe5 *2001::200 up up