cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3910
Views
55
Helpful
9
Replies

enable dhcp for cisco switch catalyst 2960-x

pvang1
Level 1
Level 1

I'm configuring a cisco switch and wanted to know how to enable dhcp so that the switch is pickup up the dhcp from the dhcp server. Is there a way to do it in the command line? 

1 Accepted Solution

Accepted Solutions

In that case the config that I suggested with a vlan interface using IP address dhcp should accomplish what you want.
HTH

Rick

View solution in original post

9 Replies 9

balaji.bandi
Hall of Fame
Hall of Fame

Default configure like this (thinking that Gig interface connected to DHCP server)

 

configure terminal
! interface gig 0/0
no switchport ip address dhcp
no shut
!
end

verifification :

show ip interface brief

 

or are you looking for Switch to act as DHCP Server?

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

I don't want it to act as a dhcp server. What I would like is to configure the switch so that it picks up a dhcp ip address so that I can connect to it without having to be right next to the switch.


then that config is still valid.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

In that case the config that I suggested with a vlan interface using IP address dhcp should accomplish what you want.
HTH

Rick

Thank you. I wanted the management interface changed to dhcp and using your method worked perfectly.


You are welcome. I am glad that my suggestions helped you to achieve what you wanted. Thank you for marking this question as solved. This will help other participants in the community to identify discussions which have helpful information. This community is an excellent place to ask questions and to learn about networking. I hope to see you continue to be active in the community.

HTH

Rick

The suggestion by @balaji.bandi is quite appropriate if you want the switch to have a routed interface, that is not associated with any vlan on the switch. Another approach is to configure a vlan on the switch, configure a vlan interface for that vlan, and configure the SVI to use dhcp to acquire an IP address. Depending on the type of switch it might look something like this:

vlan 5

name data

interface G0/0

access vlan 5

interface vlan5

ip address dhcp

This would be particularly appropriate for a switch on which you want an IP address to act as a management interface. And it assumes that vlan 5 has a connection to a device that is acting as DHCP server and has an appropriate set of addresses for this vlan.

HTH

Rick

MichaelMcCoy
Level 1
Level 1

I don't want to deviate too far from your goal, but it is my understanding that have a DHCP address (for remote access) may not be the best idea.  The previous replies would absolutely work, but also consider a static address for remote management.  That way you will know what the address is at all times.  DHCP address could change and leave you scrambling to figure out what the new address is.  

I was able the IP Address in the DHCP server.