1. 程式人生 > >配置H3C交換機

配置H3C交換機

一、初次配置H3C交換機過程簡備(採用超級終端)

  1. 超級終端路徑有兩個:C:\WINDOWS\system32和C:\Program Files\Windows NT下,將兩個檔案拷到這裡就可;只要執行hypertrm.exe檔案即可,前提得有hypertrm.dll檔案;選單快捷鍵則可將檔案複製到“C:\Documents and Settings\Administrator\「開始」選單\程式\附件\通訊\超級終端”下。
  2. 執行超級終端------名稱H3C,com;----com屬性還原預設值----ENTER鍵----

選擇“檔案”---屬性---設定---VT100

3

、[H3C]telnet server enable--這是華為路由的,但交換機裡預設、省略、無此命令

[H3C]user-interface vty 0 4

[H3C -ui-vty0-4] authentication-mode password

[H3C -ui-vty0-4] set authentication password  cipher xxx(遠端登入密碼)

[H3C -ui-vty0-4] user privilege  level  3

[H3C]quit

[H3C]save

The current configuration will be written to the device. Are you sure? [Y/N]: Y

Please input the file name(*.cfg)[cf:/startup.cfg]

(To leave the existing filename unchanged, press the enter key):回車

cf:/startup.cfg exists, overwrite? [Y/N]:Y

[H3C]quit

< H3C >reboot      密碼:xxxxx

---------------------------------------------------------------------------------------------------------------

            Copyright(c) 2004-2010 Hangzhou H3C Technologies Co., Ltd.

            Creation date   : Jul 28 2010, 20:20:25

            CPU Clock Speed : 200MHz

            BUS Clock Speed : 33MHz

            Memory Size     : 64MB

            Mac Address     : 3822d63e0a3c

 

 

Press Ctrl-B to enter Boot Menu... 0

Auto-booting...

Decompress Image................................................................

................................................................................

................................................................................

................................................................................

................................................................................

........................................OK!

Starting at 0x80100000...

 

User interface aux0 is available.

 

Press ENTER to get started.

<H3C>

%Apr  1 23:56:17:326 2000 H3C SHELL/5/LOGIN:- 1 - Console(aux0) in unit1 login

<H3C>H3C

     ^

 % Unrecognized command found at '^' position.

<H3C>NK6000

     ^

 % Unrecognized command found at '^' position.

<H3C>en

     ^

 % Unrecognized command found at '^' position.--------黃色為錯誤的

 

<H3C>SYS

System View: return to User View with Ctrl+Z.

[H3C]DIS CUR

#

 sysname H3C

#

radius scheme system

#

domain system

#

vlan 1

#

interface Aux1/0/0

#

interface Ethernet1/0/1

#

interface Ethernet1/0/2

#

interface Ethernet1/0/3

#

interface Ethernet1/0/4

#

interface Ethernet1/0/5

#

interface Ethernet1/0/6

#

interface Ethernet1/0/7

#

interface Ethernet1/0/8

#

interface Ethernet1/0/9

#

interface Ethernet1/0/10

#

interface Ethernet1/0/11

#

interface Ethernet1/0/12

#

interface Ethernet1/0/13

#

interface Ethernet1/0/14

#

interface Ethernet1/0/15

#

interface Ethernet1/0/16

#

interface Ethernet1/0/17

#

interface Ethernet1/0/18

#

interface Ethernet1/0/19

#

interface Ethernet1/0/20

#

interface Ethernet1/0/21

#

interface Ethernet1/0/22

#

interface Ethernet1/0/23

#

interface Ethernet1/0/24

#

interface GigabitEthernet1/1/1

#

interface GigabitEthernet1/1/2

#

interface GigabitEthernet1/1/3

#

interface GigabitEthernet1/1/4

#

 undo irf-fabric authentication-mode

#

interface NULL0

#

 voice vlan mac-address 0001-e300-0000 mask ffff-ff00-0000

#

user-interface aux 0 7

