cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
17606
Views
6
Helpful
12
Replies

What happens when switch trunk port connected to PC?

getaway51
Level 2
Level 2

If 2 PC connected to trunk port, can they still ping each other? What is the reason behind if they can or cannot?

3 Accepted Solutions

Accepted Solutions

cassiolange
Level 1
Level 1

Hello Getaway51,

 

Yes they can, but the native must be the same on both ports.

The reason is simple, when PC1 send the frame to the switch, the switch put a tag of vlan in the frame. (Native VLAN). When the switch send the frame to the PC2, this tag are stripped from frame.

 

Image12001.gif

 

View solution in original post

Better still:

 

!
interface range fa0/1-24
  switchport mode trunk
  switchport trunk native vlan 10
!

View solution in original post

There some things that we do not know about the environment that you are suggesting and so we must make some assumptions. You have not identified whether these switches are layer 2 switches or whether they might be layer 3 switches. I am assuming that they are layer 2 and not layer 3 switches. You have not specified whether there is any device connected in the network providing routing between subnets. I am assuming that there is not any layer 3 routing being performed. Some PCs have ethernet cards that understand trunking and can process ethernet frames with vlan tags but most PC ethernet cards do not process ethernet frames with vlan tags. I am assuming that these PC do not process vlan tags. Can you verify whether these assumptions are correct?

 

Based on those assumptions here is my explanation:

The PC connected on fa0/24 will be sending ethernet frames with no vlan tag. So the switch will treat the PC as a member of vlan 10. Frames from the PC in vlan 10 can be forwarded to other devices in vlan 10, including being sent to other switches that participate in vlan 10. If there are PCs connected on other switches in vlan 10 then this PC and those PCs in vlan 10 should be able to communicate (and this is based on another assumption which is that all devices that belong to vlan 10 are configured with IP addresses in the same IP subnet).

 

Perhaps another way to think about this starts from the understanding that an arp request is sent out as a broadcast frame. So if this PC sends an arp request in vlan 10 then the switch will forward the arp request throughout vlan 10. If there are other switches connected to this switch on vlan 10 then the arp request is forwarded to those switches, and to all devices connected on those switches in vlan 10. So any 2 PCs connected in vlan 10 on separate switches should be able to communicate. 

 

But devices connected in vlan 10 will not be able to communicate with devices in vlan 5 unless there is some device providing layer 3 routing.

 

HTH

 

Rick

HTH

Rick

View solution in original post

12 Replies 12

cassiolange
Level 1
Level 1

Hello Getaway51,

 

Yes they can, but the native must be the same on both ports.

The reason is simple, when PC1 send the frame to the switch, the switch put a tag of vlan in the frame. (Native VLAN). When the switch send the frame to the PC2, this tag are stripped from frame.

 

Image12001.gif

 

do you mean that each port (from port 0/1-0/24) , I have to set native vlan?

omnisecu.com.sw01(config)#interface fa0/24
omnisecu.com.sw01(config-if)#switchport mode trunk
omnisecu.com.sw01(config-if)#switchport trunk native vlan 10

 something like this? repeat this cmd for 24 times?

Better still:

 

!
interface range fa0/1-24
  switchport mode trunk
  switchport trunk native vlan 10
!

1)Does it means that fa0/24 cant ping fa0/23 & fa0/22?

2)fa0/23 & fa0/22 can ping each other?

omnisecu.com.sw01(config)#interface fa0/24
omnisecu.com.sw01(config-if)#switchport mode trunk
omnisecu.com.sw01(config-if)#switchport trunk native vlan 10
omnisecu.com.sw01(config)#interface fa0/23
omnisecu.com.sw01(config-if)#switchport mode trunk
omnisecu.com.sw01(config-if)#switchport trunk native vlan 5

 

omnisecu.com.sw01(config)#interface fa0/22
omnisecu.com.sw01(config-if)#switchport mode access
omnisecu.com.sw01(config-if)#switchport access vlan 5

 

In a purely Layer2 environment, your statements are correct.

What you suggest here is kind of interesting. It is quite legitimate though some might say that it was not a proper configuration. In discussing this let us start by reviewing what it means to be native vlan. Trunking using 802.1q inserts tags in the frame to identify individual vlans when a trunk will carry more than one vlan. So the switch uses tags to know whether a particular frame belongs to vlan 1 or to vlan 5 or to vlan 10. Most devices that participate in trunks will understand and process the vlan tags. But some devices (probably including the PCs in your example) do not understand tags. So the trunking protocol specifies that one vlan will be identified as the native vlan and the important thing about the native vlan is that frames in this vlan do not have tags. So the native vlan provides compatibility for devices that do not process vlan tags.

 

