install-gns3-debian12/Makefile
2024-01-26 03:31:56 +02:00

82 lines
2.8 KiB
Makefile

all:
echo OK
check-deps-path:
which setcap
which usermod
install: install-gns3
install-docker:
bash install-docker.sh
install-gns3-deps:
apt update
apt install -y build-essential
apt install -y bridge-utils cpu-checker libvirt-clients libvirt-daemon qemu-system qemu-kvm bridge-utils libvirt-daemon-system
apt install -y python-dev-is-python3 libelf-dev libpcap-dev python3-pyqt5 xterm cmake
apt install -y python3-pyqt5.QtSvg python3-pyqt5.qtwebsockets
DEBIAN_FRONTEND=noninteractive apt install -y bash-completion libguestfs-tools bsd-mailx
install-gns3: install-gns3-deps check-deps-path install-busybox-static install-pip install-docker create-gns3-user
git clone --depth 1 https://github.com/GNS3/gns3-server.git; true
git clone --depth 1 https://github.com/GNS3/gns3-gui.git; true
git clone --depth 1 https://github.com/GNS3/vpcs.git; true
git clone --depth 1 https://github.com/GNS3/dynamips.git; true
git clone --depth 1 https://github.com/GNS3/ubridge.git; true
python3 -m pip install --upgrade pip --break-system-packages
cd gns3-server && pip3 install -r requirements.txt --break-system-packages && python3 setup.py install
cd gns3-gui && pip3 install -r requirements.txt --break-system-packages && python3 setup.py install
pip3 install --upgrade requests --break-system-packages
pip3 install --upgrade chardet --break-system-packages
# pip3 install gns3-server
# pip3 install gns3-gui
cd vpcs/src && ./mk.sh && cp -v vpcs /usr/local/bin/vpc
cd dynamips && mkdir build && cd build && cmake .. && make && make install
cd ubridge && make && make install
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/qemu-kvm;true
cd gns3-server/init && cp gns3.service.systemd /etc/systemd/system/gns3.service
chown root:root /etc/systemd/system/gns3.service
sed -i -e "s@^ExecStart=.*@ExecStart=/usr/local/bin/gns3server@g" /etc/systemd/system/gns3.service
chown gns3:gns3 /home/gns3/ -R
systemctl daemon-reload
systemctl enable gns3.service
systemctl start gns3.service
upgrade-gns3-server:
git clone --depth 1 https://github.com/GNS3/gns3-server.git
systemctl stop gns3.service
cd gns3-server && pip3 install -r requirements.txt --break-system-packages && python3 setup.py install
systemctl start gns3.service
create-gns3-user:
useradd gns3;true
mkdir -p /home/gns3
rsync -av /etc/skel/ /home/gns3/
usermod -a -G qemu gns3;true
usermod -a -G kvm gns3;true
usermod -a -G libvirt gns3;true
usermod -a -G docker gns3;true
cleanup-gns3-sources:
rm -fr gns3-server
rm -fr dynamips
rm -fr gns3-gui
rm -fr ubridge
rm -fr vpcs
install-pip:
apt install -y python3-pip
upgrade-pip3:
python3 -m pip install --upgrade pip --break-system-packages
install-busybox-static:
apt install -y busybox-static
get-busy-box-static:
bash get-busy-box-static.sh
disable-firewalld:
systemctl disable --now firewalld