标签:通信 src shadow 互连 批量创建 3.1 roc ffffff run
<HUAWEI> system-view
[HUAWEI] sysname SW2 //修改设备的名称为SW2,便于识别
[SW2] vlan batch 2 3 //批量创建VLAN 2和VLAN 3
[SW2] interface gigabitethernet 1/0/23
[SW2-GigabitEthernet1/0/23] port link-type access //将与PC相连接口的接口类型设置为access
[SW2-GigabitEthernet1/0/23] port default vlan 2 //将PC1划分到VLAN 2
[SW2-GigabitEthernet1/0/23] quit
[SW2] interface gigabitethernet 1/0/24
[SW2-GigabitEthernet1/0/24] port link-type access
[SW2-GigabitEthernet1/0/24] port default vlan 3 //将PC2划分到VLAN 3
[SW2-GigabitEthernet1/0/24] quit
[SW2] interface gigabitethernet 1/0/1
[SW2-GigabitEthernet1/0/1] port link-type trunk //将与汇聚交换机相连接口的接口类型设置为trunk
[SW2-GigabitEthernet1/0/1] port trunk allow-pass vlan 2 3 //透传VLAN 2和VLAN 3到汇聚交换机SW1
[SW2-GigabitEthernet1/0/1] quit
配置汇聚交换机SW1
<HUAWEI> system-view
[HUAWEI] sysname SW1 //修改设备的名称为SW1
[SW1] vlan batch 2 to 5 //批量创建VLAN 2到VLAN 5
[SW1] interface gigabitethernet 1/0/2
[SW1-GigabitEthernet1/0/2] port link-type trunk //将与SW1相连接口的接口类型设置为trunk
[SW1-GigabitEthernet1/0/2] port trunk allow-pass vlan 2 3 //透传VLAN 2和VLAN 3
[SW1-GigabitEthernet1/0/2] quit
[SW1] interface gigabitethernet 1/0/3
[SW1-GigabitEthernet1/0/3] port link-type access //将与PC3相连接口的接口类型设置为access
[SW1-GigabitEthernet1/0/3] port default vlan 4 //将PC3划分到VLAN 4
[SW1-GigabitEthernet1/0/3] quit
[SW1] interface vlanif 2 //创建VLANIF2接口
[SW1-Vlanif2] ip address 192.168.2.1 24 //配置IP地址,此IP地址是PC1的网关地址
[SW1-Vlanif2] quit
[SW1] interface vlanif 3 //创建VLANIF3接口
[SW1-Vlanif3] ip address 192.168.3.1 24 //配置IP地址,此IP地址是PC2的网关地址
[SW1-Vlanif3] quit
[SW1] interface vlanif 4 //创建VLANIF4接口
[SW1-Vlanif4] ip address 192.168.4.1 24 //配置IP地址,此IP地址是PC3的网关地址
[SW1-Vlanif4] quit
[SW1] interface gigabitethernet 1/0/1
[SW1-GigabitEthernet1/0/1] port link-type access //将与路由器相连接口的接口类型设置为access,与路由器通过Untagged方式通信
[SW1-GigabitEthernet1/0/1] port default vlan 5 //将路由器划分到VLAN 5
[SW1-GigabitEthernet1/0/1] quit
[SW1] interface vlanif 5 //创建VLANIF5接口
[SW1-Vlanif5] ip address 192.168.5.1 24 //配置IP地址,此IP地址是与路由器对接的IP地址
[SW1-Vlanif5] quit
SW2的配置文件
#
sysname SW2
#
vlan batch 2 to 3
#
interface GigabitEthernet1/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 3
#
interface GigabitEthernet1/0/23
port link-type access
port default vlan 2
#
interface GigabitEthernet1/0/24
port link-type access
port default vlan 3
#
return
标签:通信 src shadow 互连 批量创建 3.1 roc ffffff run
原文地址:http://blog.51cto.com/tudoubowen10/2069177