Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Questions on why switches have IP addresses

Status
Not open for further replies.

creeping666

Technical User
Jan 21, 2009
24
NZ
1) Why do switches need to have a default gateway if they work at OSI level 2?

2) What is the purpose of VLAN's having an IP address? Is it purely so administrators can have remote access to the switch?
Is there any other reason?

ie. VLAN 1 IP = 172.16.0.1 / 16
VLAN 2 IP = 172.17.0.1 / 16

If the admin VLAN is 1 and the administrators computer is in VLAN 1, I would connect to 172.16.0.1 to administer the switch?

If the admin VLAN is 1 and the administrators computer is in VLAN 2, would I be able to connect to 172.17.0.1 to administer the switch?
Or would I have to change the admin VLAN to VLAN 2 before I could administer the switch?
 
Switches no longer just work at layer-2, a lot now work at layer-3 as well as layer-2 so they are effectively routers. A layer-2 only switch will typically only have one IP address and yes, this is just for management. If it has multiple IP addresses then it is probably a layer-3 switch.

Andy
 
Thanks, ok so my 2950 is only layer 2, so why does it need a default gateway?
 
Thanks, ok so my 2950 is only layer 2, so why does it need a default gateway?

Why does your PC need a default gateway? To send traffic beyond the local network/subnet..... Same for the layer-2 switch.

Stop posting and do some research.
 
ADB100, I know why PC's need a default gateway, to communicate with an 'IP' address. 'IP' meaning not layer 2. And My swicth is layer 2, so the switching side knows nothing about IP.

If the default gateway was a MAC address that might make sense at layer 2, but not an IP address.
 
Your switch is layer 2 meaning it does not have routing capabilities. However, it still has a base MAC address and the ability to have a single IP address assigned to it for management purposes. If you set up a management VLAN and you are attempting to manage the switch from a remote subnet, the return traffic needs to know where to go. This is where the default gateway comes into play.

I hate all Uppercase... I don't want my groups to seem angry at me all the time! =)
- ColdFlame (vbscript forum)
 
Andy...lol...give the guy a break! He seems to have done some research, but may be confused about this...it can be confusing...

The 2950 many times has vlans configured, and pc's attached to the switchports. The switch needs a gateway to know how to route between the vlans, since it cannot route its own vlans---the gateway is the next hop IP address of the router that does all the routing for the vlans. Make sense? Just another way to explain it...

Burt
 
Burt the 2950 has a gateway to strictly manage the switch itself . It has no effect on any configured vlans on the switch . For vlans on the switch it would have to be trunked to a layer 3 device , either a router or a L3 switch . The pc's gateways are pointed to that layer 3 device address for that vlan on the l3 or router. The gateway on the switch is so the switch can be reached from a subnet other than the switches management vlan it has to know where to send management packets that destined off the subnet.
 
Thanks everyone, I did do alot research. Maybe that was part of the problem... the more I read the more people mixed terms (not in this forum) making it look conflicting and confusing.
 
I wasn't trying to cause offence, it just seemed such a stupid question to me
why does a Layer-2 switch need an IP address?
Most layer-2 switches of any decency will be remotely manageable; therefore they will contain an IP stack so they can send and receive 'management' traffic. This could be the switch sending SNMP traps or Syslog messages, or Telnet, SSH or HTTP sessions to the switch to configure it etc. If the switch doesn't have a default gateway then you could only manage it from a host in the same network/subnet. This is probably fine in a tiny network, however most networks consist of several networks/subnets and therefore all the IP hosts require a default-gateway in their network/subnet.

That, plus the 'other' posts...

Andy
 
The simple answer is that the switch's IP address has nothing to do with the switch's job of switching traffic between its switch ports.

Also, if you see a "switch" which has multiple IP addresses on different VLANs, you are looking at a "layer-3 switch", which is for all intents and purposes a router.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top