华为eNSP交换机实现不同网络之间的通信
如图所示:PC1的IP地址192.168.10.1,vlan 10 网关192.168.10.254
PC2的IP地址192.168.20.1,vlan 20 网关192.168.20.254
PC3的IP地址192.168.30.1,vlan 30 网关192.168.30.254
PC4的IP地址192.168.40.1,vlan 40 网关192.168.40.254
PC5的ip地址192.168.50.1,vlan 50 网关192.168.50.254
LSW5
<Huawei>undo terminal monitor #关闭提示信息
Info: Current terminal monitor is off.
<Huawei>sys #进入系统视图
vlan batch 10 20 30#连续创建vlan 10 20 30
int vlan 10 #进入vlan 10
ip add 192.168.10.254 24 #配置vlan 10的网关地址
int vlanif 20 #进入vlan 20
ip add 192.168.20.254 24 #配置vlan 20的网关地址
int vlanif 30 #进入vlan 30
ip add 192.168.30.254 24 #配置vlan 30的网关地址
q #退出vlan 30的配置界面
int g0/0/2 #进入端口视图
port link-type access #将端口设置为access模式
port default vlan 10#将端口加入到vlan 10
q #退出端口视图
int g0/0/3
port link-type access
port default vlan 20
q
int g0/0/4
port link-type access
port default vlan 30
q
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
q
LSW4
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
vlan batch 10 20 30 40 50
Info: This operation may take a few seconds. Please wait for a moment...done.
int vlanif 10
ip add 192.168.10.254 24
int vlanif 20
ip add 192.168.20.254 24
int vlanif 30
ip add 192.168.30.254 24
int vlanif 40
ip add 192.168.40.254 24
int vlanif 50
ip add 192.168.50.254 24
q
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
q
int g0/0/2
port link-type trunk
port trunk allow-pass vlan all
q
LSW6
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
vlan batch 40 50
Info: This operation may take a few seconds. Please wait for a moment...done.
int vlanif 40
ip add 192.168.40.254 24
int vlanif 50
ip add 192.168.50.254 24
q
int g0/0/2
port link-type access
port default vlan 40
q
int g0/0/3
port link-type access
port default vlan 50
q
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
q
验证:5台主机互通,用PC1ping192.168.20.1/192.168.30.1/192.168.40.1/192.168.50.1
页:
[1]