Using switch's dhcp feature, good idea?

Started by ggnfs000, April 09, 2017, 09:54:43 PM

Previous topic - Next topic

ggnfs000

I had dhcp setup on router which went smoothly. However back to switch, I create and setup vlan 2 interface and use it as a management. Assigned one of physical port f0/24 to use vlan2. As long as vlan2 interface uses static IP, I can ping it meaning, I can probably use ssh or telnet through f0/24 to access and manage. However, decided to use dhcp for vlan2 management interface however this is when trouble starts.

Using ip pool dhcp <name> created couple of pools. But it seems dhcp pool feature in switch does not seem very complete compared to IOS router.

Once in config mode and create dhcp pool, I can define subnet which is supposedly defines pool of ip address. However, there does not seem to be a good way to define range of excluded address. Once in newly created dhcp scope there is a reserved-address option

Switch(dhcp-config)#?
  address         Configure a reserved address
  default-router  Default routers
  dns-server      Set name server
  exit            Exit from DHCP pool configuration mode
  network         Network number and mask
  no              Negate a command or set its defaults
  option          Raw DHCP options


Choosing address will let me define only single ip address (not range of excluded address) plus it asks to supply value for either of following options, which I did not like.

Switch(dhcp-config)#address 130.0.0.1  ?
  client-id         Client identified by Client-ID option
  hardware-address  Client identified by MAC address


I simply wanted to defined range of excluded address. Seems like it is not possible.

Secondly, I was not sure how to set specific pool just created to assign to specific vlan. I.e. for vlan2 interface which I used for management, I wanted to use this pool but there seems no straightforward way of doing so.

As a result, vlan2 can not get dhcp ip.

Pool vlan2-management-pool :
Utilization mark (high/low)    : 100 / 0
Subnet size (first/next)       : 0 / 0
Total addresses                : 254
Leased addresses               : 0
Excluded addresses             : 0
Pending event                  : none

1 subnet is currently in the pool
Current index        IP address range                    Leased/Excluded/Total
130.0.0.1            130.0.0.1        - 130.0.0.254       0    / 0     / 254


Ccna book does not explicitly tells about this, although there are some topics on setting vlan interface to use dhcp, browsing the net mostly brings some vague info.

Perhaps using dhcp feature on switch is not good idea?

wintermute000

1.) excluded address is a command OUTSIDE of the dhcp scope... check syntax guide.
2.) in my experience you don't need to explicitly tie a scope to a SVI, it works and picks up the correct VLAN automatically.

ggnfs000

well, i designated vlan 2 interface for management, apparently it (dhcp scope which I created) did not inteligently or automatically chose this vlan. 1 subnet is currently in the pool. Thus wondering if there is a way to tell it explicitly which virtual interface / vlan to serve.


Current index        IP address range                    Leased/Excluded/Total
130.0.0.1            130.0.0.1        - 130.0.0.254       0    / 0     / 254


wintermute000

did you put an IP address in VLAN2 SVI in the same subnet as your pool?!?!?

ggnfs000

well, setting ip address /supposedly static/ for SVI would defeat the purpose of using DHCP isn't it?

wintermute000

You can't act as a DHCP server unless you have an IP address...... the DHCP DISCOVER has to arrive somewhere and the DHCP OFFER be sent from somewhere.

deanwebb

... and remember, Cisco does not recommend using its DHCP on any production LAN.
Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.

EOS

In our small non- production offices (8 - 20users) we use our 3750's as the DHCP.

Knock on wood, no issues with it in that small office environment.

ggnfs000

oh yes yes yes, now i realize there has to be a "interface for dhcp server" that responds to DHCP request, so i presume the SVI will fulfill that role and any other DHCP request in the vlan will be served by this pool. Will look back in my setup. Thanks!