06-16-2016 01:34 AM - edited 03-08-2019 06:14 AM
Assume that there are two switches A & B that are connected via a trunk. Switch A has a PC in vlan 10 with IP address 10.0.0.1/24 and Switch B has a PC with IP address 10.0.0.2/24 in Vlan 20. Will the two hosts ping? If not, what is the configuration changes needed to make them ping and all vlans are allowed on the trunk interface. I have tried this is in packet tracer and nothing seems to work for me. Please help me on this.
06-16-2016 02:24 AM
Hi,
if you are using layer 2 devices (layer 2 switches) with VLANs, then you cannot do inter VLAN communication between hosts. trunk port will just pass the allowed VLANs through trunk link. this can setup when configuring trunk mode in switchport and setting allowed VLANs using below command. by default some switches are enabled all VLANs through trunk.
#switchport trunk allowed vlan
according to your scenario below steps you can use to enable communication between two computers.
1. put both computers in same VLAN
2. use layer 3 device (router or layer 3 switch) to do the inter vlan routing. in this case you cannot have same network ip range between two hosts.
Regards,
Kasun
06-16-2016 04:22 AM
Thanks for the reply. I had this question in one of the interviews. The interviewer said to configure switchport trunk native vlan 10 on Switch A and then switchport trunk native vlan 20 on Switch B.
I tried what he suggested but I got 'Native vlan mismatch' error messages on the console.
06-16-2016 04:25 AM
yes. if you done that so, console messages will be there with that error. thats not best practise.
06-16-2016 04:27 AM
I wasn't able to ping the hosts in Packet tracer. Is it possible to ping the hosts when we use real switches and clients?
06-16-2016 04:35 AM
can you upload file here?
06-16-2016 05:17 AM
06-16-2016 05:20 AM
Hi there,
as i explained you cannot do inter vlan communication using only layer 2 devices. you need a layer 3 device like a router to do inter vlan communication.
06-16-2016 08:14 PM
From the IP address, the 2 PC's are in the same subnet.
Effectively, as the interviewer said, by using the "native vlan" command and effectively faking the the trunk to link the 2 vlans together. With a common subnet addressing and native vlan passing frames untagged, the 2 PC's SHOULD be able to talk.
Oh, and with CDP enabled, the switches will complain.
06-16-2016 08:25 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages wha2tsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
It depends on whether hosts have a GW defined.
If you intermingle two different subnets on the same broadcast domain, if the hosts have a GW IP, they will direct any traffic, not on their network, to that IP. If they don't have a GW, they will ARP for IPs both on and off their network.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide