diff --git a/iol/bin/CiscoIOUKeygen.py b/iol/bin/CiscoIOUKeygen.py new file mode 100644 index 0000000..ade5fdf --- /dev/null +++ b/iol/bin/CiscoIOUKeygen.py @@ -0,0 +1,33 @@ +#! /usr/bin/python +print "\n*********************************************************************" +print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version" +import os +import socket +import hashlib +import struct +# get the host id and host name to calculate the hostkey +hostid=os.popen("hostid").read().strip() +hostname = socket.gethostname() +ioukey=int(hostid,16) +for x in hostname: + ioukey = ioukey + ord(x) +print "hostid=" + hostid +", hostname="+ hostname + ", ioukey=" + hex(ioukey)[2:] +# create the license using md5sum +iouPad1='\x4B\x58\x21\x81\x56\x7B\x0D\xF3\x21\x43\x9B\x7E\xAC\x1D\xE6\x8A' +iouPad2='\x80' + 39*'\0' +md5input=iouPad1 + iouPad2 + struct.pack('!L', ioukey) + iouPad1 +iouLicense=hashlib.md5(md5input).hexdigest()[:16] +with open('/opt/unetlab/addons/iol/bin/iourc', 'w') as f: + f.write("[license]\n" + hostname + " = " + iouLicense + ";\n") +# add license info to $HOME/.iourc +print "\n*********************************************************************" +print "Create the license file $HOME/.iourc with this command:" +print "\nThe command adds the following text to $HOME/.iourc:" +print "[license]\n" + hostname + " = " + iouLicense + ";" +# disable phone home feature +print "\n*********************************************************************" +print "Disable the phone home feature with this command:" +print " grep -q -F '127.0.0.1 xml.cisco.com' /etc/hosts || echo '127.0.0.1 xml.cisco.com' | sudo tee -a /etc/hosts" +print "\nThe command adds the following text to /etc/hosts:" +print "127.0.0.1 xml.cisco.com" +print "\n*********************************************************************" diff --git a/iol/bin/keepalive.pl b/iol/bin/keepalive.pl new file mode 100644 index 0000000..acd7ecb --- /dev/null +++ b/iol/bin/keepalive.pl @@ -0,0 +1,78 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Getopt::Long; +use IO::Socket; +use threads; + +my $uid; +my $iou_instance; +my $pseudo_instance; +my $iou_interface; +my $pseudo_instance_interface; +my $iou_linkstate_sock; +my $t1; +my $ls_header; +my $ls_base; +my $inteface_name; + +GetOptions( + 'i=i' => \$iou_instance, + 'p=i' => \$iou_interface, + 'n=s' => \$inteface_name, +); + +$pseudo_instance = $iou_instance + 512; +$pseudo_instance_interface = $iou_interface; + +$uid = $ENV{SUDO_UID}; +$uid = $< unless ( defined $uid ); # apparently not started with sudo +print "UID: $uid\n"; +$ls_base = "/tmp/netl1$uid"; + # linkstate headers are the same as the IOU header above, + # except for the delimiter which is always 0x0003 + +# provide a clean exit +$SIG{INT} = \&caught_sigint; + +$ls_header = pack( "nnCCH4", + $iou_instance, + $pseudo_instance, + $iou_interface, + $pseudo_instance_interface, + "0300" ); + +##connect to socket iol linkstate socket +$iou_linkstate_sock = IO::Socket::UNIX->new( + Type => SOCK_DGRAM, + Peer => "$ls_base/L1$iou_instance" +) or die "Can't connect to IOU socket at $ls_base/L1$iou_instance\n"; +print "Attached to real IOU Linkstate socket at $ls_base/L1$iou_instance\n" ; +$t1 = threads->create( \&linkstate_thread ); +$t1->join(); + +sub linkstate_thread { + print "Send"; + # prepare for exitting later + $SIG{'KILL'} = sub { threads->exit(); }; + + # packet capture between 2 IOU shows that the linkstate packets + # are fired every second + while (1) { + print "Send"; + $iou_linkstate_sock->send( + pack( "a*", $ls_header ) ); + sleep(1); + } +} + +sub caught_sigint { + print "\n...stopped.\n"; + print "Cleaning up.\n"; + $t1->kill('KILL')->detach(); +} + + + + diff --git a/releases/4.2.10/ishare2 b/releases/4.2.10/ishare2 new file mode 100644 index 0000000..0e5828e Binary files /dev/null and b/releases/4.2.10/ishare2 differ diff --git a/releases/5.0.1/ishare2 b/releases/5.0.1/ishare2 new file mode 100644 index 0000000..f436fda Binary files /dev/null and b/releases/5.0.1/ishare2 differ diff --git a/scripts/docker/dockerserver.sh b/scripts/docker/dockerserver.sh new file mode 100644 index 0000000..a26a238 --- /dev/null +++ b/scripts/docker/dockerserver.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +###### Update 3 By Maosen 20170610 ###### +###### Updated 3 - 20221030 ###### + +#qemu=$(pwd) +qemu=$1 + +icon="/opt/unetlab/html/images/icons" +include="/opt/unetlab/html/includes" +template="/opt/unetlab/html/templates" + +if [[ ${qemu:25:13} == 'dockerserver-' ]] +then + mv -f $qemu/Docker.png $icon/Docker.png + mv -f $qemu/dockerserver.php $template/dockerserver.php + + if grep -i \'dockerserver\' $include/init.php > /dev/null + then + echo -e "\033[33mSorry!\033[0m Maybe, you have already imported it" + else + sed -i "/Linux/a\\\t\t'dockerserver'\t\t\t=>\t'Docker'," $include/init.php + echo -e "\033[32mGreat!\033[0m Docker server device has been imported successfully" + fi + # rm -rf $qemu/dockerserver.sh +else + echo -e "\033[33mSorry!\033[0m Your folder name is not correct, please modify it and then run the script again\n\033[32mFor example: \"dockerserver-xxxx\"\033[0m" +fi diff --git a/scripts/esxi/esxi.sh b/scripts/esxi/esxi.sh new file mode 100644 index 0000000..88cc7f5 --- /dev/null +++ b/scripts/esxi/esxi.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +###### Updated 2 By Maosen - 20170419 ###### +###### Updated 3 - 20221016 ###### + +#qemu=$(pwd) +qemu=$1 + +icon="/opt/unetlab/html/images/icons" +include="/opt/unetlab/html/includes" +template="/opt/unetlab/html/templates" + +if [[ ${qemu:25:5} == 'esxi-' ]] +then + cp -rf $qemu/esxi.png $icon/esxi.png + #rm -rf $qemu/esxi.png + + cp -rf $qemu/esxi.php $template/esxi.php + #rm -rf $qemu/esxi.php + + if grep -i ESXi $include/init.php > /dev/null + then + echo -e "\033[33mSorry!\033[0m Maybe, you have already imported it" + else + sed -i "/Virtual PC/i\\\t\t'esxi'\t\t\t=>\t'VMware ESXi'," $include/init.php + echo 'options kvm_intel nested=1' >> /etc/modprobe.d/kvm-intel.conf + echo 'options kvm ignore_msrs=1' >> /etc/modprobe.d/kvm-intel.conf + echo -e "\033[32mGreat!\033[0m ESXi device has been imported successfully" + echo -e "\nDon´t forget to connect to this device using VNC." + echo -e "You can download UltraVNC Viewer, for example" + fi + #rm -rf $qemu/esxi.sh +else + echo -e "\033[33mSorry!\033[0m Your folder name is not correct, please modify it and then run the script again\n\033[32mFor example: \"esxi-xxxx\"\033[0m" +fi diff --git a/scripts/openstack/openstack.sh b/scripts/openstack/openstack.sh new file mode 100644 index 0000000..4e2f890 --- /dev/null +++ b/scripts/openstack/openstack.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +###### Version 3 By Maosen 20170618 ###### +###### Updated 4 - 20221030 ###### + +# Author: Maosen Sun +# Copyright: Maosen Sun +# Organization: EmulatedLab (QQ Group:593920308) +# @link http://www.eve-ng.com +# @version 20170618 + +#qemu=$(pwd) +qemu=$1 + +icon="/opt/unetlab/html/images/icons" +include="/opt/unetlab/html/includes" +template="/opt/unetlab/html/templates" + +if [[ ${qemu:25:10} == 'openstack-' ]] +then + mv -f $qemu/Openstack.png $icon/Openstack.png + mv -f $qemu/openstack.php $template/openstack.php + + if grep -i \'openstack\' $include/init.php > /dev/null + then + echo -e "\033[33mSorry!\033[0m Maybe, you have already imported it" + else + sed -i "/Linux/i\\\t\t'openstack'\t\t\t=>\t'Openstack'," $include/init.php + echo -e "\033[32mGreat!\033[0m Openstack device has been imported successfully" + echo -e "\nDon´t forget to connect to this device using VNC." + echo -e "You can download UltraVNC Viewer, for example" + echo -e "\nuser: root\npass: eve@123" + fi + #rm -rf $qemu/openstack.sh +else + echo -e "\033[33mSorry!\033[0m Your folder name is not correct, please modify it and then run the script again\n\033[32mFor example: \"openstack-xxxx\"\033[0m" +fi diff --git a/scripts/pfsense/pfsense.sh b/scripts/pfsense/pfsense.sh new file mode 100644 index 0000000..c60d7cc --- /dev/null +++ b/scripts/pfsense/pfsense.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +###### Update 2 By Maosen 20170419 ###### +###### Updated 3 - 20221030 ###### + +#qemu=$(pwd) +qemu=$1 + +icon="/opt/unetlab/html/images/icons" +include="/opt/unetlab/html/includes" +template="/opt/unetlab/html/templates" + +cp -rf $qemu/pfsense.php $template/pfsense.php +#rm -rf $qemu/pfsense.php + +echo -e "\033[32mGreat!\033[0m pfSense device has been imported successfully" +#rm -rf $qemu/pfsense.sh diff --git a/scripts/zabbix/zabbix.sh b/scripts/zabbix/zabbix.sh new file mode 100644 index 0000000..774a6f5 --- /dev/null +++ b/scripts/zabbix/zabbix.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +######Version 2 By Maosen 20170419###### +###### Updated 4 - 20221107 ###### + +# Author: Maosen Sun +# copyright: Maosen Sun +# Organization EmulatedLab(QQ Group:593920308) +# @link http://www.eve-ng.com +# @version 20170518 + +#qemu=$(pwd) +qemu=$1 + +icon="/opt/unetlab/html/images/icons" +include="/opt/unetlab/html/includes" +template="/opt/unetlab/html/templates" + +if [[ ${qemu:25:7} == 'zabbix-' ]] +then + mv -f $qemu/Zabbix.png $icon/Zabbix.png + mv -f $qemu/zabbix.php $template/zabbix.php + + if grep -i \'zabbix\' $include/init.php > /dev/null + then + echo -e "\033[33mSorry!\033[0m Maybe, you have already imported it" + else + sed -i "/Virtual PC/i\\\t\t'zabbix'\t\t\t=>\t'Zabbix'," $include/init.php + echo -e "\033[32mGreat!\033[0m Zabbix device has been imported successfully" + echo -e "\nDon´t forget to connect to this device using VNC." + echo -e "You can download UltraVNC Viewer, for example" + fi + #rm -rf $qemu/zabbix.sh +else + echo -e "\033[33mSorry!\033[0m Your folder name is not correct, please modify it and then run the script again\n\033[32mFor example: \"zabbix-xxxx\"\033[0m" +fi diff --git a/templates/apstra/apstra.yml b/templates/apstra/apstra.yml new file mode 100644 index 0000000..4939c2f --- /dev/null +++ b/templates/apstra/apstra.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2016, Andrea Dainese +# Copyright (c) 2018, Alain Degreffe +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the UNetLab Ltd nor the name of EVE-NG Ltd nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--- +type: qemu +description: Apstra AOS/ZTP +name: Apstra +cpulimit: 1 +icon: Apstra.png +cpu: 2 +ram: 6144 +ethernet: 1 +console: telnet +shutdown: 1 +qemu_arch: x86_64 +qemu_nic: virtio-net-pci +qemu_options: -machine type=pc,accel=kvm -vga virtio -usbdevice tablet -boot order=cd +... diff --git a/templates/cisco/c1760.yml b/templates/cisco/c1760.yml new file mode 100644 index 0000000..acca57d --- /dev/null +++ b/templates/cisco/c1760.yml @@ -0,0 +1,11 @@ +--- +type: dynamips +name: "1760" +config_script: embedded +description: Cisco IOS 1760 (Dynamips) +icon: Router.png +idlepc: "0x80369ac4" +nvram: 128 +ram: 96 +dynamips_options: -P 1700 -t 1760 -o 4 -c 0x2102 -X +... diff --git a/templates/cisco/c2600.yml b/templates/cisco/c2600.yml new file mode 100644 index 0000000..67f41f8 --- /dev/null +++ b/templates/cisco/c2600.yml @@ -0,0 +1,45 @@ +--- +type: dynamips +name: C2600 +config_script: embedded +description: Cisco IOS C2600 (Dynamips) +icon: Router.png +idlepc: "0x6114a604" +nvram: 112 +ram: 128 +slot1: + value: "" + type: list + width: 12 + options: + "": Empty + "NM-1FE-TX": "NM-1FE-TX" + "NM-16ESW": "NM-16ESW" + "GT96100-FE": "GT96100-FE" + "NM-4T": "NM-4T" +wic1: + value: "" + type: list + width: 4 + options: + "": Empty + "WIC-1T": "WIC-1T" + "WIC-2T": "WIC-2T" +wic2: + value: "" + type: list + width: 4 + options: + "": Empty + "WIC-1T": "WIC-1T" + "WIC-2T": "WIC-2T" +wic3: + value: "" + type: list + width: 4 + options: + "": Empty + "WIC-1T": "WIC-1T" + "WIC-2T": "WIC-2T" +dynamips_options: -P 2600 -X +... diff --git a/templates/h3cvbras1k/h3cvbras1k.yml b/templates/h3cvbras1k/h3cvbras1k.yml new file mode 100644 index 0000000..360bb32 --- /dev/null +++ b/templates/h3cvbras1k/h3cvbras1k.yml @@ -0,0 +1,17 @@ +--- +type: qemu +config_script: config_h3c.py +description: H3C vBRAS1000 +name: H3CvBRAS +cpulimit: 1 +icon: h3cvbras1k.png +cpu: 1 +ram: 1024 +ethernet: 4 +eth_format: Gi{1}/{0-1} +console: telnet +shutdown: 1 +qemu_arch: x86_64 +qemu_version: 2.12.0 +qemu_options: -machine type=pc,accel=kvm -vga std -rtc base=utc -cpu host +... diff --git a/templates/h3cvfw2k/h3cvfw2k.yml b/templates/h3cvfw2k/h3cvfw2k.yml new file mode 100644 index 0000000..a3d84aa --- /dev/null +++ b/templates/h3cvfw2k/h3cvfw2k.yml @@ -0,0 +1,17 @@ +--- +type: qemu +config_script: config_h3c.py +description: H3C vFW2000 +name: H3CvFW +cpulimit: 1 +icon: h3cvfw1k.png +cpu: 1 +ram: 2048 +ethernet: 8 +eth_format: Gi{1}/{0-1} +console: telnet +shutdown: 1 +qemu_arch: x86_64 +qemu_version: 2.12.0 +qemu_options: -machine type=pc,accel=kvm -vga std -rtc base=utc -cpu host +... diff --git a/templates/h3cvlb1k/h3cvlb1k.yml b/templates/h3cvlb1k/h3cvlb1k.yml new file mode 100644 index 0000000..ee7005e --- /dev/null +++ b/templates/h3cvlb1k/h3cvlb1k.yml @@ -0,0 +1,17 @@ +--- +type: qemu +config_script: config_h3c.py +description: H3C vLB1000 +name: H3CvLB +cpulimit: 1 +icon: h3cvlb1k.png +cpu: 1 +ram: 1024 +ethernet: 8 +eth_format: Gi{1}/{0-1} +console: telnet +shutdown: 1 +qemu_arch: x86_64 +qemu_version: 2.12.0 +qemu_options: -machine type=pc,accel=kvm -vga std -rtc base=utc -cpu host +... diff --git a/templates/h3cvsr1k/h3cvsr1k.yml b/templates/h3cvsr1k/h3cvsr1k.yml new file mode 100644 index 0000000..fee62f3 --- /dev/null +++ b/templates/h3cvsr1k/h3cvsr1k.yml @@ -0,0 +1,17 @@ +--- +type: qemu +config_script: config_h3c.py +description: H3C vSR1000 +name: H3CvSR +cpulimit: 1 +icon: h3cvsr1k.png +cpu: 1 +ram: 2048 +ethernet: 8 +eth_format: Gi{1}/{0-1} +console: telnet +shutdown: 1 +qemu_arch: x86_64 +qemu_version: 2.12.0 +qemu_options: -machine type=pc,accel=kvm -vga std -rtc base=utc -cpu host +... diff --git a/templates/i86bi_linux_l2/i86bi_linux_l2.yml b/templates/i86bi_linux_l2/i86bi_linux_l2.yml new file mode 100644 index 0000000..e9fd27d --- /dev/null +++ b/templates/i86bi_linux_l2/i86bi_linux_l2.yml @@ -0,0 +1,11 @@ +--- +type: iol +name: Switch +config_script: embedded +description: Cisco IOL L2 (Switch) +icon: Switch.png +nvram: 1024 +ram: 1024 +ethernet: 1 +serial: 0 +... diff --git a/templates/i86bi_linux_l3/i86bi_linux_l3.yml b/templates/i86bi_linux_l3/i86bi_linux_l3.yml new file mode 100644 index 0000000..8f19cfc --- /dev/null +++ b/templates/i86bi_linux_l3/i86bi_linux_l3.yml @@ -0,0 +1,11 @@ +--- +type: iol +name: Router +config_script: embedded +description: Cisco IOL L3 (Router) +icon: Router.png +nvram: 1024 +ram: 1024 +ethernet: 1 +serial: 0 +... diff --git a/templates/isrv/device_isrv.php b/templates/isrv/device_isrv.php new file mode 100644 index 0000000..fa58d06 --- /dev/null +++ b/templates/isrv/device_isrv.php @@ -0,0 +1,77 @@ +ethernets[$i])) { + + if($i == 0 && $this->first_nic != ''){ + $flag = ' -device '.$this->first_nic.',netdev=net' . $i . ',mac=' . incMac($this->createFirstMac(), $i); + }else{ + $flag = ' -device %NICDRIVER%,netdev=net' . $i . ',mac=' . incMac($this->createFirstMac(), $i); + } + $flag .= ' -netdev tap,id=net' . $i . ',ifname=vunl' . $this->getSession() . '_' . $i . ',script=no'; + + $n = 'Gi' . ($i + 1); // Interface name + try { + $ethernets[$i] = new Interfc( $this, array('name' => $n, 'type' => 'ethernet', 'flag' => $flag), $i); + } catch (Exception $e) { + error_log(date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][40020]); + error_log(date('M d H:i:s ') . (string) $e); + return false; + } + } else { + $ethernets[$i] = $this->ethernets[$i]; + } + // Setting CMD flags (virtual device and map to TAP device) + + } + + $this->ethernets = $ethernets; + return $this->ethernets; + } + + + + public function customFlag($flag) + { + if(is_file($this->getRunningPath() . '/config.iso') && !is_file($this->getRunningPath() . '/.configured') && $this->config != 0) { + $flag .= ' -cdrom config.iso'; + } + return $flag; + } + + + public function prepare() + { + $result = parent::prepare(); + if ($result != 0) return $result; + + if (is_file($this->getRunningPath() . '/startup-config') && !is_file($this->getRunningPath() . '/.configured')) { + copy($this->getRunningPath() . '/startup-config', $this->getRunningPath() . '/iosxe_config.txt'); + $isocmd = 'mkisofs -o ' . $this->getRunningPath() . '/config.iso -l --iso-level 2 ' . $this->getRunningPath() . '/iosxe_config.txt'; + exec($isocmd, $o, $rc); + } + + return 0; + } +} diff --git a/templates/isrv/isrv.yml b/templates/isrv/isrv.yml new file mode 100644 index 0000000..4817eaa --- /dev/null +++ b/templates/isrv/isrv.yml @@ -0,0 +1,22 @@ + +#@author LIN +#@copyright pnetlab.com +#@link https://www.pnetlab.com/ + +--- +type: qemu +config_script: config_csr1000v.py +description: Cisco ISRv +name: ISRv +cpulimit: 1 +icon: CSRv1000-1.png +cpu: 2 +ram: 4096 +ethernet: 4 +eth_format: Gi{1} +console: telnet +qemu_arch: x86_64 +qemu_version: 4.1.0 +qemu_nic: vmxnet3 +qemu_options: -machine type=pc,accel=kvm -cpu host -serial mon:stdio -vga std -no-user-config -nodefaults -rtc base=utc +... diff --git a/templates/kali/README.txt b/templates/kali/README.txt new file mode 100644 index 0000000..f730c02 --- /dev/null +++ b/templates/kali/README.txt @@ -0,0 +1,17 @@ +QEMU image directory name: linux-kali2020-epiol +QEMU image name: virtioa.qcow2 + +Username (non-root): epiol +Password: 123456 + +A simple optimization has been carried out: + +* The update source has been modified +* The problem of garbled characters has been solved + +In order to have greater flexibility: + +* The disk partition adopts LVM support +This is convenient for subsequent expansion and the current size of the entire kali disk is 20 GB + +Tip: Remember to fix permissions after importing diff --git a/templates/openstack/openstack.yml b/templates/openstack/openstack.yml new file mode 100644 index 0000000..00d9e86 --- /dev/null +++ b/templates/openstack/openstack.yml @@ -0,0 +1,16 @@ +--- +type: qemu +description: Openstack +name: Openstack +cpulimit: 1 +icon: Openstack.png +cpu: 3 +ram: 6144 +ethernet: 1 +console: vnc +shutdown: 1 +qemu_arch: x86_64 +qemu_version: 4.1.0 +qemu_nic: virtio-net-pci +qemu_options: -machine type=pc-1.0,accel=kvm -vga std -usbdevice tablet -boot order=dc +... diff --git a/templates/openwrt/openwrt.yml b/templates/openwrt/openwrt.yml new file mode 100644 index 0000000..2627e25 --- /dev/null +++ b/templates/openwrt/openwrt.yml @@ -0,0 +1,16 @@ +--- +type: qemu +description: OpenWRT +name: OpenWRT +cpulimit: 1 +icon: Router.png +cpu: 1 +ram: 1024 +ethernet: 1 +console: telnet +shutdown: 1 +qemu_arch: x86_64 +qemu_version: 2.12.0 +qemu_nic: virtio-net-pci +qemu_options: -machine type=pc,accel=kvm -vga virtio -usbdevice tablet -boot order=cd +... diff --git a/templates/vsrx30/vsrx30.yml b/templates/vsrx30/vsrx30.yml new file mode 100644 index 0000000..d9024d5 --- /dev/null +++ b/templates/vsrx30/vsrx30.yml @@ -0,0 +1,44 @@ +# Copyright (c) 2017-2020, Alain Degreffe +# Copyright (c) 2019-2020, Christian Scholz +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the UNetLab Ltd nor the name of EVE-NG Ltd nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--- +type: qemu +name: vSRX3-0 +description: Juniper vSRX3.0 # disabling this template... use vsrxng !!! +config_script: config_vsrx30.py +cpulimit: 1 +icon: JuniperSRX.png +cpu: 2 +ram: 4096 +eth_name: +- fxp0/mgmt +eth_format: ge-0/0/{0} +ethernet: 8 +qemu_nic: virtio-net-pci +console: telnet +qemu_arch: x86_64 +qemu_options: -machine type=pc-1.0,accel=kvm -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+x2apic,+aes,pclmulqdq -serial + mon:stdio -nographic -nodefconfig -nodefaults -rtc base=utc +... diff --git a/templates/zabbix/zabbix.yml b/templates/zabbix/zabbix.yml new file mode 100644 index 0000000..2514315 --- /dev/null +++ b/templates/zabbix/zabbix.yml @@ -0,0 +1,16 @@ +--- +type: qemu +description: Zabbix +name: zabbix +cpulimit: 1 +icon: Zabbix.png +cpu: 2 +ram: 4096 +ethernet: 1 +console: vnc +shutdown: 1 +qemu_arch: x86_64 +qemu_version: 2.12.0 +qemu_nic: virtio-net-pci +qemu_options: -machine type=pc,accel=kvm -vga virtio -usbdevice tablet -boot order=cd +... diff --git a/upgrades/to_5.0.1/5.0.1.zip b/upgrades/to_5.0.1/5.0.1.zip new file mode 100644 index 0000000..e1e0978 Binary files /dev/null and b/upgrades/to_5.0.1/5.0.1.zip differ diff --git a/upgrades/to_5.0.1/README.md b/upgrades/to_5.0.1/README.md new file mode 100644 index 0000000..f414ccb --- /dev/null +++ b/upgrades/to_5.0.1/README.md @@ -0,0 +1,10 @@ +```linux +This script allows to upgrade PNETLab to version 5.0.1 +``` +## upgrade.sh + +### Installation +Apply this command using the terminal +```linux +wget -O upgrade.sh https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/to_5.0.1/upgrade.sh > /dev/null 2>&1 && chmod +x upgrade.sh && bash upgrade.sh +``` diff --git a/upgrades/to_5.0.1/upgrade.sh b/upgrades/to_5.0.1/upgrade.sh new file mode 100644 index 0000000..a51e6de --- /dev/null +++ b/upgrades/to_5.0.1/upgrade.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Script designed to upgrade PNETLab from 4.2.10 version to 5.0.1 version +# Requirement: Having PNETLab v4.2.10 first for being able to upgrade it to v5.0.1 + +data=$(mysql -uroot -ppnetlab -D pnetlab_db -e "SELECT control_value FROM control WHERE control_value>1;" 2>/dev/null) +pnetlab_version=( $data ) + +if [[ ${pnetlab_version[1]} == "5.0.1" ]] +then + echo "PNETLab already upgraded to v5.0.1" + exit 0 +fi + +if ! [[ ${pnetlab_version[1]} == "4.2.10" ]] +then + echo "You need to have the v4.2.10 to upgrade to the v5.0.1" + exit 0 +fi + +echo "Upgrading to 5.0.1" +wget -O /tmp/5.0.1.zip https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/to_5.0.1/5.0.1.zip > /dev/null 2>&1 +cd /tmp +rm -rf upgrade +unzip 5.0.1.zip -d ./upgrade > /dev/null 2>&1 +chmod 755 -R upgrade +find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1 +./upgrade/upgrade +rm -rf upgrade +rm 5.0.1.zip \ No newline at end of file