Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

VLANs With DHCP

Dear All,

I am having one doubt, i have one cisco 1841 (12.4) router which is connecting to a cisco 2960 switch, i have 6 Vlans on my switch. Now i want to make my router as a DHCP server, but i want that my router assingn the IP's to Clients on the basis of Vlans i.e. suppose i have 2 vlan

Vlan 1 ---- 192.168.1.0 /24 subnet

Vlan 2 ---- 192.168.2.0 /24 subnet

Now i want my router to assign client in VLAN 1 IPs in range of 192.168.1.0

VLAN 2 IPs in range of 192.168.2.0

Is it possible and if yes can you help me with commands.

Regards,

Hussain Ratlami

Network Engineer

1 REPLY
Hall of Fame Super Silver

Re: VLANs With DHCP

Hello Hussain,

this is possible and you need to define multiple dhcp pools one for each VLAN.

There is no risk of confusion because the DHCP client sends its request with a broadcast 255.255.255.255 IP destination, the router tracks on what vlan it receives the request and takes an address from the right pool

Config example:

ip dhcp excluded-address 10.110.224.129 10.110.224.132

ip dhcp excluded-address 10.110.224.145

ip dhcp pool DATA

network 10.110.224.128 255.255.255.240

default-router 10.110.224.129

dns-server 10.98.112.32 10.55.0.32

netbios-name-server 10.52.64.37 10.24.128.151

lease 0 1

!

ip dhcp pool VOICE

network 10.110.224.144 255.255.255.248

default-router 10.110.224.145

dns-server 10.98.112.32 10.55.0.32

netbios-name-server 10.52.64.37 10.24.128.151

option 150 ip 10.98.67.5 10.55.61.4

lease 0 1

!

in your case just adapt to 192.168.1.0 and to 192.168.2.0 using mask 255.255.255.0

Hope to help

Giuseppe

119
Views
4
Helpful
1
Replies
CreatePlease to create content