Single-arm routing realizes communication between different VLANs

Source: Internet
Author: User

The experimental topology is as follows:

First, understand the principle of single arm routing

1. LINK Type

The connection between the PC and the switch is the access layer, so the access link is used, but VLAN10 and VLAN20 need to communicate and all need to go through the router, so the link between the switch and the router is trunk.

2, the router's sub-interface

The physical interface of a router can be divided into multiple logical interfaces, which are known as sub-interfaces, which cannot be individually turned on or off, and all sub-interfaces are turned on or off when the physical interface is turned on or off.

3, the VLAN label conversion

In addition to encapsulating the MAC address of the data, the router will need to convert the label of the VLAN during the process of forwarding data. When PC1 sends a data frame to the gateway router, the label of the data frame belongs to the VLAN10, and when the data is forwarded from the router, the VLAN's label is converted to VLAN20.

Two, the single arm routing configuration process

1, the router to create a sub-interface, and configure the VLAN tag packaging structure

R1 (config) #int f0/0.1

R1 (config-subif) #encapsulaton dot1q 10

R1 (config-subif) #ip add 192.168.1.1 255.255.255.0

R1 (config-subif) #exit

R1 (config) #int f0/0.2

R1 (config-subif) #encapsulaton dot1q 20

R1 (config-subif) #ip add 192.168.2.1 255.255.255.0

R1 (config-subif) #exit

R1 (config) #int f0/0

R1 (config-if) #no sh

R1 (config-if) #exit

Note: The above "Encapsulaton dot1q 10" After 10 refers to VLAN 10,20 also refers to VLAN 20.

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.