VLAN(Virtual Local Area Network)即虚拟局域网,是将一个物理的局域网在逻辑上划分成多个广播域的技术。
Access接口(一般用于PC机与交换机相连)
Trunk接口(一般用于交换机与交换机相连)
Hybrid接口(一般用于交换机与服务器相连)
PC机和服务器根据拓扑图配置对应IP。
LSW1
[LSW1]vlan batch 10 100 200
LSW2
[LSW2]vlan batch 10 100 200
LSW1
[LSW1]interface g 0/0/2
[LSW1-GigabitEthernet0/0/2]port link-type access
[LSW1-GigabitEthernet0/0/2]port default vlan 100
[LSW1-GigabitEthernet0/0/2]interface g 0/0/3
[LSW1-GigabitEthernet0/0/3]port link-type access
[LSW1-GigabitEthernet0/0/3]port default vlan 200
[LSW1-GigabitEthernet0/0/3]interface g 0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type trunk
[LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 100 200
LSW2
[LSW2]interface g 0/0/1
[LSW2-GigabitEthernet0/0/1]port link-type trunk
[LSW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 100 200
[LSW2-GigabitEthernet0/0/1]interface g 0/0/2
[LSW2-GigabitEthernet0/0/2]port link-type access
[LSW2-GigabitEthernet0/0/2]port default vlan 200
[LSW2-GigabitEthernet0/0/2]interface g 0/0/3
[LSW2-GigabitEthernet0/0/3]port link-type access
[LSW2-GigabitEthernet0/0/3]port default vlan 100
第四问
LSW1
[LSW1]interface g 0/0/2
[LSW1-GigabitEthernet0/0/2]undo port default vlan
[LSW1-GigabitEthernet0/0/2]port link-type hybird
[LSW1-GigabitEthernet0/0/2]port hybird pvid vlan 100
[LSW1-GigabitEthernet0/0/2]port hybird untagged vlan 100 10
[LSW1-GigabitEthernet0/0/2]interface g 0/0/3
[LSW1-GigabitEthernet0/0/3]undo port default vlan
[LSW1-GigabitEthernet0/0/3]port link-type hybird
[LSW1-GigabitEthernet0/0/3]port hybird pvid vlan 200
[LSW1-GigabitEthernet0/0/3]port hybird untagged vlan 200 10
LSW2
[LSW2]interface g 0/0/2
[LSW2-GigabitEthernet0/0/2]undo port default vlan
[LSW2-GigabitEthernet0/0/2]port link-type hybird
[LSW2-GigabitEthernet0/0/2]port hybird pvid vlan 200
[LSW2-GigabitEthernet0/0/2]port hybird untagged vlan 200 10
[LSW2-GigabitEthernet0/0/2]interface g 0/0/3
[LSW2-GigabitEthernet0/0/3]undo port default vlan
[LSW2-GigabitEthernet0/0/3]port link-type hybird
[LSW2-GigabitEthernet0/0/3]port hybird pvid vlan 100
[LSW2-GigabitEthernet0/0/3]port hybird untagged vlan 100 10
[LSW2-GigabitEthernet0/0/3]interface g 0/0/10
[LSW2-GigabitEthernet0/0/10]port hybrid pvid vlan 10
[LSW2-GigabitEthernet0/0/10]port hybrid untagged vlan 10 100 200
小玖09(2022).5分钟看懂access、trunk和hybrid三种链路类型.BillBill.检索于2024年1月5号