10-18-2010 07:54 AM - edited 03-06-2019 01:34 PM
I know that a multilayer switch can act both as DHCP server and as DHCP relay agent.
Is it possible to configure the switch as DHCP server for more different VLANs?
Switch(config)# interface vlan 10
Switch(config-if)# ip address 192.168.10.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# ip dhcp pool nome_10
Switch(config-dhcp)# network 192.168.10.0 255.255.255.0
Switch(config-dhcp)# default-router 192.168.10.1
Switch(config-dhcp)# lease infinite
Switch(config-dhcp)# exit
Switch(config)# interface vlan 20
Switch(config-if)# ip address 192.168.20.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# ip dhcp pool nome_20
Switch(config-dhcp)# network 192.168.20.0 255.255.255.0
Switch(config-dhcp)# default-router 192.168.20.1
Switch(config-dhcp)# lease infinite
Switch(config-dhcp)# exit
Is it possible to configure the switch as DHCP relay agent which refers to a DHCP server in one of its interfaces?
Thanks.
10-18-2010 08:07 AM
Hello Matteo,
using ip helper-address x.x.x.x on the appropriate SVI that you would like to be served by an external DHCP server (with ip address x.x.x.x) you should be able to achieve it
of course you will not configure a DHCP pool for the IP subnet of those SVIs on the multilayer switch.
see
Hope to help
Giuseppe
10-18-2010 08:58 AM
Hello Giuseppe and thanks for your answer.
And I imagine that x.x.x.x can not be an address that refers to the DHCP server on the switch itself.
Is it true?
10-18-2010 10:42 AM
speculor_cisco wrote:
Hello Giuseppe and thanks for your answer.
And I imagine that x.x.x.x can not be an address that refers to the DHCP server on the switch itself.
Is it true?
By definition it wouldn't need to be. If you have a L3 vlan interface on the switch and you create a DHCP pool for that vlan you wouldn't need an ip helper-address command. If you did need an ip helper-address command then the DHCP pool would not be on the switch.
Jon
10-18-2010 11:19 AM
Hello Jon.
It seems reasonable.
Thanks for the answer.
10-18-2010 11:30 AM
Hello Matteo,
as noted by Jon you don't need the ip helper address for locally defined DHCP pools.
In any case the broadcast DHCP request from client is process switched by the multilayer switch:
for locally defined pools the locally running DHCP server is used to pick up an address if one is available in the pool;
for IP subnets/SVIs where you want to rely to an external server the not routable DHCP request (S=0.0.0.0, D=255.255.255.255) is modified by the multilayer switch so that:
S=SVI ip address associated to broadcast domain that received the offer or that of interface towards the server ( more likely this )
D= unicast IP address of external server
inside the packet the GW address field is populated with the SVI ip address associated to broadcast domain that received the offer so that the the DHCP server can identify the DHCP pool to be used to pick up an address if one is available.
a sort of sequence number is added also to identify the transaction ( my guess)
the resulting packet can be routed to the external DHCP server.
see
http://docs.online.bg/NETWORKING/tcp-ip-illustrated/bootp.htm#16_5
Hope to help
Giuseppe
10-18-2010 08:08 AM
If it has dhcp capability there is no reason you can't do more than 1 subnet on the box.
10-18-2010 09:00 AM
Hello Glen.
Thanks for your answer.
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