发布时间:2025-01-29 07:40:57
划分VLAN案例
创建VLAN2、3,将相应端口加入指定VLAN,并配置服务器IP地址以实现同VLAN主机通信。
步骤一:创建VLAN并加入接口。
创建VLAN2、3:system-view [Huawei]vlan batch 2 3 将接口加入VLAN:[Huawei]port-group 1 [Huawei-port-group-1]group-member Ethernet0/0/3 Ethernet0/0/4 [Huawei-port-group-1]port link-type access [Huawei-port-group-1]port default vlan 2 [Huawei-port-group-1]quit [Huawei]port-group 2 [Huawei-port-group-2]group-member Ethernet0/0/5 Ethernet0/0/6 [Huawei-port-group-2]port link-type access [Huawei-port-group-2]port default vlan 3
多交换机VLAN划分案例
在已有VLAN基础上,通过配置交换机实现同VLAN主机互通。
步骤一:创建VLAN并加入接口。
S1配置:[Huawei]interface Ethernet0/0/7 [Huawei-Ethernet0/0/7] port link-type access [Huawei-Ethernet0/0/7] port default vlan 3 S2配置:[Huawei]vlan 3 [Huawei]port-group 1 [Huawei-port-group-1]group-member Ethernet0/0/5 to Ethernet0/0/7 [Huawei-port-group-1]port link-type access [Huawei-port-group-1]port default vlan 3
配置trunk中继链路案例
跨交换机实现同VLAN通信。
步骤一:配置trunk并放行所有VLAN。
S1配置:[Huawei] clear configuration interface Ethernet0/0/7 [Huawei]interface Ethernet0/0/7 [Huawei-Ethernet0/0/7]port default vlan 1 [Huawei-Ethernet0/0/7]port link-type trunk [Huawei-Ethernet0/0/1]port trunk allow-pass vlan all S2配置:[Huawei]vlan 2 [Huawei]port-group 1 [Huawei-port-group-1]group-member Ethernet0/0/3 Ethernet0/0/4 [Huawei-port-group-1]port link-type access [Huawei-port-group-1]port default vlan 2 [Huawei]interface Ethernet0/0/7 [Huawei-Ethernet0/0/7]port default vlan 1 [Huawei-Ethernet0/0/7]port link-type trunk [Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
链路聚合配置案例
将两台交换机的接口互联,实现高可用。
步骤一:创建链路聚合接口并捆绑物理接口。
S1配置:[Huawei]interface Eth-trunk 1 [Huawei-Eth-trunk1]trunkport ethernet 0/0/1 0/0/2 S2配置:[Huawei]interface Eth-trunk 1 [Huawei-Eth-trunk1]trunkport ethernet 0/0/1 0/0/2
配置静态路由案例
通过静态路由实现全网互通。
步骤一:配置接口IP地址及添加静态路由。
R1配置:[Huawei]interface GigabitEthernet 0/0/0 [Huawei-GigabitEthernet0/0/1]ip address 192.168.1.254 24 [Huawei-GigabitEthernet0/0/1]quit [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1]ip address 192.168.2.1 24 [Huawei]ip route-static 192.168.3.0 24 192.168.2.2 [Huawei]ip route-static 192.168.4.0 24 192.168.2.2 R2配置:[Huawei]interface GigabitEthernet 0/0/0 [Huawei-GigabitEthernet0/0/1]ip address 192.168.3.254 24 [Huawei-GigabitEthernet0/0/1]quit [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1]ip address 192.168.2.2 24 [Huawei-GigabitEthernet0/0/1]quit [Huawei]interface GigabitEthernet 0/0/2 [Huawei-GigabitEthernet0/0/1]ip address 192.168.4.254 24 [Huawei]ip route-static 192.168.1.0 24 192.168.2.1
三层交换机基本配置案例
配置三层交换机实现VLAN间通信。
步骤一:创建VLAN及虚拟接口IP。
三层交换机配置:[Huawei]vlan batch 2 3 [Huawei]interface Vlanif 1 [Huawei-Vlanif1]ip address 192.168.1.254 24 [Huawei]interface Vlanif 2 [Huawei-Vlanif1]ip address 192.168.2.254 24 [Huawei]interface Vlanif 3 [Huawei-Vlanif1]ip address 192.168.3.254 24 [Huawei]interface G0/0/2 [Huawei-GigabitEthernet0/0/2] port link-type access [Huawei-GigabitEthernet0/0/2] port default vlan 2 [Huawei]interface G0/0/3 [Huawei-GigabitEthernet0/0/2] port link-type access [Huawei-GigabitEthernet0/0/2] port default vlan 3