When to use IP Default Gateway command.

When to use IP Default Gateway command.

IP default gateway command , if I am not wrong is used in L2 switches to set up a default gateway so that Administrators can remotely connect to the switch.

OK let's say we have  switch SW1 connected to R1 connected to SW2 and Administrator PC is connected to SW2 , what should be configured  on SW2, R1 , SW1 for Administrator PC to connect to SW1

Thank you
jskfanAsked:
Who is Participating?
 
JustInCaseConnect With a Mentor Commented:
Qlemo, each L2 managed switch that I configured so far had VLAN and SVI to be configured for management purpose. There are devices that have additional management interface for OOB administration, but from my experience even in enterprises in is rarely in use since it requires either separate passive infrastructure (where I see those in use are data centers) or will have be connected to VLAN access port for the same functionality that is already provided by virtual interface. But, generally, the is no big functional difference between VLAN and this OOB LAN - it provides separation management traffic from other types of traffic. Big difference, typically, is that if production network is unavailable from in-band, we would be still able to connect to devices and configure it. Code above is for Cisco devices, since I know that author is 99% of the time asking questions about Cisco devices and I know that Cisco has clear separation when default route and when default gateway should be configured (L3 devices are configured with default route, not with default gateway). Even in the case of multiple L3 devices that are configured with default routes (of any vendor), for example, in small to middle size branches, typically on access switches there will be one VLAN that is configured for management purposes and default route will point to core/distribution SVI management VLAN since most of the time still there is no routing done in access layer (although design might go into that direction according to newer design guides that I read in a last few years). Maybe you have different experience, but this is approach what I am dealing with every day.

Management VLAN is generally configured in networks to separate management traffic from other types of traffic and for security purposes. That is recommended design, if OOB management is not in use. So, I guess I will not separate VLAN and management explicitly, since it would be choice between in-bound management with by usage of VLAN or OOB with usage of separate LAN for similar purpose.

Unmanaged switches can't be configured with IP address, default gateway and cannot have VLANs configured, so those are ignored.

jskfan - additional SVIs can be configured on switch, but typically, on "pure" L2 devices only one SVI can be in up up state and if you don't shut down SVI for VLAN1 other SVI can't be used. FYI, 2960 switch can have multiple SVI configured and basic routing (16 static routes last time I checked) but SDM template need to be changed to be able to use it (exception is switch with LAN LITE license - SDM template can't be changed).
0
 
JustInCaseCommented:
You are right. Default gateway should be configured on L2 switches.
Default gateway on all switches are targeting L3 device SVI in the same VLAN (management VLAN).
0
 
QlemoConnect With a Mentor Batchelor, Developer and EE Topic AdvisorCommented:
R1 needs to be the default gateway on both switches.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
jskfanAuthor Commented:
So,  from the Administrator PC, you can telnet to the configured DG  IP address , and you will be in SW1 terminal ?
0
 
JustInCaseCommented:
No. You are telnetting directly to devices (Targeting device management IP address as destination address).
telnet 10.10.10.10

Where 10.10.10.10 is switch management IP address
Also, telnet should not be used, SSH is preferred.
0
 
jskfanAuthor Commented:
OK..
so on Layer2  SW1 you need to configure :
interface Vlan1
IP address 10.10.10.10

IP Default Gateway 10.10.10.1  ( Ip address of R1 interface facing SW1)
on the PC you can Telnet or SSH to 10.10.10.10 and you will be on the Terminal window of the switch  ?
0
 
JustInCaseCommented:
interface Vlan1
ip address 10.10.10.10 255.255.255.0
!
ip default-gateway 10.10.10.1
!
line vty 0 5
 no login

Open in new window

From device that can route (access) to device:
telnet 10.10.10.10
And you will be placed in exec mode
SW1>
0
 
jskfanAuthor Commented:
From device that can route (access) to device:
you mean from a PC ?
0
 
JustInCaseCommented:
PC need to be able to get to router, and traffic from router need to be able to get to PC.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Predrag, unless you know a lot about the particular devices in use here, it's a far stretched to assume a particular switch manufacturer, no? And can we please stop talking about VLANs, as a switch can be configured with a management address  very well (usually) without setting up a VLAN (explicitly)?
0
 
jskfanAuthor Commented:
Qlemo

in L2 Switch, I believe there is only a default Vlan 1
you cannot create VLans.. so the Management interface will be Interface Vlan 1..the only option
0
 
jskfanAuthor Commented:
Thank you very much  for your Input Guys
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.