cancel
Showing results for 
Search instead for 
Did you mean: 

iproute if only using L2

iproute if only using L2

JeremyClarkson
New Contributor
Hi,

I would like to put an example to every one and see what their thoughts are.

- configure vlan DATA add ports all untagged
- configure vlan DATA ipaddress 192.168.0.1 255.255.255.0

Now we have a router attached with Default Gateway 192.168.0.254

Do we need to add the following for packets to traverse?

- configure iproute add default 192.168.0.254

Thanks
21 REPLIES 21

JeremyClarkson
New Contributor
Great job drew,

by the way where do you get your network icons from they are cool!

Thanks

Drew_C
Valued Contributor III
Thanks!
I put that diagram together in Visio 2013. They're part of the the default network component shapes.

Drew_C
Valued Contributor III
Skimming through this thread, it sounds like there's some confusion around the roles played by a default gateway and a router.

In the diagram below, the switch has three L3 VLANs configured with IP forwarding. It also has a default gateway defined. The default gateway is used for all unknown routes, such as those that would lead to the internet. The PC and Printer are in their own separate VLANs, with each device's default gateway configured to point to the switch/router IP. If other PCs in the same subnet (192.168.1.0/24) want to talk to each other, they don't need a default gateway. But if they need to print or get out to the internet, it must be configured.

a6001112cf604200bca90e4f86a70ef7_20630-1wggin4_inline.png



The default gateway on the switch only needs to be for an "external" network - one where another device knows the routes for other things. In this case, it's going to be the internet gateway. The switch knows the routing information for all directly connected interfaces (the PC and Printer networks) and we don't need to configure default routes on the switch for those - that's not an option, nor is it necessary.

The routing happens in the switch (in this case, because of IP forwarding) for all directly connected routes. Those are listed in
code:
show iproute
.

In this case, if you want "remote access" from within the PC subnet (192.168.1.0/24), you wouldn't need any default route configured on the router. But, if you are on a different subnet - one not local to the router - you would have to configure the default gateway to point to an interface on a different router that knows how to get back to you.

I hope this is helpful!

-Drew

JeremyClarkson
New Contributor
one default gateway for each VLAN interface?

GTM-P2G8KFN