안녕하세요.
오늘은 PNETLab에 ishare command에 대해서 알아보겠습니다.
EVE-NG는 시뮬레이션 이미지를 직접 다운로드 받아서 EVE-NG에 업로드 해야합니다.
하지만 PNETLab는 자체적으로 시뮬레이션 이미지 파일을 제공합니다.
ishare command 통해서 다운로드 가능 합니다.
putty를 통해서 pnetlab에 접속 합니다.
root@pnetlab:~# ishare search Usage ishare [action] [param] action: search : Search images pull : Download image detail : Detail information of image help : Show this help page Example - ishare search vios - ishare pull vios-3.4.5 - ishare detail vios-3.4.5 root@pnetlab:~# |
ishare search 2019 검색해보겠습니다.
root@pnetlab:~# ishare search 2019 <html><body><h1>403 Forbidden</h1> Request forbidden by administrative rules. </body></html> Traceback (most recent call last): File "ishare.py", line 118, in <module> File "ishare.py", line 112, in main File "ishare.py", line 82, in search TypeError: 'bool' object has no attribute '__getitem__' |
등등 에러 메시지가 발생 합니다. 구글에 검색해보니 ishare제대로 동작안되는거 같습니다.
ishare2를 설치해서 사용 하면 정상적으로 작동합니다.
wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/ishare2-org/ishare2-cli/main/ishare2 > /dev/null 2>&1 && chmod +x /usr/sbin/ishare2 && ishare2 |
ishare2가 설치 됩니다.
그냥 디폴트값으로 사용하면 되기때문에 그냥 Enter만 입력합니다.
┌────────────────────────────────────────────────────────────────────────┐ │ Welcome to the ishare2 configuration wizard. │ │ - This wizard will guide you through the configuration process. │ │ - Press Enter to accept the default value. │ │ - You can modify the configuration later by running: ishare2 config. │ │ - Press Ctrl+C to cancel. │ └────────────────────────────────────────────────────────────────────────┘ [+] Use aria2c for faster downloads? (default: no) [+] (y/n): [+] Check SSL certificate? (default: yes) [+] (y/n): [+] Choose the update channel. 1) alpha 2) beta 3) main [*] Enter the number of the branch you want to use (default: main): [!] Using the default branch. [+] Choose a mirror. (default: Rotate mirrors) 1) Rotate mirrors (recommended) 2) Google Drive mirror 3) Onedrive mirror 4) Custom mirror [*] Enter the number of the mirror you want to use (default: 1): [!] ishare2 will rotate among the available mirrors. ┌─────────────────────────────────────────────────────────────┐ │ Configuration completed successfully. │ │ You can start using ishare2! │ │ [!] IMPORTANT NOTICES: │ │ - ishare2 is a free and open-source project. If you paid │ │ for it, you have been scammed. │ │ - Do not download ishare2 from unofficial sources as they │ │ may contain arbitrary code. │ └─────────────────────────────────────────────────────────────┘ ┌────────────────────────────────────────────────────────────────┐ │ MOTD from the ishare2 team: │ │ Changelog: │ │ - Fixed bug when doing integrity checks againts qemu images. │ │ │ │ Telegram: https://t.me/NetLabHub │ │ Donate: https://buymeacoffee.com/sudoalex │ │ GitHub: https://github.com/ishare2-org/ishare2-cli │ └────────────────────────────────────────────────────────────────┘ Syntax ishare2 [action] [param1] [param2] [--overwrite] action: search : Search for images available on LabHub mirrors. pull : Download an image by specifying the type and id. installed : Shows images installed on the server. labs : Shows available labs and downloads the images for the selected lab. mylabs : Same as labs command but you can use a customized path. relicense : Generates an iourc license for iol images. upgrade : Shows a menu to upgrade ishare2 or PNETLab. test : Test internet connectivity to required sites. help : Shows full help information. param1: type = all, iol, qemu, dynamips, docker or name. param2: id = This can be obtained using ishare2 search <type> --overwrite: Used to overwrite an existing image if it already exists on your system. Try: ishare2 help for more information. |
ishare2명령어로 2019 이미지를 검색합니다.
제대로 검색 됩니다.
root@pnetlab:~# ishare2 search 2019 ┌────────────────────────────────────────────────────────────────┐ │ MOTD from the ishare2 team: │ │ Changelog: │ │ - Fixed bug when doing integrity checks againts qemu images. │ │ │ │ Telegram: https://t.me/NetLabHub │ │ Donate: https://buymeacoffee.com/sudoalex │ │ GitHub: https://github.com/ishare2-org/ishare2-cli │ └────────────────────────────────────────────────────────────────┘ ============================= Available QEMU images ============================= ID NAME SIZE -- ---- ---- 605 linux-kali-large-2019.3 11.8 GiB 606 linux-kali-large-2019.3 4.2 GiB 607 linux-kali-large-2019.3 4.2 GiB 933 viosl2-adventerprisek9-m-v152_6_0_81_e-20190423 39.2 MiB 935 viosl2-adventerprisek9-m.ssa.high_iron_20190423 42.9 MiB 1220 winserver-2019 7.6 GiB 1226 winserver-S2019-R2-x64-rev3 6.0 GiB 7 QEMU images found for the term: "2019" ============================ Available IOL images ============================ ID NAME SIZE -- ---- ---- 10 i86bi_Linux-L2-Adventerprisek9-ms.SSA.high_iron_20190423.bin 120.4 MiB 17 i86bi_linux_l2-adventerprisek9-ms.SSA.high_iron_20190423.bin 120.4 MiB 18 i86bi_linux_l2-adventerprisek9-ms.SSA.high_iron_20190423.bin 120.4 MiB 3 IOL images found for the term: "2019" ================================= Available DYNAMIPS images ================================= ID NAME SIZE -- ---- ---- No DYNAMIPS images found for the term: "2019" root@pnetlab:~# ^C |
저는 vios 이미지를 다운로드 받아서 설치해보겠습니다.
설치 방법
Usage: ishare2 pull <type> <id>
ishare2 pull <type> all
Types: qemu, iol, dynamips
우선 검색을 합니다.
ishare2 search vios
root@pnetlab:~# ishare2 search vios ┌────────────────────────────────────────────────────────────────┐ │ MOTD from the ishare2 team: │ │ Changelog: │ │ - Fixed bug when doing integrity checks againts qemu images. │ │ │ │ Telegram: https://t.me/NetLabHub │ │ Donate: https://buymeacoffee.com/sudoalex │ │ GitHub: https://github.com/ishare2-org/ishare2-cli │ └────────────────────────────────────────────────────────────────┘ ============================= Available QEMU images ============================= ID NAME SIZE -- ---- ---- 918 vios-15.5.3M 122.0 MiB 919 vios-adventerprisek9-m-15.4-1.3.0-181 116.0 MiB 920 vios-adventerprisek9-m-15.6.2T 122.5 MiB 921 vios-adventerprisek9-m.SPA.154-3M8 116.4 MiB 922 vios-adventerprisek9-m.SPA.159-3.M2 46.9 MiB 923 vios-adventerprisek9-m.SPA.159-3.M3 54.6 MiB 924 vios-adventerprisek9-m.SPA.159-3.M3 54.2 MiB 925 vios-adventerprisek9-m.SPA.159-3.M4 54.1 MiB 926 vios-adventerprisek9-m.SPA.159-3.M6 54.2 MiB 927 vios-adventerprisek9-m.spa.158-3.m2 54.0 MiB 928 vios-adventerprisek9-m.spa.159-3.m2 47.4 MiB 929 vios-adventerprisek9-http://m.vmdk.SPA.157-3.M3 49.8 MiB 930 viosl2-15.2.4.55e 92.4 MiB 931 viosl2-adventerpriseK9-M_152_May_2018 102.2 MiB 932 viosl2-adventerprisek9-m-15.2.4055 92.4 MiB 933 viosl2-adventerprisek9-m-v152_6_0_81_e-20190423 39.2 MiB 934 viosl2-adventerprisek9-m.SSA.high_iron_20180619 42.5 MiB 935 viosl2-adventerprisek9-m.ssa.high_iron_20190423 42.9 MiB 936 viosl2-adventerprisek9-m.ssa.high_iron_20200929 85.6 MiB 19 QEMU images found for the term: "vios" ============================ Available IOL images ============================ ID NAME SIZE -- ---- ---- No IOL images found for the term: "vios" ================================= Available DYNAMIPS images ================================= ID NAME SIZE -- ---- ---- No DYNAMIPS images found for the term: "vios" root@pnetlab:~# |
저는 아래처럼 rotuer이미지 한개, switch 이미지 한개를 설치 하겠습니다.
ID NAME SIZE
-- ---- ----
926 vios-adventerprisek9-m.SPA.159-3.M6 54.2 MiB
932 viosl2-adventerprisek9-m-15.2.4055 92.4 MiB
root@pnetlab:~# ishare2 pull qemu 926 [!] IMAGE INFO - Image Name : vios-adventerprisek9-m.SPA.159-3.M6 - Image Size : 54.2 MiB - Image Type : QEMU - Image ID : 926 - Image path : /opt/unetlab/addons/qemu/vios-adventerprisek9-m.SPA.159-3.M6 - Using host : https://labhub.eu.org [!] DOWNLOADING IMAGE /opt/unetlab/addons/qemu/vi 100%[===========================================>] 54.17M 9.17MB/s in 7.7s [+] DOWNLOAD COMPLETED! [-] Extracting: vios-adventerprisek9-http://m.SPA.159-3.M6.tgz file... [+] Extracted: /opt/unetlab/addons/qemu/vios-adventerprisek9-m.SPA.159-3.M6. Image ready to use. [-] Fixing permissions... [+] Fix permissions command has been executed correctly |
root@pnetlab:~# ishare2 pull qemu 932 [!] IMAGE INFO - Image Name : viosl2-adventerprisek9-m-15.2.4055 - Image Size : 92.4 MiB - Image Type : QEMU - Image ID : 932 - Image path : /opt/unetlab/addons/qemu/viosl2-adventerprisek9-m-15.2.4055 - Using host : https://drive.labhub.eu.org [!] DOWNLOADING IMAGE /opt/unetlab/addons/qemu/vi 100%[===========================================>] 92.38M 7.03MB/s in 12s [+] DOWNLOAD COMPLETED! [-] Fixing permissions... [+] Fix permissions command has been executed correctly root@pnetlab:~# |
이제 PNETLab GUI접속 합니다.
정상적으로 동작 합니다.
지금까지 [PNETLab][#2]- ishare command 글을 읽어주셔서 감사합니다.
'PNETlab' 카테고리의 다른 글
[PNETLab][#1]- Installation on VMware workstation (0) | 2024.12.27 |
---|