user-interface vty 0 4

 user privilege level 3

 set authentication password cipher 19UK^\_S/7aQ=^Q`MAF4<1!!

#

Return

 

[H3C]vlan 1---------------------------------預設的,不要用這個

[H3C-vlan1]ip?

           ^

 % Unrecognized command found at '^' position.

[H3C-vlan1]quit

[H3C]dis vlan

 Total 1 VLAN exist(s).

 The following VLANs exist:

  1(default)

 

 

[H3C]vlan 10

[H3C-vlan10]?

Vlan view commands:

  arp            Specify ARP(Address Resolution Protocol) configuration

                 information

  description    Description of VLAN

  display        Display current system information

  igmp-snooping  IGMP snooping

  multicast      Specify multicast configuration information

  name           Name of VLAN

  nslookup       Query Internet name servers

  ping           Ping function

  port           Add ports to or delete ports from VLAN

  protocol-vlan  Protocol-based VLAN

  quit           Exit from current command view

  return         Exit to User View

  save           Save current configuration

  service-type   Specify Service-VLAN characteristic

  tracemac       Trace MAC function

  tracert        Trace route function

  undo           Cancel current setting

 

[H3C-vlan10]quit

[H3C]int ?

  Aux              Aux interface

  Ethernet         Ethernet interface

  GigabitEthernet  GigabitEthernet interface

  LoopBack         LoopBack interface

  NULL             NULL interface

  Vlan-interface   VLAN interface

 

[H3C]int vlan 10

[H3C-Vlan-interface10]ip address 192.168.110.199 255.255.255.0

[H3C-Vlan-interface10]quit

[H3C]vlan 10

[H3C-vlan10]?

Vlan view commands:

  arp            Specify ARP(Address Resolution Protocol) configuration

                 information

  description    Description of VLAN

  display        Display current system information

  igmp-snooping  IGMP snooping

  multicast      Specify multicast configuration information

  name           Name of VLAN

  nslookup       Query Internet name servers

  ping           Ping function

  port           Add ports to or delete ports from VLAN

  protocol-vlan  Protocol-based VLAN

  quit           Exit from current command view

  return         Exit to User View

  save           Save current configuration

  service-type   Specify Service-VLAN characteristic

  tracemac       Trace MAC function

  tracert        Trace route function

  undo           Cancel current setting

 

[H3C-vlan10]port Ethernet1/0/23

[H3C-vlan10]quit

[H3C]dis cur

#

 sysname H3C

#

radius scheme system

#

domain system

#

vlan 1

#

vlan 10

#

interface Vlan-interface10

 ip address 192.168.110.199 255.255.255.0

#

interface Aux1/0/0

#

interface Ethernet1/0/1

#

interface Ethernet1/0/2

#

interface Ethernet1/0/3

#

interface Ethernet1/0/4

#

interface Ethernet1/0/5

#

interface Ethernet1/0/6

#

interface Ethernet1/0/7

#

interface Ethernet1/0/8

#

interface Ethernet1/0/9

#

interface Ethernet1/0/10

#

interface Ethernet1/0/11

#

interface Ethernet1/0/12

#

interface Ethernet1/0/13

#

interface Ethernet1/0/14

#

interface Ethernet1/0/15

#

interface Ethernet1/0/16

#

interface Ethernet1/0/17

#

interface Ethernet1/0/18

#

interface Ethernet1/0/19

#

interface Ethernet1/0/20

#

interface Ethernet1/0/21

#

interface Ethernet1/0/22

#

interface Ethernet1/0/23

 port access vlan 10

#

interface Ethernet1/0/24

#

interface GigabitEthernet1/1/1

#

interface GigabitEthernet1/1/2

#

interface GigabitEthernet1/1/3

#

interface GigabitEthernet1/1/4

#

 undo irf-fabric authentication-mode

#

interface NULL0

#

 voice vlan mac-address 0001-e300-0000 mask ffff-ff00-0000

#

user-interface aux 0 7

user-interface vty 0 4

 user privilege level 3

 set authentication password cipher 19UK^\_S/7aQ=^Q`MAF4<1!!

#

Return

[H3C]

[H3C]save

The configuration will be written to the device.

Are you sure?[Y/N]y

