Hello everyone!
I'm working in a lab with three CHRs v7.19.6 on eve-ng. My current configuration is OSPF+MPLS+BGP+VRF. I followed the instructions on the wiki and it's working.
I'm very happy because I've never mixed so many protocols together before. My problem is that I want to have a DHCP server on R1 and pass a DHCP relay from that R1 DHCP server to R3.
R1 has a DHCP server on ether5 and it's in vrf2. The idea is to pass it to R3 via vrf2 and with DHCP relay. I saw an example on the wiki, but it's not clear to me since they don't use OSPF+MPLS+BGP.
Diagram:
R2
/ \
DHCP SERVER ->R1----R3-> DHCP RELAY
What would be the correct step to implement it with OSPF+MPLS+BGP? I know the steps are different for other brands like Cisco/OCNOS.
R1:
/ip address
add address=172.16.100.1/30 interface=ether2 network=172.16.100.0
add address=172.16.100.14/30 interface=ether3 network=172.16.100.12
add address=10.10.1.1 interface=lo network=10.10.1.1
add address=192.168.100.1/24 interface=ether10 network=192.168.100.0
add address=192.168.102.1/24 interface=ether5 network=192.168.102.0
# DHCP Server
/ip pool
add name=dhcp_pool0 ranges=192.168.100.100-192.168.100.200
add name=pool102 ranges=192.168.102.100-192.168.102.200
/ip dhcp-server
add address-pool=dhcp_pool0 interface=ether10 name=dhcp1
add address-pool=pool102 interface=ether5 name=server1 relay=192.168.102.1
/ip dhcp-server network
add address=192.168.100.0/24 dns-server=8.8.8.8,1.1.1.1 gateway=192.168.100.1
# OSPF
/routing ospf instance
add disabled=no name=backbone
/routing ospf area
add disabled=no instance=backbone name=backbone-area
/routing ospf interface-template
add area=backbone-area disabled=no interfaces=ether2,ether3,lo
# MPLS
/mpls ldp
add disabled=no lsr-id=10.10.1.1 transport-addresses=10.10.1.1
/mpls ldp interface
add disabled=no interface=ether2
add disabled=no interface=ether3
# BGP
/routing bgp template
set default afi=ip,vpnv4 as=65000 disabled=no routing-table=main
/routing bgp connection
add afi=ip,vpnv4 as=65000 connect=yes disabled=no listen=yes local.address=\
10.10.1.1 .role=ibgp name=to-R2 remote.address=10.10.2.1/32 .as=65000 \
routing-table=main templates=default
add afi=ip,vpnv4 as=65000 connect=yes disabled=no listen=yes local.address=\
10.10.1.1 .role=ibgp name=to-R3 remote.address=10.10.3.1/32 .as=65000 \
routing-table=main templates=default
add afi=ip,vpnv4 as=65000 connect=yes disabled=no listen=yes local.address=\
10.10.1.1 .role=ibgp name=to-R4 remote.address=10.10.4.1/32 .as=65000 \
routing-table=main templates=default
# VRF
/ip vrf
add interfaces=ether5 name=vrf2
add interfaces=ether10 name=vrf1
/routing bgp vpn
add disabled=no export.redistribute=connected,static .route-targets=111:1 \
import.route-targets=111:1 label-allocation-policy=per-vrf name=\
bgp-mpls-vpn-1 route-distinguisher=111:1 vrf=vrf1
add disabled=no export.redistribute=connected,static,dhcp .route-targets=111:2 \
import.route-targets=111:2 label-allocation-policy=per-vrf name=\
bgp-mpls-vpn-2 route-distinguisher=111:2 vrf=vrf2
# OTHERS
/ip dhcp-client
add interface=ether1
/system identity
set name=R1
/tool romon
set enabled=yes
R2:
/ip address
add address=172.16.100.2/30 interface=ether1 network=172.16.100.0
add address=172.16.100.5/30 interface=ether2 network=172.16.100.4
add address=10.10.2.1 interface=lo network=10.10.2.1
# DHCP Server
# OSPF
/routing ospf instance
add disabled=no name=backbone
/routing ospf area
add disabled=no instance=backbone name=backbone-area
/routing ospf interface-template
add area=backbone-area disabled=no interfaces=ether1,ether2,lo
# MPLS
/mpls ldp
add disabled=no lsr-id=10.10.2.1 transport-addresses=10.10.2.1
/mpls ldp interface
add disabled=no interface=ether1
add disabled=no interface=ether2
# BGP
/routing bgp template
set default afi=ip,vpnv4 as=65000 disabled=no routing-table=main
/routing bgp connection
add afi=ip,vpnv4 as=65000 connect=yes disabled=no listen=yes local.address=\
10.10.2.1 .role=ibgp name=to-R1 remote.address=10.10.1.1/32 .as=65000 \
routing-table=main templates=default
# VRF
# OTHERS
/system identity
set name=R2
/tool romon
set enabled=yes
R3:
/ip address
add address=172.16.100.13/30 interface=ether2 network=172.16.100.12
add address=172.16.100.6/30 interface=ether1 network=172.16.100.4
add address=10.10.3.1 interface=lo network=10.10.3.1
add address=192.168.101.1/24 interface=ether10 network=192.168.101.0
# DHCP Server
/ip pool
add name=dhcp_pool0 ranges=192.168.101.100-192.168.101.200
/ip dhcp-server
add address-pool=dhcp_pool0 interface=ether10 name=dhcp1
/ip dhcp-server network
add address=192.168.101.0/24 dns-server=8.8.8.8,1.1.1.1 gateway=192.168.101.1
/ip dhcp-server
add address-pool=pool102 interface=ether5 name=server1 relay=192.168.102.1
# OSPF
/routing ospf instance
add disabled=no name=backbone
/routing ospf area
add disabled=no instance=backbone name=backbone-area
/routing ospf interface-template
add area=backbone-area disabled=no interfaces=ether1,ether2,lo
# MPLS
/mpls ldp
add disabled=no lsr-id=10.10.3.1 transport-addresses=10.10.3.1
/mpls ldp interface
add disabled=no interface=ether1
add disabled=no interface=ether2
# BGP
/routing bgp template
set default afi=ip,vpnv4 as=65000 disabled=no routing-table=main
/routing bgp connection
add afi=ip,vpnv4 as=65000 connect=yes disabled=no listen=yes local.address=10.10.3.1 .role=ibgp name=to-R1 remote.address=10.10.1.1/32 .as=65000 routing-table=main templates=\
default
# VRF
/ip vrf
add interfaces=ether5 name=vrf2
add interfaces=ether10 name=vrf1
/routing bgp vpn
add disabled=no export.redistribute=connected,static .route-targets=111:1 import.route-targets=111:1 label-allocation-policy=per-vrf name=bgp-mpls-vpn-1 route-distinguisher=\
111:1 vrf=vrf1
/routing bgp vpn
add disabled=no export.redistribute=connected,static,dhcp .route-targets=111:2 import.route-targets=111:2 label-allocation-policy=per-vrf name=bgp-mpls-vpn-2 route-distinguisher=111:2 \
vrf=vrf2
# OTHERS
/system identity
set name=R3
/tool romon
set enabled=yes