Re: One DHCP server for 2 VLANs scenario (1274 Views)
Reply
Occasional Advisor
abdullah.ali
Posts: 15
Registered: ‎07-23-2008
Message 1 of 8 (1,351 Views)
Accepted Solution

One DHCP server for 2 VLANs scenario

Hi All,

I know that we can use the one DHCP server for VLANs using the hp network feature (dhcp relay) but if i need to assign 2 different subnets for these 2 vlans, how can the dhcp server understand what subnet to use when it receives a request for the network?

i.e. Assume a dhcp server in vlan 1
configured for 2 subnets say 192.168.1.0/24 and 192.168.2.0/24
when a client from vlan 1 requests an ip address, then the dhcp server replies with an ip address from the first subnet e.g. 192.168.1.1/24 but when a client in the second vlan sends a request, the switch sends the request to the dhcp server in vlan 1, but how will the dhcp server know that it should reply with an ip address in the second subnet not from the first?
Honored Contributor
Jeff Carrell
Posts: 416
Registered: ‎11-28-2007
Message 2 of 8 (1,351 Views)

Re: One DHCP server for 2 VLANs scenario


if the dhcp srvr is connected to vlan1, then in vlan2 you need the following:

switch (config)# 'vlan 2'
switch (vlan 2)# 'ip helper-address '

then, when the dhcp broadcast is received by the switch from the client, it "relays" the dhcp broadcast over to vlan1, and sets an option to say it was sourced from network 192.168.2.0/24, and then the dhcp srvr get the dhcp request and looks in its scopes and sees that it has a scope for that subnet, and provides a client ip fro that scope/subnet, sends it back to the switch, the switch "relays" it back to vlan2 destined for the mac addr of the client...

hth...jeff
Honored Contributor
cenk sasmaztin
Posts: 1,435
Registered: ‎04-02-2008
Message 3 of 8 (1,351 Views)

Re: One DHCP server for 2 VLANs scenario

hi abdullah
dhcp server take to client dhcp request message with broadcast
and dhcp server response to client with unicast

if dhcp request message coming on same broadcast domain to dhcp server

dhcp server assign ip address own network scobe with unicast to client

if dhcp request message coming other broadcast domain (other vlan ,other wide site etc.)
dhcp server see other side default gateway address in request packet
and send that network scobe ip address to client with unicast

you can see with wireshark
cenk

Honored Contributor
cenk sasmaztin
Posts: 1,435
Registered: ‎04-02-2008
Message 4 of 8 (1,351 Views)

Re: One DHCP server for 2 VLANs scenario

Occasional Advisor
abdullah.ali
Posts: 15
Registered: ‎07-23-2008
Message 5 of 8 (1,351 Views)

Re: One DHCP server for 2 VLANs scenario

Thanks all for your reply.
Jeff Carrell, so is the key point here to assign an ip address for the VLAN in the same subnet I wish to have an IP Address in?
Honored Contributor
Jeff Carrell
Posts: 416
Registered: ‎11-28-2007
Message 6 of 8 (1,351 Views)

Re: One DHCP server for 2 VLANs scenario

correct...example:

vlan 1 ip address 192.168.1.1/24

vlan 2 ip address 192.168.2.1/24
vlan 2 ip helper-address 192.168.1.x [dhcp srvr ip in vlan1]

and you also need 'ip routing' enabled if you want devices on each vlan to access the other vlan...

then the vlan ip addresses on thw switch are your default gateways...

scopes in dhcp look like:

name: vlan 1
subnet: 192.168.1.0/24
pool: 192.1681..100-192.168.1.200
def g/w: 192.168.1.1
dns: 192.168.1.x
domain: yourdomain.com

name: vlan 2
subnet: 192.168.2.0/24
pool: 192.168.2.100-192.168.2.200
def g/w: 192.168.2.1
dns: 192.168.1.x
domain: yourdomain.com

hth...jeff
Occasional Advisor
jadielmota
Posts: 5
Registered: ‎04-25-2013
Message 7 of 8 (1,301 Views)

Re: One DHCP server for 2 VLANs scenario

Dear Jeff,

 

I am having some problems with a Microsoft AD/DHCP server and a switch 3com 4800g.

In almost every lab I looked at in the configuration guide, it is assumed that L3 switch is going to

work as a dhcp server as well. But, a lot of companies use Microsoft AD which by default works as a DHCP and DNS server, that is my case.

So, my question to you is, do you have an idea as to how to use the relay capability of a 4800g switch

in order to have at least 3 vlans getting the DHCP addresses from a Microsoft AD DHCP server connected to vlan2?

 

I attached an image of what I am trying to set up. I have configured the IPs of the interfaces,

the default route and the relay on port 2. I have also set port 2 as trunk in order to have all traffic

from all other vlans go through it.

I am able to ping each individual interface with a host in the same network. Except the trunk interface (port 2).

I cannot reach any other interface but the one I am connected to and as a result I cannot get an IP address

from the AD. Anything you can share would be helpful.

 

Thanks.

Trusted Contributor
Vince_Whirlwind
Posts: 401
Registered: ‎02-25-2013
Message 8 of 8 (1,274 Views)

Re: One DHCP server for 2 VLANs scenario

Is port 2 your connection to your server?

That shouldn't be a trunk. It should be an access port in the VLAN the server belongs to.

 

To summarise: you have 4 networks:

SERVERNET: 10.7.1.0   = VLAN1

NET_A:           10.7.8.0   = VLAN8

NET_B:           10.7.16.0 = VLAN16

NET_C:           10.7.32.0   = VLAN32

 

Each network is connected to an access port on the 4800 switch that is in the correct VLAN, ie,

Port2 is an access port in VLAN1

Port3 is an access port in VLAN32

Port4 is an access port in VLAN16

Port5 is an access port in VLAN8

 

On the 4800 switch, you have 4 VLAN interfaces configured:

VLAN1     --  10.7.1.1

VLAN8     --  10.7.8.1

VLAN16  --  10.7.16.1

VLAN32  --  10.7.32.1

 

On the last 3 VLAN interfaces, you have an "IP Helper" address configured, pointing at 10.7.1.6.

 

 

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.