cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3094
Views
0
Helpful
2
Replies

Different dhcp pools for different ports

jscott
Level 1
Level 1

I would like to setup dhcp so it will assign ip addresses from different pools depending on which port it is connected to. The tricky part is all the dhcp ports need to be in the same subnet. For example half the ports gets an address from 172.16.1.2-20 and the other half recieve an address from a pool with the range of 172.16.1.21-40. Would I have to setup different vlans or is there a way of attaching pools to a set of ports?

2 Replies 2

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Joe,

you can only differentiate by putting the ports in different Vlans and having the DHCP pools mapped to different  smaller IP subnets.

Until two ports are part of the same Vlan there is no reason for  the network device to discriminate between them: a user connected to any of the two ports will get an IP address from the  same DHCP pool.

By the way,  you can discriminate based on the MAC address of the client NIC configuring a DHCP pool with only one IP address. In this way you can always assign the same IP address to the same PC.

Hope to help

Giuseppe

Sandeep Choudhary
VIP Alumni
VIP Alumni

Hi Joe,

You can create dhcp pool for diffirent vlans:

just like any other IOS DHCP configs ...here is a sample config:

interface vlan 1

ip add 1.1.1.1 255.255.255.0

interface vlan 2

ip address  1.1.2.1 255.255.255.0

ip dhcp excluded-address 1.1.1.1 1.1.1.10

ip dhcp excluded-address 1.1.2.1 1.1.1.10
!
ip dhcp pool vlan1
   network 1.1.1.0 255.255.255.0
   domain-name cisco.com
   dns-server 4.4.4.2 4.4.4.1
   default-router 1.1.1.1

   lease 3

!

ip dhcp pool vlan2
    network 1.1.2.0 255.255.255.0
    domain-name cisco.com
    dns-server 4.4.4.2 4.4.4.1
    default-router 1.1.2.1

   lease 3

!

Here is the link for configuring IOS DHCP services:

http://www.cisco.com/en/US/docs/ios/ipaddr/configuration/guide/iad_dhcp_svr_cfg_ps6441_TSD_Products_Configuration_Guide_Chapter.html

Here i am attaching my own new test lab with 2 ports of a switch(Means 2 diff vlans) and 2 diff pool for the respective vlans.

check it :

Test_Lab diagram

Test_Router config

Test_switch config

Regards

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card