1. 程式人生 > >華為三層交換機的配置!求指教

華為三層交換機的配置!求指教

type tle vlan 路由器的配置 shu proc 三層交換機 int res

華為三層交換機的配置

先來看拓撲圖

技術分享圖片

下來看看配置過程



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

實現全網通






華為三層交換機的配置!求指教