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

VLAN

LATINMUSIC75
Level 1
Level 1

If I have 4 VLAN'S. How do i provide the workstation in each VLAN with a dinamically IP address.

1 Accepted Solution

Accepted Solutions

thisisshanky
Level 11
Level 11

I assume routing between 4 vlans is done by a layer 3 device either the l3 switch itself or a router. On the router, that does the inter vlan routing, (if its a cisco router) you can run Cisco IOS dhcp and run multiple pools. Otherwise you can configure this L3 device to relay dhcp requests from each vlan to a DHCP server which can be a Microsoft or Linux DHCP server (any DHCP capable server) as follows using helper-address command under each vlan.

int vlan 1

ip helper-address

int vlan 2

ip helper-address

int vlan 3

ip helper-address

int vlan 4

ip helper-address

If the L3 device is running on a router and it has sub interfaces defined for each vlan,

ip dhcp pool Pool1

network 172.16.1.0/24

default-router 172.16.1.1

ip dhcp pool Pool2

network 172.16.2.0/24

default-router 172.16.2.1

ip dhcp pool Pool3

network 172.16.3.0/24

default-router 172.16.3.1

ip dhcp pool Pool4

network 172.16.4.0/24

default-router 172.16.4.1

int fa0/0

no ip add

int fa0/0.1

encap dot1q 1

ip add 172.16.1.1

int fa0/0.2

encap dot1q 2

ip add 172.16.2.1

int fa0/0.3

encap dot1q 3

ip add 172.16.3.1

int fa0/0.4

encap dot1q 3

ip add 172.16.4.1

Where vlans 1,2,3,4 are trunked from the switch where the vlans are defined to the router's fastE interface.

Also exclude the addresses 172.16.1.1, 2.1, 3.1, 4.1 and any other address you want to exclude using command

ip dhcp excluded-address 172.16.1.1

ip dhcp excluded-address 172.16.2.1

ip dhcp excluded-address 172.16.3.1

ip dhcp excluded-address 172.16.4.1

Other options such as Lease time, DNS, WINS, Scope options etc can be specified as part of each pool. Even client reservations based on mac addresses are possible.

HTH

Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus

View solution in original post

2 Replies 2

thisisshanky
Level 11
Level 11

I assume routing between 4 vlans is done by a layer 3 device either the l3 switch itself or a router. On the router, that does the inter vlan routing, (if its a cisco router) you can run Cisco IOS dhcp and run multiple pools. Otherwise you can configure this L3 device to relay dhcp requests from each vlan to a DHCP server which can be a Microsoft or Linux DHCP server (any DHCP capable server) as follows using helper-address command under each vlan.

int vlan 1

ip helper-address

int vlan 2

ip helper-address

int vlan 3

ip helper-address

int vlan 4

ip helper-address

If the L3 device is running on a router and it has sub interfaces defined for each vlan,

ip dhcp pool Pool1

network 172.16.1.0/24

default-router 172.16.1.1

ip dhcp pool Pool2

network 172.16.2.0/24

default-router 172.16.2.1

ip dhcp pool Pool3

network 172.16.3.0/24

default-router 172.16.3.1

ip dhcp pool Pool4

network 172.16.4.0/24

default-router 172.16.4.1

int fa0/0

no ip add

int fa0/0.1

encap dot1q 1

ip add 172.16.1.1

int fa0/0.2

encap dot1q 2

ip add 172.16.2.1

int fa0/0.3

encap dot1q 3

ip add 172.16.3.1

int fa0/0.4

encap dot1q 3

ip add 172.16.4.1

Where vlans 1,2,3,4 are trunked from the switch where the vlans are defined to the router's fastE interface.

Also exclude the addresses 172.16.1.1, 2.1, 3.1, 4.1 and any other address you want to exclude using command

ip dhcp excluded-address 172.16.1.1

ip dhcp excluded-address 172.16.2.1

ip dhcp excluded-address 172.16.3.1

ip dhcp excluded-address 172.16.4.1

Other options such as Lease time, DNS, WINS, Scope options etc can be specified as part of each pool. Even client reservations based on mac addresses are possible.

HTH

Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus

Thank you, I am going to implimented this weekend

Review Cisco Networking for a $25 gift card