05-06-2018 07:00 PM - edited 03-08-2019 02:55 PM
I don't understand how this works on a router. If i configure two of these, how can a device know what interface they are connecting to? In the example below, how can the router know what vlan a connecting device must be on?
Interface Vlan10
ip address 192.168.10.1 255.255.255.0
interface Vlan20
ip address 192.168.20.1 255.255.255.0
ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
ip dhcp pool vlan20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
And also, I tried configuring this on packet tracer with a simple network and the PCs can't seem to have dhcp address.
05-06-2018 08:45 PM
05-06-2018 10:07 PM
Thanks for replying Francesco. What if there's no switch involved? Can you give me an example?
If there's two users connect to that network, what vlan are they going to belong to?
I already know how vlan work on a switch where you need to associate a port to a vlan but how does that work on a router? I'm confused.
05-07-2018 04:38 AM
05-07-2018 10:12 AM
Let me approach answering this question from a different perspective. What is given in the original post might work on some routers and would not work on other routers. Some routers have interfaces that operate as switch ports, such as some of the 800 series routers. Other routers may have a switch module as part of the router. On these types of routers you could configure some interfaces to belong to vlan 10 and some interfaces to belong to vlan 20. To determine what address a host would receive you need to check what physical port they are connected to and determine what vlan that port is assigned to.
Other routers have only routed ports. On these routers you can not configure vlan interfaces as is suggested in the original post.
HTH
Rick
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide