Computer network configuration-three-layer switching to achieve inter-VLAN routing

1. The purpose and tasks of the experiment

  1. Understand the concepts and principles of Layer 3 switching
  2. Master the configuration method of Layer 3 switches
  3. Familiar with and master the configuration and debugging of the three-layer exchange.

2. Introduction to the experimental principle

1. The configuration of the three-layer switch SVI

At present, there are many switches above Layer 3 in the market. In these switches, manufacturers integrate routing functions into the switches through hardware or software. The switch is mainly used in the campus network. The routing in the campus network is relatively simple, but the speed of data exchange is required. The forwarding rate is slow when the routing between VLANs is realized by single-arm routing, so it is an indisputable fact to replace routers with switches in large campus networks. In fact, three-layer switching is often used inside the LAN. The three-layer switch is often implemented by hardware, and its routing data packet rate is dozens of times that of ordinary routers.

The Layer 3 switch and each VLAN have a virtual interface to connect, called the switch virtual interface (SMT). The name of the SVI interface is the name of VL.AN, such as VLANI or VLAN2. Cisco switches used NetFlow Layer 3 switching technology in the early years, and now they mainly use Cisco Express Forwarding (CEF) switching solutions. In the CEF switching scheme, the routing table is mainly used to form a forwarding information base (FIB). FIB and routing table are synchronized, because FIB query is hardware-based, its query speed is very fast. In addition to FIB, there is also an adjacency table (Adjacency Table), which is similar to the ARP table and mainly stores the encapsulation information of the second layer. Both FIB and adjacency tables have been established before data forwarding. Once there is data to be forwarded, the switch can directly use them for data forwarding and encapsulation. There is no need to query the routing table and send ARP requests, so the routing coverage between VLANs Greatly improve.

2. Three-layer switching realizes the configuration of inter-VLAN communication

In the Cisco simulator, set the PCs of different VLANs to different network segments, set the IP addresses of vlan1 and vlan2 of the Cisco Layer 3 switch, and set the gateway of the PC to the IP address of the corresponding vlan.

  • Open routing command: ip routing
  • Create an SVI interface command associated with the specified VLAN: int vlan vlan-id
  • Configure command for SVI interface: ip addr ip-address mask
  • Configure the dynamic routing protocol command of the three-layer switch: route ip_routing_protocol <options>

3. Design code (or schematic diagram), simulation waveform and analysis

Three-layer switch inter-VLAN routing network topology:


Overall configuration of Layer 2 switch:


The overall configuration of the three-layer switch:


PC1pingPC2、PC3、PC4

 

PC2pingPC1、PC3、PC4

PC3pingPC1、PC2、PC4

PC4pingPC1、PC2、PC3

 

4. Experimental conclusions and experience

note:

将端口设为trunk模式命令为
switchport mode trunk   //端口模式为trunk
switchport trunk encapsulation dot1q               //trunk协议封装为dot1q
【三层交换机】
swi tr encap dot1q就是 IEEE 802.1q协议,是vlan的一种封装方式,是公有协议。
还有一种trunk协议,是ISL,也是vlan的一种封装方式,不过这是Cisco思科私有协议,其他厂商不能用。

封装,Package,是把集成电路装配为芯片最终产品的过程,简单地说,就是把Foundry生产出来的集成电路裸片放在一块起到承载作用的基板上,把管脚引出来,然后固定包装成为一个整体。
“封装”强调的是安放、固定、密封、引线的过程和动作;
“封装”主要关注封装的形式、类别,基底和外壳、引线的材料,强调其保护芯片、增强电热性能、方便整机装配的重要作用。
【二层交换机】 
2960-24TT(交换机)默认封装就是dot1q,不再支持cisco的私有封装ISL,因此2960系列交换机在配置trunk的时候不需要指定封装。

 

Guess you like

Origin blog.csdn.net/XZ_ROU/article/details/112985347