Aller au contenu

HP H3C - Commandes

De TIC Enseignement Agricole BFC
Version datée du 1 février 2024 à 11:10 par Cv5lw (discussion | contributions) (1 version importée)
(diff) ← Version précédente | Version actuelle (diff) | Version suivante → (diff)


Remet à zéro la configuration

[modifier]
# reset saved-configuration backup
# reset saved-configuration main 

Désactiver le serveur web

[modifier]
<sysname>system-view
System View: return to User View with Ctrl+Z.
[sysname]ip http shutdown
[sysname]
%Apr  2 01:04:11:942 2000 sysname HTTPD/5/Log:- 1 -Close HTTP server.
%Apr  2 01:04:12:022 2000 sysname HTTPD/5/Log:- 1 -Stopped HTTP server. 

Lancer le serveur web

[modifier]
<sysname>system-view
System View: return to User View with Ctrl+Z.
[sysname]undo ip http shutdown
[sysname]
%Apr  2 01:04:48:529 2000 sysname HTTPD/5/Log:- 1 -Start HTTP server.

Désactive le http et active le https

[modifier]
# system view
# undo ip http enable
# ip https enable  

Désactive le serveur telnet

[modifier]
undo telnet server enable 
   

Met un user privilege

[modifier]
# Sur aux = 3, les autres = 0 

system-view
user-interface vty 0
user privilege level 0

Autoriser les consoles virtuelles 0 à 4 pour l'accès SSH.

[modifier]
<Sysname> system-view
[Sysname] user-interface vty 0 4
[Sysname-ui-vty0-4] authentication-mode scheme
[Sysname-ui-vty0-4] protocol inbound ssh

Modifie la date

[modifier]
# Set the current system time to 14:10:20 08/01/2011
<Sysname> clock datetime 14:10:20 8/1/2011
# Set the current system time to 00:06:00 01/01/2011.
<Sysname> clock datetime 0:6 2011/1/1  

Affiche la date

[modifier]
<Sysname> display clock
09:41:23 UTC Thu 12/15/2010 

Change le nom du switch

[modifier]
<Sysname> system-view
[Sysname] sysname S2000
[S2000] 


Retrouver le port où est branché un poste avec son adresse IP

[modifier]
<sysname>tracemac by-ip 192.168.0.2 
Tracing MAC address 50e5-4971-1234 in vlan 10: 

1 3822-d660-1234 sysname                         Ethernet1/0/37 
2 50e5-4971-1234        

Retrouver le poste où est branché un poste avec son adresse MAC et par le VLAN :

[modifier]
<sysname>tracemac by-mac 50e5-4971-922f vlan 10 
Tracing MAC address 50e5-4971-922f in vlan 10: 

1 3822-d660-1234 sysname                         Ethernet1/0/37 
2 50e5-4971-1234 

Ou  [H3C-Vlan-interface1] display mac-address 50e5-4971-1234
MAC ADDR        VLAN ID   STATE          PORT INDEX               AGING TIME(s)
50e5-4971-1234 1         Learned        Ethernet1/0/12           AGING 

Créer un utilisateur pour l’interface web

[modifier]
<sysname>system-view
System View: return to User View with Ctrl+Z.
[sysname]local-user admin
New local user added.
[sysname-luser-admin]service-type telnet level 3
[sysname-luser-admin]password simple admin
[sysname-luser-admin]
%Apr  2 01:07:01:516 2000 sysname WEB/5/USER:- 1 -admin(192.168.0.2) login succeed 

Affiche la configuration de tous les VLAN

[modifier]
<sysname>display vlan all 
VLAN ID: 1 
VLAN Type: static 
Route Interface: not configured 
Description: VLAN 0001 
Name: VLAN 0001 
Tagged   Ports: none 
Untagged Ports:  
Ethernet1/0/21          Ethernet1/0/22           Ethernet1/0/23  
Ethernet1/0/24          Ethernet1/0/25           Ethernet1/0/26  
Ethernet1/0/27          Ethernet1/0/28           Ethernet1/0/29  
Ethernet1/0/30          Ethernet1/0/31           Ethernet1/0/32  
Ethernet1/0/33          Ethernet1/0/34           Ethernet1/0/35  
Ethernet1/0/36          Ethernet1/0/38           Ethernet1/0/39  
Ethernet1/0/40          Ethernet1/0/41           Ethernet1/0/42  
Ethernet1/0/43          Ethernet1/0/44           Ethernet1/0/45  
Ethernet1/0/46          Ethernet1/0/47           Ethernet1/0/48  
GigabitEthernet1/1/1    GigabitEthernet1/1/2     GigabitEthernet1/1/3  
GigabitEthernet1/1/4  

VLAN ID: 2 
VLAN Type: static 
Route Interface: not configured 
Description: VLAN 0002
…
VLAN ID: 10 
VLAN Type: static 
Route Interface: configured 
IP Address: 192.168.0.1 
Subnet Mask: 255.255.255.0 
Description: test VLAN10 
Name: VLAN 0010 
Tagged   Ports: none 
Untagged Ports:   Ethernet1/0/37  

Affiche la configuration des vlan 10 a 15

[modifier]
<sysname>display vlan 10 to 15 
VLAN ID: 10 
VLAN Type: static 
Route Interface: configured 
IP Address: 192.168.0.1 
Subnet Mask: 255.255.255.0 
Description: test VLAN10 
Name: VLAN 0010 
Tagged   Ports: none 
Untagged Ports:  
Ethernet1/0/37  
 
VLAN ID: 11 
VLAN Type: static 
Route Interface: not configured 
Description: VLAN 0011 
Name: VLAN 0011 
Tagged   Ports: none 
Untagged Ports: none  

VLAN ID: 12 
VLAN Type: static 
Route Interface: not configured 
Description: VLAN 0012 
Name: VLAN 0012
…
VLAN ID: 15 
VLAN Type: static 
Route Interface: configured 
IP Address: 192.168.1.1 
Subnet Mask: 255.255.255.0 
Description: VLAN 0015 
Name: VLAN 0015 
Tagged   Ports: none 
Untagged Ports:  
Ethernet1/0/1            Ethernet1/0/2            Ethernet1/0/3  
Ethernet1/0/4            Ethernet1/0/5            Ethernet1/0/6  
Ethernet1/0/7            Ethernet1/0/8            Ethernet1/0/9  
Ethernet1/0/10           Ethernet1/0/11           Ethernet1/0/12  
Ethernet1/0/13           Ethernet1/0/14           Ethernet1/0/15  
Ethernet1/0/16           Ethernet1/0/17           Ethernet1/0/18  
Ethernet1/0/19           Ethernet1/0/20  

Affiche la configuration d’un seul vlan

[modifier]
<sysname>display vlan 15 
VLAN ID: 15 
VLAN Type: static 
Route Interface: configured 
IP Address: 192.168.1.1 
Subnet Mask: 255.255.255.0 
Description: VLAN 0015 
Name: VLAN 0015 
Tagged   Ports: none 
Untagged Ports:  
Ethernet1/0/1            Ethernet1/0/2            Ethernet1/0/3  
Ethernet1/0/4            Ethernet1/0/5            Ethernet1/0/6  
Ethernet1/0/7            Ethernet1/0/8            Ethernet1/0/9  
Ethernet1/0/10           Ethernet1/0/11           Ethernet1/0/12  
Ethernet1/0/13           Ethernet1/0/14           Ethernet1/0/15  
Ethernet1/0/16           Ethernet1/0/17           Ethernet1/0/18  
Ethernet1/0/19           Ethernet1/0/20 

Création d’un VLAN

[modifier]
<sysname>system-view
System View: return to User View with Ctrl+Z.
[sysname]vlan 10
[sysname-vlan10]description covlan
[sysname-vlan10]quit
[sysname]interface Vlan-interface 10
[sysname-Vlan-interface10]description gateway
[sysname-Vlan-interface10]quit
[sysname]quit
<sysname>display interface Vlan-interface 10
Vlan-interface10 current state :UP
Line protocol current state :UP
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 3822-d660-1234
Internet Address is 192.168.0.1/24 Primary
Description : gateway
The Maximum Transmit Unit is 1500 

Attribuer un vlan à un port en mode access

[modifier]

En mode access

<H3C>system-view
System View: return to User View with Ctrl+Z.
[H3C]interface Ethernet 1/0/22
[H3C-Ethernet1/0/22]port access vlan 15 
[H3C-Ethernet1/0/22]display vlan 15 
VLAN ID: 15 
VLAN Type: static 
Route Interface: not configured 
Description: Data 
Name: VLAN 0015 
Tagged   Ports: none 
Untagged Ports:  
Ethernet1/0/12           Ethernet1/0/22 

Attribuer une adresse IP au switch sur un VLAN

[modifier]
<sysname>system-view
System View: return to User View with Ctrl+Z.
[sysname]interface vlan-interface 15
[sysname-Vlan-interface15]ip address 192.168.2.1 255.255.255.0
[sysname-Vlan-interface1]display ip interface vlan 15
Vlan-interface15 current state :DOWN
Line protocol current state :DOWN
Internet Address is 192.168.2.1/24
Primary Broadcast address : 192.168.2.255
The Maximum Transmit Unit : 1500 bytes
IP packets input number: 0, bytes: 0, multicasts: 0
IP packets output number: 0, bytes: 0, multicasts: 0  

Afficher l’état et les vlan de toutes les interfaces

[modifier]
<sysname>display brief interface
Interface:
Eth  - Ethernet  GE   - GigabitEthernet TENGE - tenGigabitEthernet
Loop - LoopBack  Vlan - Vlan-interface  Cas   - Cascade
Speed/Duplex:
A - auto-negotiation 
Interface   Link     Speed  Duplex Type   PVID Description 
--------------------------------------------------------------------------------
Aux1/0/0    UP       --     --     --     --
Eth1/0/1    DOWN     A      A      access 15
Eth1/0/2    DOWN     A      A      access 15
Eth1/0/3    DOWN     A      A      access 15
Eth1/0/4    DOWN     A      A      access 15
Eth1/0/5    DOWN     A      A      access 15
Eth1/0/6    DOWN     A      A      access 15
Eth1/0/7    DOWN     A      A      access 15
Eth1/0/8    DOWN     A      A      access 15
Eth1/0/9    DOWN     A      A      access 15
Eth1/0/10   DOWN     A      A      access 15
Eth1/0/11   DOWN     A      A      access 15
Eth1/0/12   UP       A100M  Afull  access 15
Eth1/0/13   DOWN     A      A      access 15
Eth1/0/14   DOWN     A      A      access 15
Eth1/0/15   DOWN     A      A      access 15

Afficher l'état et les vlan de toutes les interfaces

[modifier]
<sysname>display brief interface 
Interface: Eth - Ethernet GE - GigabitEthernet TENGE - tenGigabitEthernet Loop - LoopBack Vlan - Vlan-interface Cas - Cascade Speed/Duplex: A - auto-negotiation Interface Link Speed Duplex Type PVID
Description -------------------------------------------------------------------------------- 
Aux1/0/0 UP -- -- -- -- 
Eth1/0/1 DOWN A A access 15 
Eth1/0/2 DOWN A A access 15 
Eth1/0/3 DOWN A A access 15 
Eth1/0/4 DOWN A A access 15 
Eth1/0/5 DOWN A A access 15  
Eth1/0/6 DOWN A A access 15 
Eth1/0/7 DOWN A A access 15 
Eth1/0/8 DOWN A A access 15
Eth1/0/9 DOWN A A access 15 
Eth1/0/10 DOWN A A access 15 
Eth1/0/11 DOWN A A access 15 
Eth1/0/12 UP A100M Afull access 15 
Eth1/0/13 DOWN A A access 15 
Eth1/0/14 DOWN A A access 15 
Eth1/0/15 DOWN A A access 15

Met un port en trunk

[modifier]
<sysname>   system-view
System View: return to User View with Ctrl+Z.
[sysname]interface ethernet 1/0/11
[sysname-Ethernet1/0/11]port link-type ? 
 access      Access link-type 
 hybrid      Hybrid VLAN link-type 
 irf-fabric  Fabric-port link-type 
 trunk       VLAN trunk link-type 
[sysname-Ethernet1/0/11]port link-type trunk 

[sysname-Ethernet1/0/11]display brief interface Ethernet 1/0/11
Interface: Eth  - Ethernet  GE   - GigabitEthernet TENGE - tenGigabitEthernet
Loop - LoopBack  Vlan - Vlan-interface  Cas   - Cascade
Speed/Duplex:
A - auto-negotiation 

Interface   Link     Speed  Duplex Type   PVID Description
-------------------------------------------------------------------------- 
Eth1/0/11   DOWN     A      A      trunk  1 

Met un port en hybrid

[modifier]
[sysname]interface ethernet 1/0/13
[sysname-Ethernet1/0/13]port link-type hybrid
[sysname-Ethernet1/0/13]display brief interface eth 1/0/13
Interface:
Eth  - Ethernet  GE   - GigabitEthernet TENGE - tenGigabitEthernet
Loop - LoopBack  Vlan - Vlan-interface  Cas   - Cascade
Speed/Duplex:
A - auto-negotiation  Interface   Link     Speed  Duplex Type   PVID Description
---------------------------------------------------------------------------
Eth1/0/13   UP       A100M  Afull  hybrid 1  

On assigne ensuite les vlan, attention à l’enlever du vlan 1 !!

[H3C-Ethernet1/0/13]port hybrid vlan 10 tagged
[H3C-Ethernet1/0/13]port hybrid vlan 15 untagged
[H3C-Ethernet1/0/13]undo port hybrid vlan 1
[H3C-Ethernet1/0/13]display interface Ethernet 1/0/13
… 
Port link-type: hybrid 
 Tagged 
 VLAN ID : 10 
 Untagged VLAN ID : 15
… 

Redémarrer le switch sans sauvegarder la configuration

