華爲交換機配置Vlan過程

1.進入系統
system-viewubuntu

<HUAWEI>sys
Enter system view, return user view with Ctrl+Z.

2.修改密碼app

[HUAWEI] user-interface console 0
[HUAWEI-ui-console0] authentication-mode password
[HUAWEI-ui-console0] set authentication password cipher oschina123
[HUAWEI-ui-console0] return

2.查看當前配置信息
display currentdom

[HUAWEI]dis cu
!Software Version V200R010C00SPC600
#
sysname HUAWEI
#
vlan batch 220
#
authentication-profile name default_authen_profile
authentication-profile name dot1x_authen_profile
authentication-profile name mac_authen_profile
authentication-profile name portal_authen_profile
authentication-profile name dot1xmac_authen_profile
authentication-profile name multi_authen_profile
#
telnet server enable
#
radius-server template default
#
free-rule-template name default_free_rule
#
portal-access-profile name portal_access_profile
#
aaa
 authentication-scheme default
 authentication-scheme radius
  authentication-mode radius              
 authorization-scheme default
 accounting-scheme default
 local-aaa-user password policy administrator
  password expire 0
 domain default
  authentication-scheme radius
  radius-server default
 domain default_admin
  authentication-scheme default
 local-user dxy password irreversible-cipher $1a$RNP'=AG50S$6*BKO|y~rMYz,F$mkA)GLqaCO-}(h.tDj88`5,J9$
 local-user dxy privilege level 15
 local-user dxy service-type telnet
 local-user admin password irreversible-cipher $1a$[%G{"9g>/&$1-~5P:W*@=GJv\T\SGS/t~U6XJD(xSjIm29<79C>$
 local-user admin privilege level 15
 local-user admin service-type terminal http
  ---- More ----

3.建立vlanoop

[HUAWEI]vlan 220
[HUAWEI-Vlanif220]

4.進入vlan
int vlan220ui

[HUAWEI]interface Vlanif 220
[HUAWEI-Vlanif220]

5.配置ip
ip address 172.29.220.253 255.255.255.0spa

[HUAWEI-Vlanif220]ip add 172.29.220.253 24
[HUAWEI]ping 172.29.220.253
  PING 172.29.220.253: 56  data bytes, press CTRL_C to break
    Reply from 172.29.220.253: bytes=56 Sequence=1 ttl=255 time=3 ms
    Reply from 172.29.220.253: bytes=56 Sequence=2 ttl=255 time=1 ms
    Reply from 172.29.220.253: bytes=56 Sequence=3 ttl=255 time=1 ms
    Reply from 172.29.220.253: bytes=56 Sequence=4 ttl=255 time=1 ms
    Reply from 172.29.220.253: bytes=56 Sequence=5 ttl=255 time=1 ms

  --- 172.29.220.253 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 1/1/3 ms

6.查看vlan
display vlancode

[HUAWEI]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/1(D)      GE0/0/2(U)      GE0/0/3(D)      GE0/0/4(D)      
                GE0/0/5(D)      GE0/0/6(U)      GE0/0/7(D)      GE0/0/8(U)      
                GE0/0/9(D)      GE0/0/10(U)     GE0/0/11(D)     GE0/0/12(U)     
                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/22(D)     GE0/0/23(D)     GE0/0/24(U)     
                XGE0/0/1(D)     XGE0/0/2(D)     XGE0/0/3(D)     XGE0/0/4(D)     
220  common  TG:GE0/0/24(U)                                                     

VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                         
220  enable  default       enable  disable    VLAN 0220

7.添加靜態路由server

[HUAWEI]ip route-static 0.0.0.0 0.0.0.0 172.29.220.1

8.查看路由表ip

[HUAWEI]display ip routing-table                    
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 5        Routes : 5        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   172.29.220.1    Vlanif220
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
   172.29.220.0/24  Direct  0    0           D   172.29.220.253  Vlanif220
 172.29.220.253/32  Direct  0    0           D   127.0.0.1       Vlanif220

9.進入端口
interface GigabitEthernet 0/0/24ci

[HUAWEI]int g0/0/24                     
[HUAWEI-GigabitEthernet0/0/24]

10.修改端口類型

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

11.限制端口網段

[HUAWEI-GigabitEthernet0/0/24]port trunk allow-pass vlan 220 to 230

12.配置telnet

//telnet出廠時是關閉的,須要打開
[HUAWEI]telnet server enable 
Info: The Telnet server has been enabled.

//telnet經常使用於設備管理員登陸,推薦使用AAA認證
[HUAWEI]user-interface vty 0 4
//V2R6及其以前版本缺省支持telnet協議,可是V2R7及其以後版本缺省的是SSH協議,所以使用telnet登陸以前,必需要先配置這條命令
[HUAWEI-ui-vty0-4]protocol inbound telnet
[HUAWEI-ui-vty0-4]authentication-mode aaa
[HUAWEI-ui-vty0-4]idle-timeout 15
[HUAWEI-ui-vty0-4]quit

[HUAWEI]aaa
//配置管理員telnet登陸交換機的用戶名和密碼。用戶名不區分大小寫,密碼區分大小寫
[HUAWEI-aaa]local-user robotcl password irreversible-cipher oschina123
//將管理員的帳號權限設置爲15(最高)
[HUAWEI-aaa]local-user robotcl privilege level 15
[HUAWEI-aaa]local-user robotcl service-type telnet

14.保存退出
quit

[HUAWEI-aaa]q
[HUAWEI]q
//爲了防止重啓後配置丟失,應及時保存配置
<HUAWEI>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0...
Save the configuration successfully.

13.使用telnet

root@ubuntu:~# telnet 172.29.220.253
Trying 172.29.220.253...
Connected to 172.29.220.253.
Escape character is '^]'.

Warning: Telnet is not a secure protocol, and it is recommended to use Stelnet.

Login authentication


Username:robotcl
Password:
Warning: The initial password poses security risks.
The password needs to be changed. Change now? [Y/N]: N
Info: The max number of VTY users is 10, and the number
      of current VTY users on line is 1.
      The current login time is 2000-04-02 02:38:32+00:00.
相關文章
相關標籤/搜索