当前位置:网站首页>Principle and configuration of VLAN
Principle and configuration of VLAN
2022-07-22 00:29:00 【linhaoyanglinhao】
VLAN Principle and configuration of
List of articles
1VLAN Overview and advantages of
1.1VLAN An introduction to the
VLAN(Virtual Local Area Network) Virtual LAN , It's a physical LAN( LAN ) A communication technology that logically divides multiple broadcast domains .Vlan Can communicate directly between the hosts in , and Vlan No direct communication between , Thus, the broadcast message is limited to one Vlan Inside .
There are two ways to split the broadcast domain :
① Physical segmentation : Divide the subnet , Different subnets cannot communicate with each other .
② Logical segmentation :VLAN Divide , Different VLAN Do not communicate with each other .
1.2vlan Purpose and advantages of
● Purpose : When the number of hosts is large , Can lead to serious conflict 、 The broadcast is rampant 、 The performance drops significantly and even causes problems such as network unavailability .
● advantage : Control broadcast 、 Enhance network security 、 Simplify network management .
1.3vlan The type of
static state vlan
Static partition based on ports VLAN
dynamic vlan
be based on MAC Address partition dynamic VLAN
1.4vlan The label of
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-f0RL6bpE-1655368424316)(https://linhaoyang.oss-cn-shanghai.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20220616135723.png)]
Explanation of each field
●TPID:2 byte (Tag Prototcol Identifier: Tag protocol identifier ) Indicates the data frame type .
●Priority:3 position , Represents the of the data frame 802.1Q priority .
●CFI:1 position ,(Canonical Format Indicator: The standard format indicates ) Express MAC Whether the address is packaged in standard format in different transmission media , Compatible with Ethernet and token ring networks .
●VID:12 position ,VLAN ID , Indicates that the data frame belongs to VLAN The number of .
2; Link type and interface type
2.1 Link type
According to the data to be carried in the link VLAN Difference in number , Ethernet links are divided into :
● Access link
The access link refers to that it can carry one VLAN Data frame of , Used to connect devices and user terminals , Usually , The user terminal does not need to know which one it belongs to VLAN, Also can't identify with Tag Frame of , So the frames transmitted on the access chain are Untagged frame .
● Main road links
Trunk links can carry multiple different services VLAN Data frame of , Used for interconnection between devices . In order to ensure that other network devices can correctly identify the data frame VLAN Information , All data frames transmitted on the trunk link must be marked with Tag.
2.2 Interface type
●Access Interface
Access mode , An interface commonly used to connect a computer or router . effect : When data is exchanged , In the play vlan label , When leaving the switch , Take off vlan label .
●trunk Interface
Relay link , It is generally used to connect switches and between switches , effect : It can allow multiple VLAN Frame band Tag adopt , But it means to allow one VLAN When the frame of is sent from this kind of interface, it does not take Tag.
●Hybrid Interface
Huawei private agreement , The default interface type on the Huawei switch interface , Can accept and send multiple vlan message , Allow multiple vlan adopt , You can connect to a switch or a computer 、
3 default vlan
● default VLAN also called PVID(port default vlan id). Mentioned earlier , All data frames processed by the device are provided with Tag, When the device receives Untagged When the frame , You need to add... To the frame Tag, What to add Tag, By default on the interface Vlan decision .
● When the interface sends and receives data frames , about Tag Process of adding or stripping .
● about Access Interface , default VLAN That's what it allows VLAN, Modify default VLAN You can change the allowed interface VLAN.
● about Trunk Interface and Hybrid Interface , One interface can allow multiple VLAN adopt , But there can only be one default VLAN. Interface default VLAN And allowed VLAN It needs to be configured separately , They don't influence each other .
4vlan To configure
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-ANO5ZTqf-1655368424317)(https://linhaoyang.oss-cn-shanghai.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20220616141747.png)]
Pictured above is an example pc1 and pc3 and pc5 Need to be in vlan 10 in ,pc2 and pc4 To be in vlan 20 in . through vlan They should be able to communicate with each other , And pc6 For different network segments , Router forwarding is required .
●SW1 In the switch e0/0/1 To e0/0/3 Interface for access type ,e0/0/4 The type is trunk type
●SW2 In the switch e0/0/1 and e0/0/2 Interface for access type ,e0/0/3 The type is trunk type
Switch SW1 To configure
sys
system-view ### Enter system mode
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW1 ### Change the name to SW1
[SW1]undo info-center enable ### Cancel the message prompt Center
Info: Information center is disabled.
[SW1]vlan batch 10 20 ### Batch creation vlan
Info: This operation may take a few seconds. Please wait for a moment…done.
[SW1]dis vlan ### see vlan Information
[SW1]int e0/0/1 ### Access interface e0/0/1
[SW1-Ethernet0/0/1]port link-type access ### Set the interface type to access type
[SW1-Ethernet0/0/1]port default vlan 10 ### Set up pvid by vlan 10
[SW1-Ethernet0/0/1]undo shutdown ### Start interface
Info: Interface Ethernet0/0/1 is not shutdown.[SW1-Ethernet0/0/1]int e0/0/2 ### Access interface e0/0/2
[SW1-Ethernet0/0/2]port link-type access ### Set the interface type to access type
[SW1-Ethernet0/0/2]port default vlan 20 ### Set up pvid by vlan20
[SW1-Ethernet0/0/2]undo shutdown ### Start interface
Info: Interface Ethernet0/0/2 is not shutdown.[SW1-Ethernet0/0/2]int e0/0/3 ### Access interface e0/0/3
[SW1-Ethernet0/0/3]port link-type access ### Set the interface type to access type
[SW1-Ethernet0/0/3]port default vlan 10 ### Set up pvid by vlan 10
[SW1-Ethernet0/0/3]undo shutdown ### Start interface
Info: Interface Ethernet0/0/3 is not shutdown.
[SW1-Ethernet0/0/3]int e0/0/4 ### Access interface e0/0/4
[SW1-Ethernet0/0/4]port link-type trunk ### Set the interface type to trunk type
[SW1-Ethernet0/0/4]port trunk allow-pass vlan 10 20 ### Set allow through vlan by 10 and 20
[SW1-Ethernet0/0/4]undo shutdown ### Start interface
Info: Interface Ethernet0/0/4 is not shutdown.[SW1-Ethernet0/0/4]int e0/0/5 ### Access interface e0/0/5
[SW1-Ethernet0/0/5]port link-type access ### Set the interface type to access type
[SW1-Ethernet0/0/5]port default vlan 20 ### Set up pvid by vlan 20
[SW1-Ethernet0/0/5]undo shutdown ### Start interface
Info: Interface Ethernet0/0/5 is not shutdown.
SW2 Configuration and SW1 Basically the same , Router AR1 Set the interfaces on both sides IP Address
5 summary
1 Introduce vlan Principles and advantages , as well as vlan The type of
2 It introduces vlan Link and interface types
3 It introduces vlan Configuration of
Ethernet0/0/5 is not shutdown.
SW2 Configuration and SW1 Basically the same , Router AR1 Set the interfaces on both sides IP Address
5 summary
1 Introduce vlan Principles and advantages , as well as vlan The type of
2 It introduces vlan Link and interface types
3 It introduces vlan Configuration of
边栏推荐
猜你喜欢
Exness: the US index fell for three consecutive days, and the euro rebounded to digest the expectation of interest rate hike
Reverse proxy haproxy
2022 latest Ningxia construction eight members (Electrical constructors) simulation question bank and answers
OSPF序列号
DHCP service and configuration
Steps and precautions for building ha for 5 machines
部署LVS-NAT集群
How important is the instant debit system to B2B e-commerce business?
Federated learning: spatiotemporal data mining in federated scenarios
Zabbx6.0(生产实战)
随机推荐
解决:2003-Cant connect to MySQL server on **** 以及use near ‘IDENTIFIED BY ‘*****‘ WITH GRANT OPTION‘ at
Intranet detection 2-powershell collects domain information & sensitive data / data / information collection and sorting
A DC motor locking program based on ATmega128
重发布中的路由策略
Pour ajouter une dépendance à Idea:
Go语言之return语句深入理解及defer、return的执行顺序
table表格
N皇后
Solr deployment and IK Chinese word segmentation cases
AcWing 94. 递归实现排列型枚举
汉诺塔
反向代理HAproxy
Idea添加依赖的步骤:
DNS域名解析
uniapp访问的路径去掉 # ,访问出现404
OSPF的优化和配置
form表单标签
5台机器搭建HA步骤与注意事项
How important is the instant debit system to B2B e-commerce business?
Federated learning: spatiotemporal data mining in federated scenarios