[Network] HP交換器指令集 – HP Switch Commands

基礎查詢儲存

  • Enable mode

    <HP>system 
    
  • 顯示儲存在記憶體中的當前設定檔,如ports, vlan, group,對應cisco show running-configuration

    [HP]display current-configuration 
    
  • 顯示儲存在非揮發性記憶體(NVRAM)的設定檔,對應cisco show startup-configuration

    [HP]display startup-configuration
    
  • 儲存設定檔(Restart時才會維持)

    [HP]save 
    
  • 顯示現有階層下的狀態

    [HP]display this 
    
  • 顯示LACP目前狀態

    [HP]dis link-aggregation summary
    
  • 顯示版本

    [HP]dis version
    
  • 變更名稱

    [HP]sysname XXX
    

設定SW IP address及Gateway

  • 進入vlan1

    [HP]interface vlan-interface 1 
    [HP-Vlan-interface1]ip address x.x.x.x x.x.x.x
    [HP-Vlan-interface1]save
    [HP-Vlan-interface1]quit
    
  • 直接不進入vlan,完成一組vlan設定

    [HP]ip route-static 0.0.0.0 0.0.0.0 Vlan-interface 1 192.168.1.254 
    

啟用Terminal服務

<HP>system
[HP]user-interface vty 0 4
[HP-ui-vty0-4]authentication-mode password
[HP-ui-vty0-4]set authentication password cipher xxxxx
[HP-ui-vty0-4]user privilege level 3
[HP-ui-vty0-4]quit
[HP]telnet server enable

以interface 方式設定Vlan

[HP]interface gi 1/0/1
[HP-GigabitEthernet1/0/1]port link-type access
[HP-GigabitEthernet1/0/1]port access vlan 100

以vlan 方式設定Vlan

<HP>system
[HP]vlan 2
[HP-vlan2]port gi 1/0/3
[HP-vlan3]port gi 1/0/4 to gi 1/0/10
[HP-vlan3]quit

回復原廠預設值

<HP>reset saved-configuration
<HP>reset saved-configuration backup
<HP>reboot

設定Trunk port及於port中設定access vlan

[hptest-GigabitEthernet1/0/1]port link-type trunk
[hptest-GigabitEthernet1/0/1]port trunk permit vlan all
[hptest-GigabitEthernet1/0/1]port trunk pvid vlan 2 
//在trunk模式底下只能有一個untagged的vlan

網路聚合 – Link Aggregation (Link Bundling)

以設定光纖模組的 port 25,26 trunk 為例:

[HP]interface Bridge-Aggregation ?
<1-26> Bridge-Aggregation interface number
[HP]interface Bridge-Aggregation 1
[HP-Bridge-Aggregation1]link-aggregation mode dynamic
[HP-Bridge-Aggregation1]quit
[HP]interface GigabitEthernet 1/0/25
[HP-GigabitEthernet1/0/25]port link-aggregation group 1
[HP-GigabitEthernet1/0/25]quit
[HP]interface GigabitEthernet 1/0/26
[HP-GigabitEthernet1/0/26]port link-aggregation group 1
[HP-GigabitEthernet1/0/26]quit
[HP]interface Bridge-Aggregation 1
[HP-Bridge-Aggregation1]port link-type trunk
[HP-Bridge-Aggregation1]port trunk permit vlan all

Reference: https://www.lazyfu.com/2016/08/25/switch-command/

One thought on “[Network] HP交換器指令集 – HP Switch Commands

  1. Hi! Ⅰ’m at work browsing youг blog from my new iphone!
    Just wanted to sаy I love reading through your blog and look
    forward to all your posts! Keep up the eҳсellent
    work!

Leave a Reply

Your email address will not be published. Required fields are marked *