LoginSignup
31
46

More than 1 year has passed since last update.

HPEスイッチ(旧H3C)シリーズ 設定別コマンド早見表

Last updated at Posted at 2016-09-19

##概要
旧H3C、現HPEのスイッチ(HPスイッチの一時はAシリーズとも呼ばれていた)のコマンド早見表です。これさえあればとりあえずの設定は完璧です。(おそらく)
comwareなスイッチならおそらく他機種でもOKかも?

基本設定

基本操作

  • 消すときはundo
  • 見るときはdisplay
  • 保存はsave

管理者になる

system-view

ホスト名を変える

sysname sw01
(sw01にホスト名を設定する)

リモートから入るための設定(Telnet/SSH)

telnet server enable
ssh server enable

Web管理画面を表示する

ip http enable

timezone設定

clock timezone #Web#9#01 add 09:00:00

NTP設定

ntp-service source-interface Vlan-interface1
ntp-service unicast-server 210.173.160.57
ntp-service unicast-server 210.173.160.87

管理用のユーザーを作成

local-user admin
password simple password
authorization-attribute level 3  <-level 3が最高権限
service-type ssh telnet terminal <-これを入れるとWEBもOK
service-type portal
service-type web

現在のconfigを見る

display current-configuration

ネットワーク設定

## VLANインターフェース作成
interface Vlan-interface1
ip address 172.21.0.1 255.255.255.0**

デフォルトゲートウェイ設定

ip route-static 0.0.0.0 0.0.0.0 172.21.0.254

コンソールパスワード設定

user-interface vty 0
authentication-mode password
set authentication password simple pw1234

※irfスタックを設定している場合、ノード2はvty1となる。
 上記だと、vty0はパスワードを聞いてくるが、ノード2からだとスルーで行けるので、スタックメンバー分上記のコマンドを投げるとよい

##irfを使う(バーチャルスタック)

  1. まずは、irfで利用するポートをshutdownする
interface GigabitEther1/0/25
shutdown
int GE1/0/26
shutdown 
int GE1/0/27
shutdown
int GE1/0/28
shutdown
  1. "1"をマスターにするために優先度を設定
irf member 1 priority 10
  1. グループメンバーにする
irf-port 1/1
port group interface GigabitEthernet1/0/25 mode normal
port group interface GigabitEthernet1/0/26 mode normal

quit
irf-port 1/2
port group interface GigabitEthernet1/0/27 mode normal
port group interface GigabitEthernet1/0/28 mode normal
quit
  1. irfをアクティブ化する
irf-port-configuration active
  1. ノード2を設定
irf member 1 renumber 2 <-スイッチボックス番号(ID)を変更
quit
reboot
  1. ポートを落とす
interface GigabitEther2/0/25
shutdown
int GE2/0/26
shutdown 
int GE2/0/27
shutdown
int GE2/0/28
shutdown
  1. irfのグループ2で作成する
irf-port 2/1 <-これを1/2とかにするとおかしくなるので注意
port group interface GigabitEthernet2/0/25 mode normal
port group interface GigabitEthernet2/0/26 mode normal
irf-port 2/2
port group interface GigabitEthernet2/0/27 mode normal
port group interface GigabitEthernet2/0/28 mode normal
  1. ポートをあげる
interface GigabitEther2/0/25
undo shutdown
int GE2/0/26
undo shutdown 
int GE2/0/27
undo shutdown
int GE2/0/28
undo shutdown

最後にirfをactiveにする

irf-port-configuration active

irfの状況確認

display irf
display irf configuration

VLAN設定

vlan 10 
name VLAN-NAME
port GE1/0/1

LAG作成

interface Bridge-Aggregation 1
port link-type trunk
port trunk permit vlan 10 to 20 
link-aggregation mode dynamic (LACPモードの場合)
quit
interface Gi 1/0/23
port link-aggregation group 1
port link-aggregation group 1

Channelに対して、port trunk permit vlan allでエラーが出る場合、グループに属しているポートがport link-type trunkになっていない可能性が高い!

VLANをポートに割り当てる(untag)

interface GigabitEthernet 1/0/23
port link-type access
port access vlan vid

VLANをポートに割り当てる(802.1q)

interface GigabitEthernet 1/0/23
port link-type trunk
port trunk permit vlan all
port trunk pvid XYZ #意図的にNativeVLANを設定する場合

SSHで入られるようにする

KEY作成

public-key local create rsa
public-key local create dsa

vtyでパスワード認証を有効化にし、Terminalでスキーマーモードを有効にする

user-interface vty 1 4
 authentication-mode scheme
protocol inbound all
quit

ポートの情報を確認する

display interface brief

ミラーポートの設定

ミラーグループを作成する

mirroring-group 1 local
みたいポートを選択する
複数ポート選択可能。

  • bothは、全パケット
  • INだけであれば、inbound
  • OUTだけであれば、outboud
mirroring-group 1 mirroring-port Ethernet 1/0/5 Ethernet 1/0/6 both

###モニターポートを設定する

mirroring-group 1 monitor-port Ethernet 1/0/1

ミラーポートの設定内容を確認する

display mirroring-group all

ループ防止機能を有効化する

loopback-detection enable
loopback-detection multi-port-mode enable #さらにしたのスイッチでループしている場合求める
loopback-detection interval-time 5 #5秒間ループしていたら止める

各インターフェースにも設定を入れる

loopback-detection enable
loopback-detection control enable
loopback-detection action shutdown #blockでもよい shutdownの場合は手動でundo shutしない限り復旧しない

ループしているかを確認する

display loopback-detection

Ciscoライクに使う

コマンド置換法

業界標準な、showやenableを利用可能にする

command-alias mapping display show
command-alias enable
command-alias mapping undo no
command-alias mapping quit exit

確認系

デバイス情報を確認する

本体のファームウェアー情報やシリアル番号を確認する

display device verbose

インターフェースのリンクアップ状態を確認する

display interface brief

VLANごとの所属するインターフェースの確認

display vlan all

本体ので型番やシリアルナンバーを確認する

display device manuinfo

Config確認時に more を表示させず一括でコマンドを表示する方法

管理(特権)モードではない状態で実行

screen-length disable

###初期化する(コンソールにログインできる場合)

reset saved-configuration
reset

reset時に聞かれたらNで、既存コマンドは保存しないこと。

31
46
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
31
46