Cross-network access between L2 Switches

Source: Internet
Author: User

L2 Switch inter-CIDR block access 1: network topology pc1 -- L2 Switch -- pc2 II: tutorial objective PC1 can ping the ip address of PC2 PC1: 192.168.0.1/24 PC1 Gateway: 192.168.1.1 PC2 ip: 192.168.1.1/24 PC2 Gateway: 192.168.0.1 www.2cto.com 3: Principle 1. first, we need to know the principle of switching. Vswitch forwarding relies on a table forwarding table, that is, a MAC table. The exchange method is to find the MAC address in the MAC table when calling a target MAC address from an interface, find the interface corresponding to the target MAC address, and then send the frame. (For details, refer to CCNA and CCNP books ). 2. After the above principle, PC1 can communicate with pc2. Because the switch already knows how to change from MAC of PC1 to MAC of pc2. 3. Next, we need to solve the problem so that the switch and the PC can know each other's MAC address. Speaking of this, we may think of ARP. But when will ARP be sent? Why are the gateways of two PCs in my topology not the ip addresses of the PCs in this segment? The reason for www.2cto.com is that ARP only works for IP addresses in the current CIDR block. When a PC wants to access another PC, it will first calculate its own IP address and the IP address used to access the destination PC to see if it belongs to this network segment, if yes, it will send an ARP request to obtain the MAC address of the other party. If the IP address is not in this segment, the PC will directly send the access package to the gateway for routing. But now we want to implement ARP requests for different IP network segments. Therefore, the gateway of each PC here is the IP address of the other party, because the PC host must use the gateway to implement the route. How can I obtain the gateway? The way the PC gets the gateway is implemented by ARP, And the gateway of each PC is different CIDR blocks, so ARP requests for different CIDR blocks are implemented. However, the switch still forwards this ARP request. In this way, the two PCs can obtain the MAC addresses of each other. After obtaining the MAC address of the target user, the user can communicate normally. 4: the defect is that if the switch divides VLAN, ARP requests will no longer be used. Because VLAN is isolated from broadcast, ARP cannot be implemented across network segments.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.