HW First Journey difficult: vlan learning

vlan Profile

Isolating collision domains switcher, three switches or routers broadcast domain
vlan (Virtual LAN) to a plurality of physical lan into broadcast domains logically, within the vlan host can communicate directly between vlan not directly communicate. vlan available id 1 to 4094
Access interface is an interface connected to the switch to the host
to close: Used without vlan label, a vlan tag (pvid coincides with)
Hair: belt vlan tag, checks pvid if identical, then sent to the host, inconsistent discards

vlan basic configuration and access interfaces

Creating vlan

单个vlan:创建vlan10
vlan 10
多个vlan:创建vlan10和20
vlan batch 10 20

View vlan information

查看vlan相关信息:display vlan
查看vlan简要信息:display vlan summary
查看vlan和接口配置情况:display port vlan

Configuring access interfaces

进入连接主机的端口使用命令 port link-type access

Add the interfaces vlan

进入端口使用命令 port default vlan “vlanid”

trunk interfaces

Routers and switches, between a switch and switch interconnected links need to be configured to a trunk link (trunk link), the trunk link can carry all the data vlan, you may be configured to transfer only specified data vlan

Configuration

进入端口使用命令port link-type trunk
Port trunk allow-pass vlan all
    all:允许所有vlan通过
    vlan id :只允许配置的vlan通过,未配置的丢弃

A hybrid interface

A hybrid interface can either access link common terminal or a trunk link between the switch
closed:
receive a floor frame, determines whether there is a VLAN tag. No label indicia on the PVID Hybrid interface, for further processing; label, determining whether the frame of the Hybrid VLAN interface is allowed to enter, allowing the process to the next step, or discarded.
Issued:
when the data frame is sent from the Hybrid interface VLAN in the switch determines the properties of this interface is Untagged or Tagged. If the Untagged, VLAN tag to release the frame, and then transmitted; if it is Tagged, the transmission frame directly.

Configuration hybrid Interface

进入端口使用命令port link-type hybrid
配置该接口转发vlan 20的帧时,剥离相应的vlan tag 20,以Untagged的方式发送给pc
port hybrid untagged vlan 20
配置hybrid类型接口的默认vlan id,即使得该端口上接收到pc发来的未带vlan tag的帧时,加上vlan tag 20,并转发到vlan 20。
port hybrid pvid vlan 20 
配置交换机之间的接口时,设置仅接收或转发vlan 10和vlan 20的帧
port hybrid tagged vlan 10 20

Single-arm routing

Routing is achieved by a single arm configuration interface between the sub-Layer vlan communication; vlan physically by a plurality of links to a three-layer device; in the configuration, the gateway for each sub-interface configuration, and package vlan, opener interfaces arp broadcast

Examples

HW First Journey difficult: vlan learning
Switch S2 configured as follows:

vlan batch 10 20 30
interface Ethernet0/0/1
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 20
#
interface Ethernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20 30

Switch S3 is configured as follows:

vlan batch 10 20 30
interface Ethernet0/0/1
 port link-type access
 port default vlan 30
#
interface Ethernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20 30

Switch S1 is configured as follows:

vlan batch 10 20 30
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10 20 30
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 10 20 30
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20 30

R1 router configuration is as follows:

interface Ethernet0/0/0.1
 dot1q termination vid 10
 ip address 192.168.1.254 255.255.255.0
 arp broadcast enable
#
interface Ethernet0/0/0.2
 dot1q termination vid 20
 ip address 192.168.2.254 255.255.255.0
 arp broadcast enable
#
interface Ethernet0/0/0.3
 dot1q termination vid 30
 ip address 192.168.3.254 255.255.255.0
 arp broadcast enable

Three switches achieve inter-vlan routing

Layer three switches on the basis of the increase routing function, by forwarding routing vlanif interface, vlanif interface is based on the network layer of the interface can be configured ip.

Example:

HW First Journey difficult: vlan learning
Pc1:192.168.1.1 24 192.168.1.254
Pc2:192.168.1.2 24 192.168.1.254
Pc3:192.168.2.1 24 192.168.2.254

S1 Configuration:

sysname s1
#
vlan batch 10 20
#
interface Vlanif10
 ip address 192.168.1.254 255.255.255.0
#
interface Vlanif20
 ip address 192.168.2.254 255.255.255.0
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 20

Reference article: Huawei Technologies Laboratory Manual network technology certification HCNA

Guess you like

Origin blog.51cto.com/jiayimeng/2446653