cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
15914
Views
15
Helpful
7
Replies

Multilayer switch and DHCP.

speculor_cisco
Level 1
Level 1

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.

7 Replies 7

Giuseppe Larosa
Hall of Fame
Hall of Fame

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

http://www.cisco.com/en/US/docs/switches/lan/catalyst3750/software/release/12.2_52_se/configuration/guide/swdhcp82.html#wp1218221

Hope to help

Giuseppe

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?

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

Hello Jon.

It seems reasonable.

Thanks for the answer.

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

glen.grant
VIP Alumni
VIP Alumni

   If it has dhcp capability there is no reason you can't do more than 1 subnet on the box.

Hello Glen.

Thanks for your answer.