90 lines
3.0 KiB
Makefile
90 lines
3.0 KiB
Makefile
all:
|
|
echo OK
|
|
|
|
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
|
|
|
|
|
|
install: install-gns3
|
|
|
|
install-docker:
|
|
bash install-docker.sh
|
|
|
|
install-gns3-deps:
|
|
dnf update -y
|
|
dnf install epel-release -y
|
|
crb enable
|
|
dnf install epel-release -y
|
|
dnf group install -y "Development Tools"
|
|
dnf install -y cmake libpcap-devel
|
|
dnf group install -y "Virtualization Host"
|
|
dnf install -y python3.12 python3.12-devel python3.12-pip
|
|
update-alternatives --set python3 /usr/bin/python3.12
|
|
pip3 install --upgrade pip
|
|
|
|
|
|
install-gns3: install-gns3-deps get-busy-box-static install-docker create-gns3-user build-gns3-server build-gns3-gui build-gns3-vpcs build-gns3-dynamips build-gns3-ubridge
|
|
chown gns3:gns3 /home/gns3/ -R
|
|
systemctl daemon-reload
|
|
systemctl enable gns3.service
|
|
systemctl start gns3.service
|
|
|
|
build-gns3-server:
|
|
git clone --depth 1 https://github.com/GNS3/gns3-server.git; true
|
|
cd gns3-server && git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' && git pull origin && git checkout tags/v2.2.49
|
|
python3 -m pip install --upgrade pip
|
|
cd gns3-server && pip3 install -r requirements.txt && python3 setup.py 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
|
|
mkdir -p /home/gns3/.config/GNS3/2.2/
|
|
cp -vf gns3_server.conf /home/gns3/.config/GNS3/2.2/gns3_server.conf
|
|
chown gns3:gns3 /home/gns3/ -R
|
|
systemctl daemon-reload
|
|
|
|
build-gns3-gui:
|
|
git clone --depth 1 https://github.com/GNS3/gns3-gui.git; true
|
|
python3 -m pip install --upgrade pip
|
|
cd gns3-gui && pip3 install -r requirements.txt && python3 setup.py install
|
|
|
|
build-gns3-vpcs:
|
|
git clone --depth 1 https://github.com/GNS3/vpcs.git; true
|
|
cd vpcs/src && ./mk.sh && cp -v vpcs /usr/local/bin/vpc
|
|
|
|
build-gns3-dynamips:
|
|
git clone --depth 1 https://github.com/GNS3/dynamips.git; true
|
|
cd dynamips && mkdir build && cd build && cmake .. && make && make install
|
|
|
|
build-gns3-ubridge:
|
|
git clone --depth 1 https://github.com/GNS3/ubridge.git; true
|
|
cd ubridge && make && make install
|
|
|
|
upgrade-gns3-server:
|
|
git clone --depth 1 https://github.com/GNS3/gns3-server.git; true
|
|
cd gns3-server && git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' && git pull origin && git checkout tags/v2.2.49
|
|
python3 -m pip install --upgrade pip
|
|
systemctl stop gns3.service
|
|
cd gns3-server && pip3 install -r requirements.txt && python3 setup.py install
|
|
systemctl start gns3.service
|
|
|
|
get-busy-box-static:
|
|
bash get-busy-box-static.sh
|
|
|
|
disable-firewalld:
|
|
systemctl disable firewalld
|
|
systemctl stop firewalld
|
|
|
|
init-iptables:
|
|
dnf install -y iptables-services iptables-utils
|
|
cp -vf rules.v4 /etc/sysconfig/iptables
|
|
cp -vf rules.v6 /etc/sysconfig/ip6tables
|
|
systemctl start iptables
|
|
systemctl enable iptables
|