-
配置各接口所属VLAN [LSW1]vlan batch 10 20 30 [LSW1-GigabitEthernet0/0/1]port link-type access [LSW1-GigabitEthernet0/0/1]port default vlan 10 [LSW1-GigabitEthernet0/0/2]port link-type trunk [LSW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 [LSW1-GigabitEthernet0/0/3]port link-type trunk [LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 30 [LSW2]vlan batch 10 20 [LSW2-GigabitEthernet0/0/2]port link-type access [LSW2-GigabitEthernet0/0/2]port default vlan 20 [LSW2-GigabitEthernet0/0/1]port link-type trunk [LSW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 [LSW3]vlan batch 10 30 [LSW3-GigabitEthernet0/0/3]port link-type access [LSW3-GigabitEthernet0/0/3]port default vlan 30 [LSW3-GigabitEthernet0/0/1]port link-type trunk [LSW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 30 -
配置各VLANIF接口的IP地址 [LSW1-Vlanif10]ip add 10.1.1.1 24 [LSW1-Vlanif20]ip add 10.1.2.1 24 [LSW1-Vlanif30]ip add 10.1.3.1 24 [LSW2-Vlanif10]ip add 10.1.1.2 24 [LSW2-Vlanif20]ip add 10.1.2.2 24 [LSW3-Vlanif10]ip add 10.1.1.3 24 [LSW3-Vlanif30]ip add 10.1.3.3 24 -
配置PC -
配置静态路由 [LSW1]ip route-static 10.1.3.0 24 10.1.1.3 [LSW1]ip route-static 10.1.2.0 24 10.1.1.2 [LSW2]ip route-static 0.0.0.0 0.0.0.0 10.1.2.1 [LSW3]ip route-static 0.0.0.0 0.0.0.0 10.1.3.1 -
验证配置
|