2020-12-12

legendznx發表於2020-12-12

  vlan多地址&介面配置

實現不同網段之間互通

一、pc1、pc2、pc3、pc4、server應用伺服器、server運維伺服器配置地址如上,閘道器為本網段最後一個地址,

 

 

二、CORE-SW配置vlan10及地址配置(標註:第一個地址為交換機主地址)

<Huawei>sys    
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]undo in    
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname CORE-SW
[CORE-SW]vlan 10
[CORE-SW-vlan10]quit
[CORE-SW]interface vlanif 10
10.1.1.254 24加入vlan,此地址為交換機主地址
[CORE-SW-Vlanif10]ip address 10.1.1.254 24    
<此閘道器地址為交換機主地址,http、telnet、ftp等授權進入均可按此閘道器地址進行操作>
10.1.2.254 24加入vlan
[CORE-SW-Vlanif10]ip address 10.1.2.254 24 sub
10.1.3.254 24加入vlan
[CORE-SW-Vlanif10]ip address 10.1.3.254 24 sub
10.1.4.254 24加入vlan
[CORE-SW-Vlanif10]ip address 10.1.4.254 24 sub
10.1.5.254 24加入vlan
[CORE-SW-Vlanif10]ip address 10.1.5.254 24 sub
10.1.6.254 24加入vlan
[CORE-SW-Vlanif10]ip address 10.1.6.254 24 sub
[CORE-SW-Vlanif10]q
[CORE-SW]

三、使用的介面配置,(如果再用介面較少,單個配置即可,若介面全在使用,建立一個組group1比較方便,也可以按不同需求建立好幾個組)下面我們每個介面配置一遍方便大家理解

<CORE-SW>sys
Enter system view, return user view with Ctrl+Z.
[CORE-SW]int g	
[CORE-SW]int GigabitEthernet 0/0/1
[CORE-SW-GigabitEthernet0/0/1]port link-type access
[CORE-SW-GigabitEthernet0/0/1]port default vlan 10
[CORE-SW-GigabitEthernet0/0/1]int GigabitEthernet 0/0/2
[CORE-SW-GigabitEthernet0/0/2]port link-type access
[CORE-SW-GigabitEthernet0/0/2]port default vlan 10
[CORE-SW-GigabitEthernet0/0/2]int GigabitEthernet 0/0/3
[CORE-SW-GigabitEthernet0/0/3]port link-type access
[CORE-SW-GigabitEthernet0/0/3]port default vlan 10
[CORE-SW-GigabitEthernet0/0/3]int GigabitEthernet 0/0/4
[CORE-SW-GigabitEthernet0/0/4]port link-type access
[CORE-SW-GigabitEthernet0/0/4]port default vlan 10
[CORE-SW-GigabitEthernet0/0/4]int GigabitEthernet 0/0/22
[CORE-SW-GigabitEthernet0/0/22]port link-type access
[CORE-SW-GigabitEthernet0/0/22]port default vlan 10
[CORE-SW-GigabitEthernet0/0/22]int GigabitEthernet 0/0/24
[CORE-SW-GigabitEthernet0/0/24]port link-type access
[CORE-SW-GigabitEthernet0/0/24]port default vlan 10
[CORE-SW-GigabitEthernet0/0/24]q

檢視介面配置資訊

[CORE-SW]dis vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      
                GE0/0/9(D)      GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     
                GE0/0/13(D)     GE0/0/14(D)     GE0/0/15(D)     GE0/0/16(D)     
                GE0/0/17(D)     GE0/0/18(D)     GE0/0/19(D)     GE0/0/20(D)     
                GE0/0/21(D)     GE0/0/23(D)                                     

10   common  UT:GE0/0/1(U)      GE0/0/2(U)      GE0/0/3(U)      GE0/0/4(U)      
                GE0/0/22(U)     GE0/0/24(U)                                     


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010                         
[CORE-SW]

四、驗證裝置之間互通性