华为三层交换机的配置!求指教

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为三层交换机的配置!求指教相关的知识,希望对你有一定的参考价值。

华为三层交换机的配置

先来看拓扑图

技术分享图片

下来看看配置过程



SW2配置

<Huawei>sys

[Huawei]vlan batch 10 20 30    创建vlan

[Huawei]sysname SW2             

[SW2]interface GigabitEthernet 0/0/1   

[SW2-GigabitEthernet0/0/1]port link-type access      此端口加入VLAN

[SW2-GigabitEthernet0/0/1]port default vlan 10

[SW2-GigabitEthernet0/0/1]undo shutdown               开启此端口

Info: Interface GigabitEthernet0/0/1 is not shutdown.

[SW2-GigabitEthernet0/0/1]q

[SW2]interface GigabitEthernet 0/0/2

[SW2-GigabitEthernet0/0/2]port link-type access

[SW2-GigabitEthernet0/0/2]port default vlan 20

[SW2-GigabitEthernet0/0/2]undo shutdown

Info: Interface GigabitEthernet0/0/2 is not shutdown.

[SW2-GigabitEthernet0/0/2]q

[SW2]interface gi0/0/3

[SW2-GigabitEthernet0/0/3]port link-type access

[SW2-GigabitEthernet0/0/3]port default vlan 30

[SW2-GigabitEthernet0/0/3]q

[SW2]interface gi0/0/24   

[SW2-GigabitEthernet0/0/24]port link-type trunk         这个端口配置trunk模式,允许所有VLAN通过

[SW2-GigabitEthernet0/0/24]port trunk allow-pass vlan all




SW3配置

和sw2配置思路相同

<Huawei>sys

[Huawei]SYSNAME SW3

[SW3]VLAN batch 40 50

[SW3]interface GigabitEthernet 0/0/1

[SW3-GigabitEthernet0/0/1]port link-type access

[SW3-GigabitEthernet0/0/1]port default vlan 40

[SW3-GigabitEthernet0/0/1]undo shutdown

Info: Interface GigabitEthernet0/0/1 is not shutdown.

[SW3-GigabitEthernet0/0/1]q 

[SW3]interface gi0/0/2 

[SW3-GigabitEthernet0/0/2]port link-type access

[SW3-GigabitEthernet0/0/2]port default vlan 50

[SW3-GigabitEthernet0/0/2]undo shutdown

Info: Interface GigabitEthernet0/0/2 is not shutdown.

[SW3-GigabitEthernet0/0/2]q

[SW3]interface gi0/0/23

[SW3-GigabitEthernet0/0/23]port link-type trunk

[SW3-GigabitEthernet0/0/23]port trunk allow-pass vlan all




sw1配置

<Huawei>sys 

[Huawei]sysname sw1           改名字

[sw1]vlan batch 10 to 50     创建VLAN

[sw1]int vlanif 10             给每个VLAN配置IP地址

[sw1-Vlanif10]ip address 192.168.1.254 24        

[sw1-Vlanif10]int vlanif 20

[sw1-Vlanif20]ip address 192.168.2.254 24

[sw1-Vlanif20]int vlanif 30 

[sw1-Vlanif30]ip address 192.168.3.254 24

[sw1-Vlanif30]int vlanif 40  

[sw1-Vlanif40]ip address 192.168.4.254 24

[sw1-Vlanif40]int vlanif 50

[sw1-Vlanif50]ip address 192.168.5.254 24

[sw1-Vlanif50]q

[sw1]int gi0/0/24                         此端口配置trunk模式

[sw1-GigabitEthernet0/0/24]port link-type trunk

[sw1-GigabitEthernet0/0/24]port trunk allow-pass vlan all

[sw1-GigabitEthernet0/0/24]q

[sw1]int gi0/0/23                         此端口配置trunk模式

[sw1-GigabitEthernet0/0/23]port link-type trunk

[sw1-GigabitEthernet0/0/23]port trunk allow-pass vlan all

[sw1]vlan 60

[sw1-vlan60]q

[sw1]interface gi0/0/1  

[sw1-GigabitEthernet0/0/1]port link-type access

[sw1-GigabitEthernet0/0/1]port default vlan 60

[sw1-GigabitEthernet0/0/1]q

[sw1]int vlanif 60

[sw1-Vlanif60]ip address 192.168.7.1 24

[sw1-Vlanif60]q          

[sw1]ip route-static 192.168.6.0 24 192.168.7.2   配置去往下一个网段的的下一跳

路由器的配置

每个端口配置IP地址

在配置下一跳

[Huawei]sysname R1

[R1]interface gi0/0/1

[R1-GigabitEthernet0/0/1]ip address 192.168.7.2 24

[R1-GigabitEthernet0/0/1]q

[R1]interface gi0/0/0

[R1-GigabitEthernet0/0/0]ip address 192.168.6.254 24

[R1-GigabitEthernet0/0/0]q   

[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.7.1

实验验证:华为交换机也可以当作三层设备来用它默认是开启的

          ip routing

   实现全网通

                               






以上是关于华为三层交换机的配置!求指教的主要内容,如果未能解决你的问题,请参考以下文章

华为三层交换机(S3700),详细配置!

华为三层交换机配置命令

求助华为三层交换机的配置

华为三层交换机配置求解

这个在华为的三层交换机在ensp上怎么配置

华为三层交换机如何做RIP协议?