12-30-2017 03:46 AM - edited 03-08-2019 01:15 PM
In router on stick , I face a problem is that when I create two sub-interfaces with two different networks each for a specified VLAN, the devices in those VLANs although they are in different VLANs and subnets, they can see each.
I don't know why, if those devices in different VLANs they can't see each other even if they are in same subnet IP, so why here with different subnets for each VLAN they see each other ?!!
I think it related to automatic routing that router by default does for its interfaces.
Thanks in advance to anyone that can help me.
The same result in both packet tracer and GNS3 !!
02-01-2018 01:15 PM - edited 02-01-2018 01:27 PM
Routers will automatically route between connected interfaces with an IP address so you are right in what you say.
If you want to restrict the traffic between the subnets you can use acls on the interfaces.
Or if you don’t want any traffic between the subnets don’t configure routing on a stick.
Jon
02-02-2018 05:25 AM
Hi,
A router is an l3 device and routing is enabled by default. So that you can see each other. If you really want to block the communication then configure ACL standard or extended.
Regards,
Deepak Kumar
02-02-2018 05:39 AM
If the original poster wants to keep the vlans separated another alternative might be to use vrf lite. We do not know what the original poster is attempting to achieve and that makes it difficult to give good advice. Perhaps the original poster can provide some clarification about what they are attempting to achieve?
HTH
Rik
02-02-2018 08:35 AM
02-02-2018 06:10 AM
We're not sure if you're trying to accomplish something specific or just looking for an explanation of why the vlans get routed when connected to the router.
The router will route to any network that it is directly connected to or knows about in its routing table, there's not a specific command to "turn off auto-routing" unless you turn routing off globally. That's what they are designed to do. Before multilayer switches came around, the router on a stick was the only way to have intervlan communication. In your GNS3 diagram, the Multilayer switches would be capable of intervlan routing also. To control that traffic, you'll need to use access control lists. For your scenario, to stop vlans 10 and 20 from being routed between each other an ACL would need to be put on the sub-interfaces on the router. They would look something like this:
Router-1
ip access-list 10
deny ip 11.0.0.0 0.0.0.255
permit ip any any
interface fa0/0.10 (sub-interface for vlan 10)
ip access-group 10
That list would block vlan 20 traffic from being routed into the vlan 10 sub-interface but still allow both vlans to be routed elsewhere
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