Author Topic: Using switch's dhcp feature, good idea?  (Read 576 times)

ggnfs000 (OP)

  • Core Switch
  • **
  • Posts: 176
  • Country: us
  • Rep: 1
    • View Profile
Using switch's dhcp feature, good idea?
« on: April 09, 2017, 09:54:43 PM »
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

  • Senior Engineer
  • ****
  • Posts: 2371
  • Rep: 25
    • View Profile
  • Certifications: Alphabets
Re: Using switch's dhcp feature, good idea?
« Reply #1 on: April 09, 2017, 11:19:58 PM »
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 (OP)

  • Core Switch
  • **
  • Posts: 176
  • Country: us
  • Rep: 1
    • View Profile
Re: Using switch's dhcp feature, good idea?
« Reply #2 on: April 10, 2017, 12:07:20 AM »
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

  • Senior Engineer
  • ****
  • Posts: 2371
  • Rep: 25
    • View Profile
  • Certifications: Alphabets
Re: Using switch's dhcp feature, good idea?
« Reply #3 on: April 10, 2017, 01:09:11 AM »
did you put an IP address in VLAN2 SVI in the same subnet as your pool?!?!?

ggnfs000 (OP)

  • Core Switch
  • **
  • Posts: 176
  • Country: us
  • Rep: 1
    • View Profile
Re: Using switch's dhcp feature, good idea?
« Reply #4 on: April 10, 2017, 05:33:05 AM »
well, setting ip address /supposedly static/ for SVI would defeat the purpose of using DHCP isn't it?

wintermute000

  • Senior Engineer
  • ****
  • Posts: 2371
  • Rep: 25
    • View Profile
  • Certifications: Alphabets
Re: Using switch's dhcp feature, good idea?
« Reply #5 on: April 10, 2017, 07:23:46 AM »
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

  • Permit any any all log
  • Administrator
  • Volume Licensing
  • *****
  • Posts: 7404
  • Country: us
  • Rep: 19
  • *I* am the one who NACs.
    • View Profile
  • Certifications: FSCA: ForeScout Certified Administrator, CCNP Security, Tufin CSE, TippingPoint ASE
Re: Using switch's dhcp feature, good idea?
« Reply #6 on: April 10, 2017, 08:16:36 AM »
... 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!

EOS

  • Access Port
  • *
  • Posts: 71
  • Country: us
  • Rep: 0
    • View Profile
  • Certifications: Yes
Re: Using switch's dhcp feature, good idea?
« Reply #7 on: April 10, 2017, 10:03:13 AM »
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 (OP)

  • Core Switch
  • **
  • Posts: 176
  • Country: us
  • Rep: 1
    • View Profile
Re: Using switch's dhcp feature, good idea?
« Reply #8 on: April 10, 2017, 10:09:01 AM »
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!