03-02-2022 12:50 PM
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?
Solved! Go to Solution.
03-02-2022 02:23 PM
03-02-2022 01:08 PM - edited 03-02-2022 01:08 PM
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?
03-02-2022 01:13 PM
03-02-2022 01:28 PM
then that config is still valid.
03-02-2022 02:23 PM
03-03-2022 11:06 AM
03-03-2022 11:45 AM
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.
03-02-2022 01:21 PM
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.
03-03-2022 08:05 AM
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.
03-03-2022 11:05 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide