VLAN间路由:在不同VLAN之间进行路由通信的过程。
链路聚合:两个交换机将配置为将多个端口视为单个主干,提供增加的总带宽以及冗余。
虚拟软件:eNSP(LSW2 LSW3 :S5700)
物理机:Win11
PC1和PC2配置IP地址/子网掩码/网关。
LSW2
[LSW2]vlan batch 2 3
[LSW2]interface g 0/0/1
[LSW2-GigabitEthernet0/0/1]port link-type access
[LSW2-GigabitEthernet0/0/1]port default vlan 2
[LSW2-GigabitEthernet0/0/1]interface vlanif 2
[LSW2-Vlanif2]ip address 192.168.2.254 24
[LSW2-Vlanif2]interface g 0/0/2
[LSW2-GigabitEthernet0/0/2]port link-type trunk
[LSW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 3
[LSW2-GigabitEthernet0/0/2]interface g 0/0/3
[LSW2-GigabitEthernet0/0/3]port link-type trunk
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[LSW2-GigabitEthernet0/0/3]interface g 0/0/4
[LSW2-GigabitEthernet0/0/4]port link-type trunk
[LSW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3
[LSW2-GigabitEthernet0/0/4]interface vlanif 1
[LSW2-Vlanif1]ip address 192.168.1.2 24
[LSW2-Vlanif2]quit
[LSW2]ospf
[LSW2-ospf-1]area 1
[LSW2-ospf-area-0.0.0.1]network 192.168.1.0 0.0.0.255
[LSW2-ospf-area-0.0.0.1]network 192.168.2.0 0.0.0.255
LSW3
[LSW3]vlan batch 2 3
[LSW3]interface g 0/0/1
[LSW3-GigabitEthernet0/0/1]port link-type access
[LSW3-GigabitEthernet0/0/1]port default vlan 3
[LSW3-GigabitEthernet0/0/1]interface vlanif 3
[LSW3-Vlanif3]ip address 192.168.3.254 24
[LSW3-Vlanif3]interface g 0/0/2
[LSW3-GigabitEthernet0/0/2]port link-type trunk
[LSW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 3
[LSW3-GigabitEthernet0/0/2]interface g 0/0/3
[LSW3-GigabitEthernet0/0/3]port link-type trunk
[LSW3-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[LSW3-GigabitEthernet0/0/3]interface g 0/0/4
[LSW3-GigabitEthernet0/0/4]port link-type trunk
[LSW3-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3
[LSW3-GigabitEthernet0/0/4]interface vlanif 1
[LSW3-Vlanif1]ip address 192.168.1.3 24
[LSW3-Vlanif2]quit
[LSW3]ospf
[LSW3-ospf-1]area 1
[LSW3-ospf-area-0.0.0.1]network 192.168.1.0 0.0.0.255
[LSW3-ospf-area-0.0.0.1]network 192.168.3.0 0.0.0.255
PC1pingPC2测试
LSW2
[LSW2]interface eth-trunk 1
[LSW2-Eth-Trunk1]port link-type trunk
[LSW2-Eth-Trunk1]port trunk allow-pass vlan 2 3
[LSW2-Eth-Trunk1]interface g 0/0/2
[LSW2-GigabitEthernet0/0/2]undo port trunk allow-pass vlan 2 3
[LSW2-GigabitEthernet0/0/2]undo port link-type
[LSW2-GigabitEthernet0/0/2]Eth-Trunk 1
[LSW2-GigabitEthernet0/0/2]interface g 0/0/3
[LSW2-GigabitEthernet0/0/3]undo port trunk allow-pass vlan 2 3
[LSW2-GigabitEthernet0/0/3]undo port link-type
[LSW2-GigabitEthernet0/0/3]Eth-Trunk 1
[LSW2-GigabitEthernet0/0/3]interface g 0/0/4
[LSW2-GigabitEthernet0/0/4]undo port trunk allow-pass vlan 2 3
[LSW2-GigabitEthernet0/0/4]undo port link-type
[LSW2-GigabitEthernet0/0/4]Eth-Trunk 1
LSW3
[LSW3]interface eth-trunk 1
[LSW3-Eth-Trunk1]port link-type trunk
[LSW3-Eth-Trunk1]port trunk allow-pass vlan 2 3
[LSW3-Eth-Trunk1]interface g 0/0/2
[LSW3-GigabitEthernet0/0/2]undo port trunk allow-pass vlan 2 3
[LSW3-GigabitEthernet0/0/2]undo port link-type
[LSW3-GigabitEthernet0/0/2]Eth-Trunk 1
[LSW3-GigabitEthernet0/0/2]interface g 0/0/3
[LSW3-GigabitEthernet0/0/3]undo port trunk allow-pass vlan 2 3
[LSW3-GigabitEthernet0/0/3]undo port link-type
[LSW3-GigabitEthernet0/0/3]Eth-Trunk 1
[LSW3-GigabitEthernet0/0/3]interface g 0/0/4
[LSW3-GigabitEthernet0/0/4]undo port trunk allow-pass vlan 2 3
[LSW3-GigabitEthernet0/0/4]undo port link-type
[LSW3-GigabitEthernet0/0/4]Eth-Trunk 1
PC1pingPC2测试