Jump to content

vlans tags

ilyas001

hello guy my question does switches learn vlans of neighbor swiches like they learn mac addresse's i mean will it always broadcast the frames to all switches even if they don't even have the switch that does receive the frame doesn't have the  vlan in question , will they always broadcast the message over the switches until getting to the right switch with the right vlan and the destination pc ? 

Link to comment
Share on other sites

Link to post
Share on other sites

You can manage VLANs using VTP but I do it manually, ish. You can get switches to manage their config from a network source so you can use configuration templates, I trust this more than VTP.

 

Small networks I just do all of it manually since it's not hard.

Link to comment
Share on other sites

Link to post
Share on other sites

Also there is this sweet gem to VTP. Sometimes doing things more manually is just safer/better.

 

Quote

When a new switch is added to the network, by default it is configured with no VTP domain name or password, but in VTP server mode. If no VTP Domain Name has been configured, it assumes the one from the first VTP packet it receives. Since a new switch has a VTP configuration revision of 0, it will accept any revision number as newer and overwrite its VLAN information if the VTP passwords match. However, if you were to accidentally connect a switch to the network with the correct VTP domain name and password but a higher VTP revision number than what the network currently has (such as a switch that had been removed from the network for maintenance and returned with its VLAN information deleted) then the entire VTP Domain would adopt the VLAN configuration of the new switch which is likely to cause loss of VLAN information on all switches in the VTP Domain, leading to failures on the network. Since Cisco switches maintain VTP configuration information separately from the normal configuration, and since this particular issue occurs so frequently, it has become known colloquially as the "VTP Bomb".

https://en.wikipedia.org/wiki/VLAN_Trunking_Protocol#Downside

Link to comment
Share on other sites

Link to post
Share on other sites

11 hours ago, ilyas001 said:

hello guy my question does switches learn vlans of neighbor swiches like they learn mac addresse's i mean will it always broadcast the frames to all switches even if they don't even have the switch that does receive the frame doesn't have the  vlan in question , will they always broadcast the message over the switches until getting to the right switch with the right vlan and the destination pc ? 

Could you please rephrase the question? I don't really understand what your question is.

Like leadeater said, you can make sure all switches have the same VLANs configured by using VTP.

 

As for the switch broadcasting messages to all other switches until it finds the correct one, that does not happen. A switch (unless we're talking layer 3 switches) can not forward a packet from for example VLAN 10 to VLAN 20. You need a L3 switch or router to do that, and they will just discard packets from a VLAN they don't know about (if I recall correctly).

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, LAwLz said:

Could you please rephrase the question? I don't really understand what your question is.

Like leadeater said, you can make sure all switches have the same VLANs configured by using VTP.

 

As for the switch broadcasting messages to all other switches until it finds the correct one, that does not happen. A switch (unless we're talking layer 3 switches) can not forward a packet from for example VLAN 10 to VLAN 20. You need a L3 switch or router to do that, and they will just discard packets from a VLAN they don't know about (if I recall correctly).

well i will try to clarify my question , imagine that we have 4 switches all of them have the same vlans only for vlan 10 , vlan 10 is only disponibl in switch 1 and switch 4 if i want to send a packet to a pc withing the switch 4 range , now what i want to understand is how will this packet be transmitted from switch 1 to 4 ? if the switch 2 and 3 don't know about vlan 10 so they will always automatically broadcast the packet all over the sub net until reaching the wanted pc ? because l2 switches  doesn't work like routers they don't have a routing table to choose the best path to the wanted switch that's what i want to know , i can't imagine a way switches can smartelly send packets over vlans 

Link to comment
Share on other sites

Link to post
Share on other sites

34 minutes ago, ilyas001 said:

well i will try to clarify my question , imagine that we have 4 switches all of them have the same vlans only for vlan 10 , vlan 10 is only disponibl in switch 1 and switch 4 if i want to send a packet to a pc withing the switch 4 range , now what i want to understand is how will this packet be transmitted from switch 1 to 4 ? if the switch 2 and 3 don't know about vlan 10 so they will always automatically broadcast the packet all over the sub net until reaching the wanted pc ? because l2 switches  doesn't work like routers they don't have a routing table to choose the best path to the wanted switch that's what i want to know , i can't imagine a way switches can smartelly send packets over vlans 

A switch has different types of ports, keeping it simple these are Access ports or Trunk ports.

 

An Access port is for client devices, a PC for example, and needs to have an untagged VLAN defined (native/default VLAN). Only traffic for that VLAN will exit that port to the client device, if it is destined for that device as all normal switching rules apply.

 

A Trunk port by default will allow any tagged VLAN packet to be passed along, however you can configure a trunk port to only allow certain VLANs if you so wish. Trunk ports are required between switches so VLAN traffic can be forwarded around the network to the destination switch and then untagged to an access port for a client device. Servers also use trunk ports, not always but often.

 

To configure a switch access port to untag a VLAN that VLAN needs to be in the switch's database, for a trunk port it will allow any VLAN tagged packet to pass.

 

VLANs are just virtual network segments and you should treat them as if they were actual physical devices/switches. There needs to be a connectivity path from one point to another else traffic will not make it to the destination, a cable is unplugged effectively.

 

In your example if PC 1 on switch 1 port 6 untagged VLAN 10 wants to communicate to PC 2 on switch 4 port 7 untagged VLAN 10 there needs to be a port from switch 1 to switch 2 to switch 3 to switch 4 connected and all these ports need to be set to trunk mode else the traffic wont even make it out of switch 1.

 

IP addressing and subnets are separate from VLANs, almost unrelated. VLANs are a Layer 2 protocol and therefore do not use or look at IP addresses. On a Layer 3+ switch you can give a VLAN virtual interface an IP address and this is used to route traffic between VLANs, but that is routing and not VLANs itself.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×