Basic theory of single-arm routing and three-layer switching + full solution of experimental configuration (detailed)

Table of contents

1. Single-arm routing

1. Characteristics of single-arm routing:

2. Configuration features:

3. Disadvantages of single-arm routing:

4. Single-arm routing configuration:

5. Single-arm routing ENSP simulator experiment

6. Specific steps for single-arm routing:

7. Summary of single-arm routing

 Layer 2 and Layer 3 switching

1. Advantages of three-layer routing:

2. Three-layer switching data processing method:

3. Inter-vlan routing

4. Configuration sequence of virtual interface from creation to activation:

5. Layer 3 switching configuration

6. Three-layer switching ENSP simulator experiment

7. Detailed configuration process of Layer 3 switching

8. Summary of Layer 3 Routing


1. Single-arm routing

1. Characteristics of single-arm routing:

        1). The interface connecting the router and the switch. The switch interface must be Trunk
        2). The number of sub-interfaces of the router is determined by the number of VLANs
        3). The sub-interface creation method must be created one by one
        4). The status of the sub-interface Activation (whether enabled or not) depends on the state of the physical interface

2. Configuration features:


        1). The port connected to the switch must be trunk, and cannot be configured with the same PVID as the sub-interface.
        2). The physical interface where the sub-interface is located must be activated.

3. Disadvantages of single-arm routing:


        1). The network bottleneck is very obvious, limited by the speed of the physical interface
        2). There is a single point of failure
        3). The transmission efficiency is low

4. Single-arm routing configuration:


                1).Interface gigabitethernet0/0/1.1 //Create and enter the sub-interface
                2).Dotlq termination vlan 2 //dotlq (802.1q---→tagged data frame) termination (termination termination)------processing With data with vlan id 2, including removal label and assembly label
                3).IP add 1.1.1.1 24 //Configure the IP address to 1.1.1.1
                4).arp broadcast enable command is used to enable ARP broadcast of the termination sub-interface Function

5. Single-arm routing ENSP simulator experiment

6. Specific steps for single-arm routing:


1. First assign PC1 with IP address 192.168.1.1 subnet mask 255.255.255.0

2. Assign PC2 with IP address 192.168.2.1 and subnet mask 255.255.255.0

3. Assign VLAN to PC1 as vlan2, and assign VLAN to PC2 as vlan3
. 4. Enter the CLI configuration interface of switch LSW1.

输入Sy进入系统视图,sy LSW1 更改交换机名字,
输入vlan batch 2 3         //加入vlan 2 和vlan 3,
输入interface g0/0/3       //进入0/3接口配置VLAN,
输入 port link-type access //配置接口为access模式
输入 port default vlan 2   //配置默认的PVID为2
输入interface g0/0/2      //进入0/2接口配置VLAN,
输入 port link-type access //配置接口为access模式
输入 port default vlan 3   //配置默认的PVID为3
输入interface g0/0/1       //进入0/3接口配置VLAN
输入port link-type trunk   //配置接口为trunk模式
输入port trunk allow-pass vlan 2 to 3 //将vlan2和vlan3加入允许列表放行


5. Enter the CLI interface of router AR1

输入interface GigabitEthernet0/0/0.2 //给g0/0/0创建.2子接口
输入dot1q termination vid 2   //处理带由vlan id为2的数据,包含拆除标签和装配标签
输入ip address 192.168.1.254 255.255.255.0 //配置网关地址
输入 arp broadcast enable     //终结子接口的ARP广播功能
输入interface GigabitEthernet0/0/0.3  //给g0/0/0创建.3子接口
输入dot1q termination vid 3          //处理带由vlan id为3的数据,包含拆除标签和装配标签
输入 ip address 192.168.2.254 255.255.255.0 //配置网关地址
输入arp broadcast enable             //终结子接口的ARP广播功能



6. Enter the host PC1, ping the PC2 host IP, and the ping will be successful. 

7. Summary of single-arm routing

1. The dot1q termination vid vlan-id command has two functions:
The first function is to remove VLAN tags. After receiving the VLAN packet, the interface strips off the tag carried in the packet and then forwards it at Layer 3.
The second function is to add VLAN tags. When the interface sends a message, it adds the corresponding VLAN information to the message before sending it.
2. The interface must be configured as a Trunk port and data of the corresponding VLAN must be allowed to pass.

 Layer 2 and Layer 3 switching

1. Advantages of three-layer routing:

  1. All VLANs have an exclusive physical interface rate, making network bottlenecks less likely to occur.
  2. No single point of failure
  3. Simple configuration
  4. High transfer efficiency

2. Three-layer switching data processing method:

Pc1 ---sw---pc2

        PC1 initiates access to pc2 for the first time, and accesses across VLANs and network segments. The applied three-layer switching technology PC1 will first send an ARP broadcast, look for pc2, and obtain its mac address. Finally, the ARP is passed to the VLANIF interface, and the information is found for PC2, which only requests the IP address to view the routing table of SW, because PC2 is directly connected to SW, so there are automatically generated routing entries, and the gateway (VLANIF) of PC1 will respond instead of PC2. Use pc2's gateway to forward ARP requests. PC2 receives the request and responds. The switch MAC address table contains the corresponding relationship between the MAC addresses of PC1 and PC2 and the interfaces. After PC1 receives the response from PC2, it starts to request access.

3. Inter-vlan routing

        Configure the VLANIF interface on the Layer 3 switch to implement inter -VLAN routing. If there are multiple VLANs on the network , you need to configure a VLANIF interface for each VLAN and configure an IP address for each VLANIF interface . The default gateway set by the user is the IP address of the VLANIF interface in the Layer 3 switch .

4. Configuration sequence of virtual interface from creation to activation:

Vlan 10  //创建VLAN10

Interface g0/0/3 //进入物理接口g0/0/3

Port link-type trunk // 设置端口连接类型为trunk(单臂路由配置需求)

Port trunk all-pass vlan 10 //允许VLAN10的数据带标签通过接口

Interface vlanif 10 //创建并进入vlan 10 虚拟接口-------》三层功能接口-----》可以配置IP地址

Ip address 10.1.1.1 24 //配置IP地址10.1.1.1/24

5. Layer 3 switching configuration

1. Assign IP addresses and gateways to pc1 and PC2.
Set the gateway of PC to the vlanif interface ip of the vlan.

Pc1 belongs to vlan100 and the gateway is set to the IP of vlan100

Pc2 belongs to vlan200 and the gateway is set to the IP of vlan200
2. Create VLAN

Vlan batch 100 200 //Create vlan100 200 in batches

3. Set the physical port association
Interface g0/0/1 //Enter interface g0/0/1

Port link-type access //Set the interface mode to access

Port default vlan 100 //Set the default PVID to 100

Interface g0/0/2 //Enter interface g0/0/2

Port link-type access //Set the interface mode to access

Port default vlan 200 //Set the default PVID to 200

4. Set up vlanif interface

Interface vlanif 100 //Create virtual interface vlanif 100

IP address 192.168.1.100 24 //Configure IP to 192.168.1.100 24

Interface vlanif 200 //Create virtual interface vlanif 200

IP address 192.168.2.100 24 //Configure IP to 192.168.2.100 24

5. Set the gateway of the PC to the vlanif interface ip of the vlan

Pc1 belongs to vlan100 and the gateway is set to the IP of vlan100

Pc2 belongs to vlan200 and the gateway is set to the IP of vlan200

6. Three-layer switching ENSP simulator experiment

7. Detailed configuration process of Layer 3 switching

1. Assign IP addresses and gateways to pc1 and PC2
 


将Pc的网关设置为该vlan的vlanif接口ip
Pc1 属于vlan100 网关设置为vlan100的IP
Pc2 属于vlan200 网关设置为vlan200的IP

2. Configure in the switch

3.PC1 pings pc2 to see if the ping succeeds. After the ping succeeds, it is completed.

 

8. Summary of Layer 3 Routing

1. When configuring a logical interface, bind the corresponding physical interface

2. After the configuration is completed, you can use the dis cur command to check whether your configuration is incorrect.

Guess you like

Origin blog.csdn.net/qq_53312231/article/details/126497538