If we look into your configuration we see that fa0/22 is an access port in vlan 5. Remember that access ports do not use tags. We see that fa0/23 is a trunk port and that the native vlan is 5. So when the PC connected to fa0/23 sends an ethernet frame with no tag the switch will assume that it is in vlan 5. So the PC on fa0/22 and fa0/23 are in the same vlan. Frames from one are easily forwarded to the other and these two PCs can communicate. We see that fa0/24 is a trunk with native vlan of 10. So when the PC connected to this interface sends an ethernet frame with no tag the switch will assume that it is in vlan 10. A layer 2 switch can not forward frames from one vlan to another vlan. So the PC on fa0/24 can not communicate with the other PCs in vlan 5 without having some layer 3 device to provide routing between vlans.

 

HTH

 

Rick

HTH

Rick

Is it possible tht frame frm fa0/24 goes to adjacent switch & ping those pc
runnning on vlan 10 (which is the same vlan as fa0/24 native vlan setting)?
Considering tht frame frm fa0/24 are untagged. Can it still talk to others
in the same vlan i.e vlan 10? On the same switch only or all trunk
connected switches?

There some things that we do not know about the environment that you are suggesting and so we must make some assumptions. You have not identified whether these switches are layer 2 switches or whether they might be layer 3 switches. I am assuming that they are layer 2 and not layer 3 switches. You have not specified whether there is any device connected in the network providing routing between subnets. I am assuming that there is not any layer 3 routing being performed. Some PCs have ethernet cards that understand trunking and can process ethernet frames with vlan tags but most PC ethernet cards do not process ethernet frames with vlan tags. I am assuming that these PC do not process vlan tags. Can you verify whether these assumptions are correct?

 

Based on those assumptions here is my explanation:

The PC connected on fa0/24 will be sending ethernet frames with no vlan tag. So the switch will treat the PC as a member of vlan 10. Frames from the PC in vlan 10 can be forwarded to other devices in vlan 10, including being sent to other switches that participate in vlan 10. If there are PCs connected on other switches in vlan 10 then this PC and those PCs in vlan 10 should be able to communicate (and this is based on another assumption which is that all devices that belong to vlan 10 are configured with IP addresses in the same IP subnet).

 

Perhaps another way to think about this starts from the understanding that an arp request is sent out as a broadcast frame. So if this PC sends an arp request in vlan 10 then the switch will forward the arp request throughout vlan 10. If there are other switches connected to this switch on vlan 10 then the arp request is forwarded to those switches, and to all devices connected on those switches in vlan 10. So any 2 PCs connected in vlan 10 on separate switches should be able to communicate. 

 

But devices connected in vlan 10 will not be able to communicate with devices in vlan 5 unless there is some device providing layer 3 routing.

 

HTH

 

Rick

HTH

Rick

I am glad that our suggestions have been helpful and that you now have a better understanding of trunking, and of vlans. Thank you for marking this question as solved. This will help other participants in the community to identify discussions that have helpful information. I hope to see you continue to be active in the community.

 

HTH

 

Rick

HTH

Rick

Adnan2ali
Level 1
Level 1

Is there away Office-PC can ping other PCs, the switch is layer 2?

Adnan2ali_0-1676515594596.png

 

I am surprised that you adopted this old discussion to ask your question and suggest that starting a new discussion would have been better. But you asked and here is my response: we do not have enough detail information about this environment to give good advice. In particular we do not know whether OfficePC interface understands trunking and we do not know on the switch trunk port which vlan is the native vlan.

If we assume that OfficePC is a standard ethernet that does not understand trunking  then any ethernet frame with a vlan tag it will not understand or respond to and any frame in the native vlan (which does not have a vlan tag) it will respond to. And if we assume that the switch config uses the default native vlan of 1 then OfficePC will not ping any pc.

HTH

Rick

Adnan2ali
Level 1
Level 1

question:

VLAN was added to interfaces that part of port-channel group. The link went down. and no changes were saved.

powered the switch and the links are still down. what that configs sticks to the startup configs without save it 

Thanks.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco