Detailed configuration steps of a Layer 3 switch

1: Layer 3 switching concept

Layer 3 switching means using layer 3 switching technology to realize communication between VLANs, layer 3 switching = layer 2 switching + layer 3 forwarding

A layer-3 switch is a switch with partial router functions, working at the third layer of the OSI network standard model: the network layer. The most important purpose of the three-layer switch is to speed up the data exchange within the large local area network. The routing function it has is also for this purpose, and it can achieve one routing and multiple forwarding.

Layer 3 switching
When a layer 3 device receives a data frame, it will tear down the original data frame, repackage the new source MAC address and destination MAC address, and because the information in the frame header changes, the final frame check CRC should also follow change.
Of the multiple data packets in this flow, only the first data packet is processed by the Layer 3 engine of the Layer 3 switch. The processing method is the same as the router, and the Layer 3 engine obtains the new Layer 2 Route the packet after encapsulating the information.
After the first packet is forwarded, an MLS entry is created in hardware for subsequent packet re-encapsulation and fast forwarding performed by the hardware. Layer 2 data frames will be re-encapsulated into the frame format of the next network segment that needs to be forwarded. This is the principle of "one route, many exchanges" of MLS.
The key to the MLS based on CEF (a model based on topology forwarding) is two forwarding information tables, and the forwarding information base (FIB) corresponds to the routing table one by one, which is a mirror image of the routing table. When the routing table is updated, the FIB changes accordingly, and the FIB includes the correspondence between the IP addresses of adjacent hosts and VLAN IDs. The adjacency table contains the correspondence between the adjacent hosts and the MAC addresses of the switches to provide Layer 2 rewriting information. CEF-based MLS forwarding process, that is, sending unicast data
packets, re-encapsulating data frames by looking up FIB and adjacency table, and forwarding from the corresponding port7

Two: Layer 3 switching virtual interface

Layer 3 switches have routing functions, so two VLANs can communicate with each other, and each VLAN virtual interface is the gateway of the network segment.

Four: Experiment

A switch is connected to 3 hosts, and above the switch is a Layer 3 switch. How to realize communication?

Experimental steps:

One: Configure IP addresses, subnet masks and gateway addresses for the four hosts

Two: switch configuration

1: Create vlan10 on the switch 20 30 

2: Set interfaces 2 3 4 as access links and add them to the corresponding VLANs

3 Set interface 1 as a trunk link and set a whitelist

The command is as follows

[LSW2]vlan batch 10 20 30 //Create VLAN
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]int e 0/0/2 //Enter interface
[LSW2-Ethernet0 /0/2]port link-type access //Set link type
[LSW2-Ethernet0/0/2]port default vlan 10 //Add vlan10
[LSW2-Ethernet0/0/2]int e 0/0/3        
[ LSW2-Ethernet0/0/3]port link-type access
[LSW2-Ethernet0/0/3]port default vlan 20
[LSW2-Ethernet0/0/3]int e0/0/4
[LSW2-Ethernet0/0/4] port link-type access
[LSW2-Ethernet0/0/4]port default vlan 30
[LSW2-Ethernet0/0/4]int e 0/0/1 //Enter e0/0/1 interface
[LSW2-Ethernet0/0/ 1]port link-type trunk //Set as a trunk link
[LSW2-Ethernet0/0/1]port trunk allow-pass vlan all //Set whitelist, allow all VLANs to pass

Three: Layer 3 switch settings

1: The incoming interface is set as a trunk link, and the whitelist is set

2: Create a VLAN, and enter the virtual interface to configure the address of the corresponding gateway

3: Experimental verification

1 Enter the interface as a trunk link and set a whitelist

[Huawei]int g 0/0/1 //Enter interface
[Huawei-GigabitEthernet0/0/1]port link-type trunk //Set as a trunk link
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all //Set whitelist
[Huawei-GigabitEthernet0/0/1]

2Create a VLAN, and enter the virtual interface to configure the address of the corresponding gateway

[LSW2]vlan batch 10 20 30 //Create VLAN

[Huawei]int vlanif 10
[Huawei-Vlanif10]ip address 192.168.1.254 24
[Huawei-Vlanif10]int vlanif 20
[Huawei-Vlanif20]ip address 192.168.2.254 24
[Huawei-Vlanif20]int vlanif 30
[Huawei-Vlanif30]ip address 192.168.3.254 24
[Huawei-Vlanif30]

3 experimental verification

Thinking question: How to communicate with the right side?

One: Layer 3 switch settings

[Huawei]vlan batch 100 //Newly set vlan100 on the Layer 3 switch
[Huawei]int g0/0/2    
[Huawei-GigabitEthernet0/0/2]port link-type access //Set to access connection
[Huawei-GigabitEthernet0/0/ 2]port default vlan 100 //Add the interface to vlan100
[Huawei-GigabitEthernet0/0/2]int vlanif 100 //Enter the virtual interface
[Huawei-Vlanif100]ip address 192.168.4.1 24
[Huawei-Vlanif100]quit
[Huawei]ip route-static 192.168.5.254 24 192.168.4.2 //Set static route

Two: Router Settings##Set the gateway address for the interfaces at both ends of the router
[Huawei]int g 0/0/0                     
[Huawei-GigabitEthernet0/0/0]ip address 192.168.4.2 24
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.5.254 24
[Huawei-GigabitEthernet0/0/1]quit
##Set static routing for the router
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.4.1
 

 

 

Guess you like

Origin blog.csdn.net/zl965230/article/details/128980057