Bài viết này sẽ hướng dẫn các bạn cấu hình thiết bị Layer 3 switch của Huawei theo mô hình ví dụ sau. 1.Cấu hình IP address và default route cho R1, R3, S3 và S4 : *R1 : <Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R1 [R1]interface GigabitEthernet 0/0/1 [R1-GigabitEthernet0/0/1]ip address 10.0.4.1 24 [R1-GigabitEthernet0/0/1]quit [R1]ip route-static 0.0.0.0 0.0.0.0 10.0.4.254 *R3 : <Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R3 [R3]interface GigabitEthernet 0/0/2 [R3-GigabitEthernet0/0/2]ip address 10.0.6.3 24 [R3-GigabitEthernet0/0/2]quit [R3]ip route-static 0.0.0.0 0.0.0.0 10.0.6.254 *S3 : <Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname S3 [S3]interface vlanif1 [S3-vlanif1]ip address 10.0.3.3 24 [S3-vlanif1]quit [S3]ip route-static 0.0.0.0 0.0.0.0 10.0.3.254 *S4 : <Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname S4 [S4]interface vlanif1 [S4-vlanif1]ip address 10.0.7.4 24 [S4-vlanif1]quit [S4]ip route-static 0.0.0.0 0.0.0.0 10.0.7.254 2.Cấu hình Eth-trunk giữa S1 và S2 : *S1 : <Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname S1 [S1]interface Eth-Trunk 1 [S1-Eth-Trunk1]mode lacp-static [S1-Eth-Trunk1]port link-type trunk [S1-Eth-Trunk1]port trunk allow-pass vlan all [S1-Eth-Trunk1]quit [S1]interface GigabitEthernet 0/0/9 [S1-GigabitEthernet0/0/9]eth-trunk 1 [S1-GigabitEthernet0/0/9]interface GigabitEthernet 0/0/10 [S1-GigabitEthernet0/0/10]eth-trunk 1 *S2 : <Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname S2 [S2]interface Eth-Trunk 1 [S2-Eth-Trunk1]mode lacp-static [S2-Eth-Trunk1]port link-type trunk [S2-Eth-Trunk1]port trunk allow-pass vlan all [S2-Eth-Trunk1]quit [S2]interface GigabitEthernet 0/0/9 [S2-GigabitEthernet0/0/9]eth-trunk 1 [S2-GigabitEthernet0/0/9]interface GigabitEthernet 0/0/10 [S2-GigabitEthernet0/0/10]eth-trunk 1 3.Cấu hình Vlan 3 đến Vlan 7 cho S1 và S2 : *S1 : [S1]vlan batch 3 to 7 *S2 : [S2]vlan batch 3 to 7 - Kiểm tra lại Vlan đã được tạo trên S1 và S2 : 4.Thêm interface giga ethernet 0/0/1 và 0/0/13 của S1 vào Vlan 3 và Vlan 4, trên S2 thêm interface giga ethernet 0/0/3 và 0/0/6 vào Vlan 6 và Vlan 7, đồng thời thiết lập Eth-trunk giữa S1 và S2 với pvid 5. *S1: [S1]interface Eth-Trunk 1 [S1-Eth-Trunk1]port trunk pvid vlan 5 [S1-Eth-Trunk1]quit [S1]interface GigabitEthernet 0/0/1 [S1-GigabitEthernet0/0/1]port link-type access [S1-GigabitEthernet0/0/1]port default vlan 4 [S1-GigabitEthernet0/0/1]quit [S1]interface GigabitEthernet 0/0/13 [S1-GigabitEthernet0/0/13]port link-type access [S1-GigabitEthernet0/0/13]port default vlan 3 *S2 : [S2]interface Eth-Trunk 1 [S2-Eth-Trunk1]port trunk pvid vlan 5 [S2-Eth-Trunk1]quit [S2]interface GigabitEthernet 0/0/3 [S2-GigabitEthernet0/0/3]port link-type access [S2-GigabitEthernet0/0/3]port default vlan 6 [S2-GigabitEthernet0/0/3]quit [S2]interface GigabitEthernet 0/0/6 [S2-GigabitEthernet0/0/6]port link-type access [S2-GigabitEthernet0/0/6]port default vlan 7 Kiểm tra lại cấu hình : 5.Cấu hình gateway address cho Vlan trên S1 và S2 : *S1: [S1]interface vlanif 3 [S1-vlanif3]ip address 10.0.3.254 24 [S1]interface vlanif 4 [S1-vlanif4]ip address 10.0.4.254 24 [S1]interface vlanif 5 [S1-vlanif5]ip address 10.0.5.1 24 *S2 : [S2]interface vlanif 5 [S2-vlanif5]ip address 10.0.5.2 24 [S2]interface vlanif 6 [S2-vlanif6]ip address 10.0.6.254 24 [S2]interface vlanif 7 [S2-vlanif7]ip address 10.0.7.254 24 6.Enable OSPF trên S1 và S2 *S1 : [S1]ospf 1 [S1-ospf-1]area 0 [S1-ospf-1-area-0.0.0.0]network 10.0.0.0 0.255.255.255 *S2 : [S2]ospf 1 [S2-ospf-1]area 0 [S2-ospf-1-area-0.0.0.0]network 10.0.0.0 0.255.255.255 - Kiểm tra lại bảng định tuyến trên SW1 : - S1 đã học 2 route từ OSPF. Kiểm tra kết nối từ R1 tới R3 và S4 : !!! Cảm ơn các bạn đã theo dõi bài viết !!!