1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PNETlabでlabをダウンロードし、機器を起動・ログインする迄

Posted at

こんにちは。
株式会社クラスアクト インフラストラクチャ事業部の大塚です。

以前、ProxmoxVE上にPNETlabを作りました。以下がその手順となります。

早速操作感などを確認しており、コミュニティから用意されているlabをPNETlabにダウンロードしてlabを起動するまではすんなり行ったのですが、lab上の機械を起動・操作するためには追加で色々としないといけないようだったので、それを備忘録的な感じで残しておこうと思います。

困ったこと

PNETlabでダウンロードしたlabを起動しました。
※今回は以下のlabをダウンロードしております。

起動すると以下のような構成図が表示されるのですが、機器を起動しようとすると、起動した瞬間、勝手にシャットダウンしてしまう事象が確認できました。
機器の左下に赤■があるかと思いますが、起動後その状態に勝手に切り替わってしまうということです。

image (13).png

解消

PNETlabの公式を漁っていると以下がヒットしました。どうやらそれぞれの機器に対するイメージを別途ダウンロードする必要があるようです。

Device Start and stop immediately
Device Start and stop immediately because of some reasons:
I. You haven't downloaded the image yet
Right click on Node > Edit > You will see tag (INVALID) in Image field
To download Image, SSH to Pnetlab and use ishare to search and pull all missing images. Refer ishare

上記サイトを見るとishareコマンドでインストール出来る的なことを書いていますが、、2023/10/24現在、ishare→ishare2に変わったようで、以下サイトを参考にishare2コマンドをインストールしました。

root@pnetlab:~# curl -o /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/ishare2 > /dev/null 2>&1 && chmod +x /usr/sbin/ishare2 && ishare2
root@pnetlab:~# ls -ltr /usr/sbin/ishare2
-rwxr-xr-x 1 root root 99218 Oct 24 01:28 /usr/sbin/ishare2

さらにaria2というコマンドもインストールします。
これをインストールしていないとishare2でイメージをインストールしようとしてもエラーではじかれます。

root@pnetlab:~# apt update && apt upgrade -y
root@pnetlab:~# apt install aria2 -y

ちなみに、aria2をインストールしないと以下のようなエラーが出ます。

 [-] Error: aria2c is not installed. Attempting to install it...
E: GPG error: http://i-share.top/repo ./ Release: Signed file isn't valid, got 'NODATA' (does the network require authentication?)

各機器がどのイメージを使用しているかを確認するためには、labを開き対象の機器を右クリック→editを押下します。
image.png

画面上部のImageを確認します。これが機器のイメージとなり、インストールしたいものとなります。(INVALID)となっているとローカルにそのイメージが無いことを示しているようです。
image (14).png
イメージをインストールするために、内部的な番号が必要になるのでそれを確認します。ishare2 search (イメージ名)で確認できます。今回は11であることが確認できました。

root@pnetlab:~# ishare2 search GNS
===========
    BIN
===========
Number  Name                                                 Size   Unit
11      i86bi_linux-adventerprisek9-ms.154-1.T_AntiGNS3.bin  145.6  MB
Number of results: 1
To pull an image, use the following command: ishare2 pull bin <number>

インストールします。

root@pnetlab:~# ishare2 pull bin 11
Starting to download 1 file...
File requested: i86bi_linux-adventerprisek9-ms.154-1.T_AntiGNS3.bin
Size: 145.6 MB
Downloading from: https://drive.labhub.eu.org/0:/addons/iol/bin/i86bi_linux-adventerprisek9-ms.154-1.T_AntiGNS3.bin
 [+] Using aria2c for this download.
 [!] If you have problems with aria2, please reconfigure ishare2 running the following command: ishare2 config and choose wget instead of aria2.
 [+] Downloading file from https://drive.labhub.eu.org/0:/addons/iol/bin/i86bi_linux-adventerprisek9-ms.154-1.T_AntiGNS3.bin...
[#675811 143MiB/145MiB(98%) CN:1 DL:23MiB] [+] The file has been downloaded successfully to /opt/unetlab/addons/iol/bin/i86bi_linux-adventerprisek9-ms.154-1.T_AntiGNS3.bin.
i86bi_linux-adventerprisek9-ms.154-1.T_AntiGNS3.bin was downloaded successfully
 [+] Fix permissions command has been executed correctly

インストール後、再度labを見てみます。イメージの名前の部分から(INVALID)がなくなっていれば正常に読み込めています。この状態であれば機器が起動し、勝手にダウンすることもないはずです。
※もしダウンするようであればいったんlabを削除し、改めて起動してみてください。
image (15).png
機器を操作するためには機器をクリックしてください。
そうすると、以下のようなポップアップが表示されます。開くを押下してください。
image (16).png
CLIが立ち上がり、いつものネットワーク機器のように操作出来ました!
image (17).png

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?