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

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

VLAN on routers

Hi all,

Could you please somebody help me with this? I`m wondering how to cofigure VLANs on router, I mean to associate VLANs with specific IP pool which the router is supposed to distribute, so that then I`ll be able only to assign VLAN number to the specific port on switch, plug cable in and get the appropriate ip address from the correct VLAN`s pool. I`m aware of some configs on Cisco routers and switches, but none of them applies to this settings.

Thank you in advance,

Radim

3 REPLIES
Cisco Employee

VLAN on routers

Hi Radim,

are you talking about DHCP server?

if yes, the easieast way is to configure one dhcp pool per vlan. Then you configure the link between the router and the switch(s) as trunk ports specifing the dot1q encapsulation matching your vlans.

example for the relevant part only assuming that you configure on your switch access ports only in vlan 10 or 20.

ip dhcp pool pool10

   network 10.10.10.0 255.255.255.0

   default-router 10.10.10.1

!

ip dhcp pool pool20

   network 10.10.20.0 255.255.255.0

   default-router 10.10.20.1

interface GigabitEthernet0/1.10

encapsulation dot1Q 10

ip address 10.10.10.1 255.255.255.0

!

interface GigabitEthernet0/1.20

encapsulation dot1Q 20

ip address 10.10.20.1 255.255.255.0

!

Riccardo

New Member

VLAN on routers

Thanks, so all configurations I need, to make the properly configured switch ports (with appropriate VLANs numbers) handing out the correct ip addresses is to configure DHCP server?so this is the place where I associate the VLANs numbers with the appropriate IP pool?

Thank you,

Radim

Cisco Employee

VLAN on routers

uhmm not sure if I get you...

In order to 'distribute' or assign IP address you need to have a DHCP server in your network. So simply put you need a DHCP server to give IP addresses out in any case. The fact that your hosts are in different vlans is something else.

So the DHCP server is something that you need to have as a start!

Then if you need your server to assign addresses hosts in multiple vlans you need to create an IP pool per vlan.

Then you need to make the router understand the concept of vlan (that is why you configure a trunk with dot1q encapsulation) in order to make sure that hosts in a given vlan get Ip addresses from the correct pool.

If your router is a multi layer switch (cat3560 /3750 / 4k / 6500 /7600 etc) you might simply create an SVI per every vlan you need a DHCP pool, but you still need a trunk towards the switch carrying all the vlans defined there. If you are not familiar with mls routers or SVI concpet simply ignore my last paragrapgh 

Riccardo

2818
Views
20
Helpful
3
Replies