cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1037
Views
17
Helpful
11
Replies

vlan dhcp addresses

carl_townshend
Spotlight
Spotlight

Can anyone tell me how I can get my router to give out ip addresses to a particular vlan only and nothing else on my network ?

11 Replies 11

ankurbhasin
Level 9
Level 9

Hi Carl,

You need to configure your router as DHCP server and in "network" command only include the subnet address which you want for that particular vlan

Something like this

service dhcp

!

ip dhcp pool

network x.x.x.x x.x.x.x

default-router x.x.x.x

!

ip dhcp excluded-address

Now make sure you include only that subnet in network command which you want for that specific vlan also make sure to exlude the address for default gateway which you have configured in default-router command.

I hope you will comtinue to rate the post like you did in last month.

HTH, if yes please rate the post.

Ankur

Thanks for the reply, What will stop these addresses getting flooded elsewhere on my network ? I just want them to get offered to say my 3rd floor and no where else ?

Hi Carl,

DHCP server will allot addresses which is configured in network command and as you updated in your initial post you want it for particualar vlan.

So no matter let all the vlans send a request only request coming from particular router interface for whose address in a part of that network subnet in DHCP config will get an IP from DHCP server.

Regards,

Ankur

So I would assign an address range on the same subnet as the sub interface ip of the router ? and would I set this address to be the default router address for the dhcp clients ?

cheers

Hi Carl,

Yes you got my point. You would assign an address range in network command on the same subnet as the sub interface ip of the router and you would set this address to be the default router address for the dhcp clients.

Once you set router sub-interface address to be the default router address for the dhcp clients you should also exclude that address configuring in command "ip dhcp excluded-address " this will exclude DHCP server to allot the default gateway from the DHCP pool and will only be used as default gateway for the clients.

I will wait for you to rate the post incase this post clarifies your doubt.

Regards,

Ankur

Hi Ankur, Are you sure that it wont give out dhcp addresses anywhere else on my network ?, if so that will work fine, also can I have multiple pools on my router ?

Hi Carl,

It will only assign an ip to the clients whose request comes on subinterface of the router whose ip range matches with the subnet in network command.

To answer your second question yes you can have multiple DHCP pools configured on your router and for that you just need to enter same set of commands which I posted in my initial post with different POOL name and network range.

HTH, if yes please rate the post.

Ankur

When I connect my windows dhcp server to this setup, will I have to make it a trunk port ?

Hi Carl,

No you need to configure trunk port but what you have to do is if you want only one vlan to get ip from DHCP server connect your windows DHCP server to the same vlan.

Or else if that is not possible then you can connect your windows DHCP server to any VLAN but on the router where you are doing inter vlan routing you can configure "ip helper-address "

on the subinterface on which you want your clients

to get ip from DHCP server.

HTH, if yes please rate the post.

Ankur

If I wanted all the different vlans to get ip addresses would I configure a trunk port then ?

Hi Carl,

I appreciate that you have started rating posts now.

There should be a trunk between the switches so that any clients on any switch can reach the router but not between the switch and windows DHCP server.

Windows DHCP server can be connected to any port in any vlan and make sure on the router where you are doing intervlan routing on each subinterface you configure "ip helper-address "

so that once the DHCP request from any client in any vlan hits the router subinterface router can redirect the broadcast request into unicast request to the specified DHCP server.

HTH, if yes please rate all post.

Ankur