[modifier]
<sysname>reboot 
Start to check configuration with next startup configuration file, 
please wait...... 
This command will reboot the device. Current configuration may be lost in next startup if you continue.  
Continue? [Y/N] Y 
This will reboot device. Continue? [Y/N] Y
#Apr  2 01:30:49:706 2000 sysname COMMONSY/5/REBOOT:- 1 - 
Reboot Fabric by command. 

Afficher des informations sur le système

[modifier]
<H3C>display users      
  UI    Delay     Type   Ipaddress       Username        Userlevel
F 0   AUX 0   00:00:00                                             3 

+   : Current operation user. 
F   : Current operation user work in async mode. 
<H3C>display version
H3C Comware Platform Software
Comware Software, Version 3.10, Release 1702P03
Copyright (c) 2004-2010 Hangzhou H3C Technologies Co., Ltd. All rights reserved.
H3C S3600-52P-PWR-EI uptime is 0 week, 0 day, 0 hour, 3 minutes 

H3C S3600-52P-PWR-EI with 1 Processor
64M     bytes DRAM
16384K  bytes Flash Memory
Config Register points to FLASH

Software Encryption Mode is 3DES
Hardware Version is REV.B
CPLD Version is CPLD 002
Bootrom Version is 605
[Subslot 0] 48 FE Hardware Version is REV.B
[Subslot 1] 4 GE  Hardware Version is REV.B 
<H3C>display power
Unit 1 
 power    1 
 State    : Normal 
 Type     : AC 
 power    2 
 State    : Absent 
 Type     : DC 
<H3C>display cpu
Unit 1
Board 0
CPU busy status: 
   17% in last 5 seconds   
   15% in last 1 minute 
   22% in last 5 minutes 
<H3C>display memory
Unit 1
System Available Memory(bytes): 29817216
System Used Memory(bytes): 16977724
Used Rate: 56%  

Configuration d’un switch H3C S3600 Series avec un VLAN Voix

[modifier]
Dans cette configuration, nous avons mis en place deux VLANs : 
  • Vlan 510 = réservé à la data
  • Vlan 1101 = réservé à la voix

Nous allons affecter le port 5 du switch en tant que Data seulement et le port 6 en tant que Data + Voice

Voici donc l’enchaînement des commandes pour créer les VLAN et mettre en place le mode voice:

<H3C>system-view
System View: return to User View with Ctrl+Z.
[H3C]vlan 510
[H3C-vlan510]name Data
[H3C-vlan510]quit
[H3C]vlan 1101
[H3C-vlan1101]name VoIP
[H3C-vlan1101]quit
[H3C]voice vlan 1101 enable
[H3C]display vlan 510 
 VLAN ID: 510 
 VLAN Type: static 
 Route Interface: not configured
 Description: VLAN 0510
 Name: Data
 Tagged   Ports: none
 Untagged Ports: none 
[H3C]display vlan 1101 
 VLAN ID: 1101
 VLAN Type: static
 Route Interface: not configured
 Description: VLAN 1101
 Name: VoIP
 Tagged   Ports: none
 Untagged Ports: none  

Voici l’enchaînement de commande pour configurer un port sur le VLAN VoIP et le VLAN Data, dans le cas du port ayant la Voix, il faut impérativement passer le port en tant qu’hybrid sinon le switch n’est capable que d’attribuer qu’un seul VLAN au port. Lorsque nous passons le port en hybrid, il faut aussi impérativement supprimer

<H3C>system-view
System View: return to User View with Ctrl+Z. 
[H3C]interface Ethernet 1/0/5
[H3C-Ethernet1/0/5]port access vlan 510
[H3C-Ethernet1/0/5]quit

[H3C]interface Ethernet 1/0/6 
[H3C-Ethernet1/0/6]port link-type hybrid
[H3C-Ethernet1/0/6]port hybrid vlan 510 untagged
[H3C-Ethernet1/0/6]port hybrid vlan 1101 tagged
[H3C-Ethernet1/0/6]undo port hybrid vlan 1
[H3C-Ethernet1/0/6]quit

[H3C]display interface Ethernet 1/0/5
 Ethernet1/0/5 current state : DOWN
…
 Port link-type: access
  Tagged   VLAN ID : none
  Untagged VLAN ID : 510 

[H3C]display interface Ethernet 1/0/6
 Ethernet1/0/6 current state : DOWN 
…
Port link-type: hybrid
  Tagged   VLAN ID : 1101
  Untagged VLAN ID : 510

Liens des documentations

[modifier]

Les documentations sont disponibles à cette adresse : http://www.h3c.com/portal/Technical_Support___Documents/Technical_Documents/Switches/H3C_S3600_Series_Switches/