This repository contains a helper script based on one of my early blog posts about installing GNS3 on Arch/Manjaro.
The purpose of the script is to automate GNS3 installation on Arch Linux and Arch-based distros.
A user with sudo privilidges. git
needs to be installed to clone the repo. Most users will have git pre-installed with the system.
The install-gns3.sh
script will automate most of the installation process.
The script checks for errors along the way. If one of the steps did not succeed the script will be ended and the user notified.
Example:
yay -S vpcs --noconfirm # <1>
cd "$HOME" || exit
check_for_vpcs=$(type vpcs | grep -c "vpcs is /usr/bin/vpcs") # <2>
if [[ "$check_for_vpcs" -lt 1 ]]; then # <3>
echo -e "${On_Red}
Unable to find VPCS after isntall....
Aborting the script${Color_Off}"
exit
fi
- Installing VPCS from AUR
- Define a variable to check for VPCS installation. If installed, grep value will be > 1. There are many ways to do this, I've chosed this way for no particular reason.
- If the value returned by the $check_for_vpcs is less then 1, notify the user and end the script.
The script aims to provide a complete and functioning GNS3 experience. Using the script is simple. Recommended usage is to clone the repo and to execute the script via bash.
git clone https://github.com/SirToffski/Arch-GNS3-Helper.git
cd Arch-GNS3-Helper/
bash install-gns3.sh
One could accomplish everything the script does via manual installation process outlined below.
$ sudo pacman -Syu
$ sudo pacman -S yay
edit /etc/pacman.conf
:
$ sudo tee -a /etc/pacman.conf > /dev/null << EOL
> [archlinuxfr]
> SigLevel = Never
> Server = http://repo.archlinux.fr/$arch
> EOL
Now clone the YAY AUR repo and build the package - it will be installed after building:
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
$ sudo pacman -S libelf libpcap cmake
$ yay -S dynamips --noconfirm
$ sudo setcap cap_net_admin,cap_net_raw=ep $(which dynamips)
$ cd $HOME
$ dynamips 2> /dev/null | grep version
Cisco Router Simulation Platform (version 0.2.19-amd64/Linux stable)
$ getcap $(which dynamips)
/usr/bin/dynamips = cap_net_admin,cap_net_raw+ep
$ yay -S vpcs --noconfrim
$ cd $HOME
$ type vpcs
vpcs is /usr/bin/vpcs
$ vpcs -v | grep version
Welcome to Virtual PC Simulator, version 0.8 beta1
$ sudo pacman -S iniparser
$ yay -S iouyap --noconfrim
$ cd $HOME
$ sudo setcap cap_net_admin,cap_net_raw=ep $(which iouyap)
$ iouyap -V
iouyap version 0.97.0
$ getcap $(which iouyap)
/usr/bin/iouyap = cap_net_admin,cap_net_raw+ep
Due to obvious reasons, this guide will not provide information on where to get IOL, license, etc. Only the steps with required dependencies and configuration are provided for educational purposes only. Reader assumes all responsibility of researching and deciding whether to use IOL.
$ sudo pacman -S lib32-openssl lib32-gcc-libs
$ sudo ln -s /usr/lib32/libcrypto.so.1.0.0 /usr/lib32/libcrypto.so.4
# Prevent EXCESSCOLL error
$ sudo sysctl net.unix.max_dgram_qlen=10000
# To make the above change persistent
$ sudo tee -a /etc/sysctl.d/99-sysctl.conf > /dev/null << EOL
> # Prevent EXCESSCOLL error for IOL
> net.unix.max_dgram_qlen=10000
> EOL
$ sysctl net.unix.max_dgram_qlen
net.unix.max_dgram_qlen = 10000
$ tail -2 /etc/sysctl.d/99-sysctl.conf
# Prevent EXCESSCOLL error for IOL
net.unix.max_dgram_qlen=10000
$ yay -S ubridge --noconfirm
$ cd $HOME
$ ubridge -v
ubridge version 0.9.18
$ getcap $(which ubridge)
/usr/local/bin/ubridge = cap_net_admin,cap_net_raw+ep
$ sudo pacman -S qemu qemu-arch-extra
$ sudo pacman -S docker
$ sudo systemctl enable docker.service
$ sudo systemctl start docker.service
$ sudo gpasswd -a $USER docker
# Log out and back in for the new group membership to take effect.
$ sudo pacman -S docker
$ id -Gn
user wheel docker
$ docker info
$ sudo pacman -S wireshark-qt
$ sudo gpasswd -a $USER wireshark
# Log out and back in for the new group membership to take effect.
$ id -Gn
user wheel wireshark docker
Install python-pypi2pkgbuild-git from AUR to create PKGBUILD from GNS3 git repos
$ yay -S python-pypi2pkgbuild-git --noconfirm
Create an alias for pypi2pkgbuild-git to make creating/installing PKGBUILD easier:
$ alias pypi2pkgalias='PKGEXT=.pkg.tar pypi2pkgbuild.py -g cython -b /tmp/pypi2pkgbuild/ -f'
$ sudo pacman -S qt5-svg qt5-websockets python-pip python-pyqt5 python-sip python-wheel git
Clone the repository and checkout the latest stabe release. Build the package with pypi2pkgbuild.
$ mkdir -p $HOME/GNS3-Dev && cd $_
$ git clone https://github.com/GNS3/gns3-server.git
$ cd gns3-server
$ git tag --list 'v2.2.*'
$ git checkout v2.2.7
$ pypi2pkgalias git+file://$PWD
$ cd ..
Repeat the process with GNS3-GUI.
$ git clone https://github.com/GNS3/gns3-gui.git
$ cd gns3-gui
$ git tag --list 'v2.2.*'
$ git checkout v2.2.7
$ pypi2pkgalias git+file://$PWD
$ pacman -Qe | grep gns3
python-gns3-gui-git 2.2.7.r0.gb1ec9d53-1
python-gns3-server-git 2.2.7.r0.g087cba39-1
To create a Gnome launcher, the following may be used.
$ sudo tee -a /usr/share/applications/gns3.desktop > /dev/null << EOL
> [Desktop Entry]
> Type=Application
> Encoding=UTF-8
> Name=GNS3
> GenericName=Graphical Network Simulator 3
> Comment=Graphical Network Simulator 3
> Exec=/usr/bin/gns3
> Icon=gns3
> Terminal=false
> Categories=Application;Network;Qt;
> EOL
June 29th 2019
- As usual, there were a ton of minor bugs in the initial commit. The script should now be completely functional. Some cosmetic changes will be added to make the script more readable.