Compare commits
2 Commits
f624077d8d
...
d6ab011a0f
Author | SHA1 | Date | |
---|---|---|---|
|
d6ab011a0f | ||
|
14f39a4c92 |
78
Makefile
Normal file
78
Makefile
Normal file
@ -0,0 +1,78 @@
|
||||
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
|
23
get-busy-box-static.sh
Executable file
23
get-busy-box-static.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
docker run -d --name busybox_extractor -v ${pwd}:/installer debian:12 sleep 3600
|
||||
|
||||
docker exec -it busybox_extractor apt update
|
||||
|
||||
docker exec -it busybox_extractor apt upgrade -y
|
||||
|
||||
docker exec -it busybox_extractor apt install -y busybox-static
|
||||
|
||||
docker exec -it busybox_extractor cp -vf /usr/bin/busybox /installer/
|
||||
|
||||
docker stop busybox_extractor
|
||||
|
||||
docker rm busybox_extractor
|
||||
|
||||
cp -vf busybox /usr/bin/busybox
|
||||
|
||||
set +e
|
||||
set +x
|
4
gns3-devel-packages
Normal file
4
gns3-devel-packages
Normal file
@ -0,0 +1,4 @@
|
||||
jq
|
||||
rsync
|
||||
net-tools
|
||||
lsb-release
|
49
gns3_server.conf
Normal file
49
gns3_server.conf
Normal file
@ -0,0 +1,49 @@
|
||||
[Server]
|
||||
; IP where the server listen for connection
|
||||
host = 0.0.0.0
|
||||
; HTTP port for controlling the servers
|
||||
port = 3080
|
||||
; Path where images of devices are stored
|
||||
images_path = /home/gns3/GNS3/images
|
||||
|
||||
; Path where user project are stored
|
||||
projects_path = /home/gns3/GNS3/projects
|
||||
|
||||
; Send crash to the GNS3 team
|
||||
report_errors = True
|
||||
; First port of the range allocated to devices telnet console
|
||||
console_start_port_range = 2001
|
||||
; Last port of the range allocated to devices telnet console
|
||||
console_end_port_range = 5000
|
||||
; First port of the range allocated to communication between devices. You need two port by link
|
||||
udp_start_port_range = 10000
|
||||
; Last port of the range allocated to communication between devices. You need two port by link
|
||||
udp_end_port_range = 20000
|
||||
; Path of the ubridge program
|
||||
ubridge_path = /usr/local/bin/ubridge
|
||||
; Boolean for enabling HTTP auth
|
||||
auth = True
|
||||
; Username for HTTP auth
|
||||
user = admin
|
||||
; Password for HTTP auth
|
||||
password = admin
|
||||
|
||||
[VPCS]
|
||||
; Path of the VPCS binary
|
||||
vpcs_path = /usr/local/bin/vpc
|
||||
|
||||
[Dynamips]
|
||||
allocate_aux_console_ports = False
|
||||
mmap_support = True
|
||||
; Path of the dynamips path
|
||||
dynamips_path = /usr/local/bin/dynamips
|
||||
sparse_memory_support = True
|
||||
ghost_ios_support = True
|
||||
|
||||
[IOU]
|
||||
; Path of the iouyap binary
|
||||
iouyap_path = /usr/local/bin/iouyap
|
||||
; Path of your .iourc file. If empty we search in $HOME/.iourc
|
||||
iourc_path = /home/gns3/.iourc
|
||||
; Validate if the iourc is correct. If you turn off and your licence is invalid iou will crash without errors
|
||||
license_check = True
|
@ -19,3 +19,5 @@ fi
|
||||
|
||||
chmod +x /usr/bin/docker-compose
|
||||
|
||||
systemctl start docker
|
||||
systemctl enable docker
|
||||
|
22
install-gns3.sh
Executable file
22
install-gns3.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user