-
Notifications
You must be signed in to change notification settings - Fork 0
/
gns3-server-install.sh
executable file
·63 lines (46 loc) · 1.51 KB
/
gns3-server-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#from source
#must install gns3-server and ubridge
#gns-server:
sudo adduser gns3 #add gns3 user that gns3 server will run as
su gns3 # change to gns3 user
cd /home/gns3 #change to gns3 user home directory
sudo apt-get install python3-setuptools python3-pip qemu-kvm qemu-system-x86 mtools git #install OS deps for gns3-server
git clone https://github.com/GNS3/gns3-server #git clone src
cd gns-server #cd to src
#This method installs to the user directory. You should run as user gns3, files will be created in /home/gns3
#gns3@gns3:~/gns3-server$
python3 -m pip install -r requirements.txt #install python deps
#gns3@gns3:~/gns3-server$
python3 -m pip install . #install gns3-server itself
#It will put gns3server into .local/bin
#Allow user gns3 to run qemu:
#gns3@gns3:~/gns-server$
sudo usermod -aG kvm gns3 #add gns3 user to run kvm/qemu
#ubridge:
sudo apt install -y libpcap-dev #required for building ubridge
git clone https://github.com/GNS3/ubridge.git #clone ubridge src
cd ubridge
make
sudo make install
#create gns3.service at
#/usr/lib/systemd/system/gns3.service
sudo bash -c 'cat > /usr/lib/systemd/system/gns3.service' << EOF
[Unit]
Description=GNS3 server
Wants=network-online.target
After=network.target network-online.target
[Service]
User=gns3
Group=gns3
ExecStart=/home/gns3/.local/bin/gns3server
[Install]
WantedBy=multi-user.target
EOF
echo -e "
start service with
systemctl start gns3.service
autostart at boot with
systemctl enable gns3.service
to see logs run:
journalctrl -u gns3.service -f
"