Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VLAN Specific Dhcp scopes ??

Status
Not open for further replies.

MRSOLO

Technical User
Jan 28, 2003
31
0
0
IE
I am trying to see how I can link a dhcp scope to a specific vlan. What I need to achieve is setup 4 dhcp scopes on a router, IP addresses from each of the 4 scopes are to be assigned to PCs that connect in from four different vlans. Each scope is associated with PCs connecting from one VLAN only.

E.g
PC in Vlan33 always gets an address in scope 1.
PC in Vlan34 always gets an address in scope 2.
PC in Vlan35 always gets an address in scope 3.
PC in Vlan36 always gets an address in scope 4.

If I setup 4 scopes Is there a way that I can associate each pool/scope with a specific vlan. Is it a case of associating a scope with a vlan interface and if so what is the command syntax.

Appreciate any assistance
 
I think as long as your router has L3 interfaces belonging to those VLANs and your scopes are properly configured, you don't need any extra commands.

So all you need to do is to define the scopes, configure the interfaces, and that's it.

Sample dhcp scope definition:

!
no ip dhcp conflict logging
ip dhcp excluded-address 192.168.0.1 192.168.0.10
ip dhcp excluded-address 192.168.1.1 192.168.1.10
!
ip dhcp pool POOL1
import all
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
domain-name pool1.com
netbios-name-server 192.168.3.100
netbios-node-type h-node
dns-server 192.168.3.101 192.168.3.102
lease 30
!
ip dhcp pool POOL2
import all
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
domain-name pool2.com
netbios-name-server 192.168.3.100
netbios-node-type h-node
dns-server 192.168.3.101 192.168.3.102
lease 30
!
 
Thanks Lambent works perfectly, wonder if I could ask you one further question, in your line of code "lease 30" represents 30 days, is there a way that I can configure the lease time interval to be units of hours instead of units of days.
Appreciate your assistance.
 
The following example shows a one-day lease:

lease 1


The following example shows a one-hour lease:

lease 0 1


The following example shows a one-minute lease:

lease 0 0 1


The following example shows an infinite (unlimited) lease:

lease infinite

Copy & paste from Cisco ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top