LoginSignup
0
1

More than 3 years have passed since last update.

Power Systems Virtual Server on IBM Cloud (AIX) で VLAN が正しく構成されているか確認する

Last updated at Posted at 2020-03-05

はじめに

Power Systems Virtual Server on IBM Cloud (AIX) でネットワークがつながらない等の問題に直面した場合に参考にしてください。

必要情報の取得

該当リージョンに ibmcloud コマンドでログイン

ダラスなら us-south 、ワシントンなら us-east といったように指定してログインします。

export REGION="us-east"
echo $REGION
ibmcloud login -r $REGION

アカウント ID の取得

以下のコマンド、または https://cloud.ibm.com/account/settings から取得できます。

export TENANT_ID=`ibmcloud account show | grep ID | awk '{print $3}'`
echo $TENANT_ID

Power Systems Virtual Server サービスインスタンス情報

以下のコマンド、または https://cloud.ibm.com/resources から取得できます。

export SERVICE_INSTANCE="khayama-power"
echo $SERVICE_INSTANCE
export CRN=`ibmcloud resource service-instance $SERVICE_INSTANCE | grep crn | awk '{print $2}'`
echo $CRN
export GUID=`ibmcloud resource service-instance $SERVICE_INSTANCE | grep GUID | awk '{print $2}'`
echo $GUID

Kobito.fmxYvg.png

IAM アクセストークン取得

IBM Cloud API アクセスの認証に必要です。

export ACCESS_TOKEN=`ibmcloud iam oauth-tokens | head -n 1 | awk '{print $4}'`
echo $ACCESS_TOKEN

cloudInstanceId の取得

Power Systems Virtual Server の情報を API 経由で取得するために必要です。

export CLOUDINSTANCE_ID=` \
curl -X GET \
"https://$REGION.power-iaas.cloud.ibm.com/pcloud/v1/tenants/$TENANT_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "CRN: $CRN" \
-H 'Content-Type: application/json' \
| jq -r '.cloudInstances | .[] | select (.name=="'$GUID'") | .cloudInstanceID' \
`
echo $CLOUDINSTANCE_ID

VLAN ID の確認

Power Systems Virtual Server サービス情報

以下のコマンドで、 Power Systems Virtual Server のネットワークに割り当てられた VLAN ID が確認できます。

curl -X GET \
"https://$REGION.power-iaas.cloud.ibm.com/pcloud/v1/cloud-instances/$CLOUDINSTANCE_ID/networks" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "CRN: $CRN" \
-H 'Content-Type: application/json' \
| jq .
result.json
{
  "networks": [
    {
      "href": "/pcloud/v1/cloud-instances/59ebd87b4f0440188eb1e1e6b4e1bdd4/networks/3018e801-aedc-49ed-9f8c-a36aba02c963",
      "name": "public-192_168_3_192-28-VLAN_2028",
      "networkID": "3018e801-aedc-49ed-9f8c-a36aba02c963",
      "type": "pub-vlan",
      "vlanID": 2028
    },
    {
      "href": "/pcloud/v1/cloud-instances/59ebd87b4f0440188eb1e1e6b4e1bdd4/networks/5e7ee5c5-725c-40f8-a5f9-313dfa175dc4",
      "name": "khayama-subnet",
      "networkID": "5e7ee5c5-725c-40f8-a5f9-313dfa175dc4",
      "type": "vlan",
      "vlanID": 333
    }
  ]
}

AIX OS 内部情報

以下のコマンドで、 AIX のインターフェースデバイスに割り当てられた VLAN ID が確認できます。

check_vlan.sh
*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 7.2!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************

# entstat -d ent0 | grep VLAN
Invalid VLAN ID Packets: 0
Port VLAN ID:  2028
VLAN Tag IDs:  None

# entstat -d ent1 | grep VLAN
Invalid VLAN ID Packets: 0
Port VLAN ID:   333
VLAN Tag IDs:  None

# entstat -d ent2 | grep VLAN
Invalid VLAN ID Packets: 0
Port VLAN ID:  4094
VLAN Tag IDs:  None

参考

0
1
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
0
1