enter image description here

hello , i have a question ! how can i connect two pc in different vlan connection together.it must be refer to loopback test and virtual interface. and which techology can i solve this ploblem!THX

i have try set make pc1 port bind to vlan10 and pc2 port bind to vlan20 , and put them to sw1's interface g1/0/2 and sw2's interface g1/0/2.last make sw1's interface g1/0/1 and sw2's interface g1/0/1 connect use a netline and configure two interface to trunk mode.but havn't konw the answer.THX!

  • One of your switches must be l3 capable, it is not, you can not be able to ping from one pc located on "vlan x" , to another located on "vlan y" May 14, 2016 at 12:45
  • yes,both switch support L3,and how can i configure,THX
    – chen
    May 14, 2016 at 12:48
  • Can you put your model devices?? May 14, 2016 at 12:50
  • sorry ! in our country we use H3C device , can you give me an example device to solve this ploblem . THX
    – chen
    May 14, 2016 at 12:53
  • and my leader told me to use loopback to test and want me to refer to vlan-interface.are they useful to this ploblem?
    – chen
    May 14, 2016 at 12:58

2 Answers 2

  1. Get sw1 and sw2 and define 2 vlans, vlan10 and vlan20.

  2. Enable ip routing on your L3 switches.

  3. Create on one of they, eg, sw1 2 vlan interfaces and set on it, his respective ip address:

interface vlan 10 ip address x.x.10.x

interface vlan 20 ip address x.x.20.x

  1. On pc connected to vlan 10 access port, declare it gateway like x.x.10.x, and on pc on vlan20 port, x.x.20.x

  2. Declare link between sw1 and sw2 link trunk port.

With this, your vlan communication will work

  • thank you for your answer ! and i will test on workdays if have any other ploblems i will consult you!
    – chen
    May 14, 2016 at 13:23
  • No problem, i hope you can solve with this May 14, 2016 at 13:30

Typically you don't set VLAN id on the PC/endpoint. The VLAN is set by the network equipment (switch). You will need a router (sometimes also called a layer 3 switch) in order to route between the VLAN's.

There is something called inter-VLAN bridging where you essentially put both VLAN's in a configuration where each sees the others frames. In this case, the secondary-address would enable you to talk to the other VLAN, provided each VLAN had a corresponding IP subnet associated with it.

  • VLAN 10 and 20 are layer-2 isolated. It doesn't matter how many secondary address one adds to the vlan 10 layer-3 interface, nothing in vlan 20 will be able to talk to it.
    – Ricky
    May 14, 2016 at 21:47
  • VLAN10 does talk IP to VLAN20. The corresponding subnets would normally talk via their default gateway (the int VLAN). The secondary ip address is in case they are on a flat network with separated VLANs. Maybe I misunderstood the diagram. May 14, 2016 at 22:44
  • Only if there's a router in there, which there isn't -- or wasn't included in the diagram or question. (which, btw, is his entire question.)
    – Ricky
    May 14, 2016 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.