码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-01-11 15:38:31      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:pass   开启   拓扑图   undo   address   拓扑   三层交换机   weight   min   

华为三层交换机的配置

先来看拓扑图

技术分享图片

下来看看配置过程



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

   实现全网通

                               






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

标签:pass   开启   拓扑图   undo   address   拓扑   三层交换机   weight   min   

原文地址:http://blog.51cto.com/13555885/2059802

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!