Please input the file name(*.cfg)(To leave the existing filename

 unchanged press the enter key):

Now saving current configuration to the device.

Saving configuration. Please wait...

......

 Unit1 save configuration flash:/config.cfg successfully

 

[H3C]

 

 

  • 配置H3C交換機(cmd裡)
  1. telnet IP,登陸,密碼nk6000
  2. <H3C>

<H3C>sys

[H3C]dis cur

3、劃分vlan: [H3C]vlan 30

[H3C-vlan30]

[H3C-vlan30]port Ethernet1/0/3

[H3C-vlan30]port Ethernet1/0/4

[H3C-vlan30]quit

[H3C]

[H3C]int vlan 30

[H3C-Vlan-interface30]ip address 192.168.20.199 255.255.255.0

[H3C-Vlan-interface30]quit

[H3C]dis cur

 

[H3C]save

 

  1. H3C交換機是預設開啟路由功能的;舉例:

   分3個VLAN,分別為192.168.10.0;192.168.20.0;192.168.30.0,子網掩碼都是255.255.255.0.分別把Ethernet 1/0/1,Ethernet 1/0/2,Ethernet 1/0/3分給3個VLAN,要求,通過三層交換的路由功能實現3個VLAN之間能互連互通。

“在三層交換機配置了 VLAN 後,VLAN之間不能直接通訊,如果需要通訊,可以通過三層交換機配置的三層介面使兩個VLAN 間通過三層轉發進行通訊。”(好像預設通過介面可以通訊,或者說如何配置這一塊??

# 建立VLAN100
[SwitchA] vlan 100 ,分配Ethernet 1/0/1給vlan100
[SwitchA-vlan100] description vlan_100
[SwitchA-vlan100] port Ethernet 1/0/1
[SwitchA-vlan100] quit
# 建立VLAN200
[SwitchA] vlan 200 ,分配Ethernet 1/0/2給vlan200
[SwitchA-vlan200] description vlan_200
[SwitchA-vlan100] port Ethernet 1/0/2
[SwitchA-vlan200] quit
# 建立VLAN300,分配Ethernet 1/0/3給vlan300
[SwitchA] vlan 300
[SwitchA-vlan300] description vlan_300
[SwitchA-vlan300] port Ethernet 1/0/3
[SwitchA-vlan300] quit

# 建立VLAN介面,IP 地址分別三層交換機配置為192.168.10.1 和
192.168.20.1,192.168.30.1
[SwitchA] interface Vlan-interface 100
[SwitchA-Vlan-interface100] ip address 192.168.10.1 24
[SwitchA-Vlan-interface100] quit
[SwitchA] interface Vlan-interface 200
[SwitchA-Vlan-interface200] ip address 192.168.20.1 24
[SwitchA-Vlan-interface200] quit
[SwitchA] interface Vlan-interface 300
[SwitchA-Vlan-interface300] ip address 192.168.30.1 24
[SwitchA-Vlan-interface300] quit

  1. H3C交換機命令

4.1、system-view 進入系統檢視模式    sys

4.2、sysname 命名

4.3、display current-configuration即dis cur  檢視當前配置

4.4、language-mode Chinese | English  中英文切換

4.5、interface Ethernet1/0/1  進入乙太網口檢視  

4.6、undo shutdown 開啟乙太網埠

4.7、shutdown   關閉乙太網埠

4.8、quit  退出

4.9、vlan 10  建立vlan 10,並進入vlan 10的檢視模式

4.10、Port E1/0/2 to E1/0/5 在vlan模式下將指定埠加入到當前vlan中

4.11、dis ip routing-table  顯示當前路由表

4.12、

 

 

  1. 華為交換機如何刪除vlan-----先刪除加入VLAN的埠,再刪vlan

  undo interface VLAN_ID
undo VLAN_ID

  例如:[H3C]undo int vlan 20

[H3C]undo vlan 20

[H3C]undo int vlan 30

[H3C]undo vlan 30

刪除vlan20與vlan30,且原本預設全部都屬於vlan1的,是通過新建vlan劃分出去的,當刪除後自動迴歸預設的vlan1裡。