OSPF On A DHCP Client Interface

From Baranoski.ca
Jump to: navigation, search

Here are two scenarios:

  • You want to have all your spare CPE routers configured with a standard config, so a field tech can just pick one up and plug it in without configuring it.
  • You are running two or more local loops to a CPE router, and you don't want the installer to have to figure out which local loop goes into which port on the router.

What to do? Set the CPE router up as a DHCP client with OSPF running on all interfaces! This way, when it gets plugged in to one or more local loops, it will get its IP from the network and will automatically bring up an OSPF adjacency on each link.


Upstream Router

On the upstream router, you will need to configure one or more subintercaces, and a DHCP pool for each interface. Then you can either add a corresponding OSPF network statement for each, or just put in a generic one to cover them all.

ip dhcp pool CUSTOMER_A-LINK_1
 network 172.16.2.0 255.255.255.248
ip dhcp pool CUSTOMER_A-LINK_2
 network 172.16.2.8 255.255.255.248
interface GigabitEthernet0/1.100
 ip address 172.16.2.1 255.255.255.248
interface GigabitEthernet0/1.101
 ip address 172.16.2.9 255.255.255.248
router ospf 1
 network 172.16.2.0 0.0.0.255 area 0


CPE Router

On the CPE router, you just need to be sure that the WAN ports are set for DHCP, and a network statement covers them.

interface FastEthernet0
 ip address dhcp
interface FastEthernet1
 ip address dhcp
router ospf 1
 network 0.0.0.0 255.255.255.255 area 0