2018-07-31 20:57:30 +01:00
# CORE Installation
* Table of Contents
{:toc}
# Overview
2019-06-10 19:41:27 +01:00
This section will describe how to install CORE from source or from a pre-built package.
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
# Required Hardware
2018-07-31 20:57:30 +01:00
2019-12-20 20:55:52 +00:00
Any computer capable of running Linux should be able to run CORE. Since the physical machine will be hosting numerous
2019-06-10 19:41:27 +01:00
virtual machines, as a general rule you should select a machine having as much RAM and CPU resources as possible.
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
# Operating System
2019-12-20 20:55:52 +00:00
CORE requires a Linux operating system because it uses virtualization provided by the kernel. It does not run on
Windows or Mac OS X operating systems (unless it is running within a virtual machine guest.) The virtualization
2019-06-10 19:41:27 +01:00
technology that CORE currently uses is Linux network namespaces.
2019-12-20 20:55:52 +00:00
Ubuntu and Fedora/CentOS Linux are the recommended distributions for running CORE. However, these distributions are
2019-06-10 19:41:27 +01:00
not strictly required. CORE will likely work on other flavors of Linux as well, assuming dependencies are met.
2018-07-31 20:57:30 +01:00
2019-12-20 20:55:52 +00:00
**NOTE: CORE Services determine what run on each node. You may require other software packages depending on the
2019-06-10 19:41:27 +01:00
services you wish to use. For example, the HTTP service will require the apache2 package.**
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
# Installed Files
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
CORE files are installed to the following directories, when the installation prefix is ** /usr**.
2018-07-31 20:57:30 +01:00
Install Path | Description
-------------|------------
2018-08-02 18:12:05 +01:00
/usr/bin/core-gui|GUI startup command
2019-12-30 06:55:26 +00:00
/usr/bin/coretk-gui|BETA Python GUI
2018-07-31 20:57:30 +01:00
/usr/bin/core-daemon|Daemon startup command
2019-06-10 19:41:27 +01:00
/usr/bin/{core-cleanup, coresendmsg, core-manage}|Misc. helper commands/scripts
2018-07-31 20:57:30 +01:00
/usr/lib/core|GUI files
2019-10-18 22:52:08 +01:00
/usr/lib/python{3.6+}/dist-packages/core|Python modules for daemon/scripts
2019-06-10 19:41:27 +01:00
/etc/core/|Daemon and log configuration files
2018-07-31 20:57:30 +01:00
~/.core/|User-specific GUI preferences and scenario files
/usr/share/core/|Example scripts and scenarios
/usr/share/man/man1/|Command man pages
/etc/init.d/core-daemon|SysV startup script for daemon
2020-01-24 14:28:53 +00:00
/usr/lib/systemd/system/core-daemon.service|Systemd startup script for daemon
2018-07-31 20:57:30 +01:00
2019-10-03 20:11:12 +01:00
# Pre-Req Installing Python
You may already have these installed, and can ignore this step if so, but if
needed you can run the following to install python and pip.
```shell
2019-12-30 06:55:26 +00:00
sudo apt install python3.6
2019-10-03 20:11:12 +01:00
sudo apt install python3-pip
```
2019-06-10 21:15:34 +01:00
# Pre-Req Python Requirements
2018-07-31 20:57:30 +01:00
2019-06-10 21:15:34 +01:00
The newly added gRPC API which depends on python library grpcio is not commonly found within system repos.
To account for this it would be recommended to install the python dependencies using the **requirements.txt** found in
2019-06-18 04:21:43 +01:00
the latest [CORE Release ](https://github.com/coreemu/core/releases ).
2019-06-10 21:15:34 +01:00
```shell
2019-12-30 06:55:26 +00:00
sudo pip3 install -r requirements.txt
2019-06-10 21:15:34 +01:00
```
2019-06-10 19:41:27 +01:00
# Pre-Req Installing OSPF MDR
2018-07-31 20:57:30 +01:00
2019-12-20 20:55:52 +00:00
Virtual networks generally require some form of routing in order to work (e.g. to automatically populate routing
tables for routing packets from one subnet to another.) CORE builds OSPF routing protocol configurations by
default when the blue router node type is used.
2018-07-31 20:57:30 +01:00
2019-12-20 20:55:52 +00:00
* [OSPF MANET Designated Routers ](https://github.com/USNavalResearchLaboratory/ospf-mdr ) (MDR) - the Quagga routing
suite with a modified version of OSPFv3, optimized for use with mobile wireless networks. The **mdr** node type
2019-06-10 19:41:27 +01:00
(and the MDR service) requires this variant of Quagga.
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
## Ubuntu <= 16.04 and Fedora/CentOS
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
There is a built package which can be used.
2018-07-31 20:57:30 +01:00
```shell
2019-12-17 18:58:03 +00:00
wget https://github.com/USNavalResearchLaboratory/ospf-mdr/releases/download/v0.99.21mr2.2/quagga-mr_0.99.21mr2.2_amd64.deb
2018-07-31 20:57:30 +01:00
sudo dpkg -i quagga-mr_0.99.21mr2.2_amd64.deb
```
2019-06-10 19:41:27 +01:00
## Ubuntu >= 18.04
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
Requires building from source, from the latest nightly snapshot.
2018-07-31 20:57:30 +01:00
```shell
2019-06-21 20:51:20 +01:00
# packages needed beyond what's normally required to build core on ubuntu
2019-12-20 20:55:52 +00:00
sudo apt install libtool libreadline-dev autoconf gawk
2019-06-21 20:51:20 +01:00
2019-12-17 18:58:03 +00:00
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr
cd ospf-mdr
2019-06-21 20:51:20 +01:00
./bootstrap.sh
2019-06-21 20:57:32 +01:00
./configure --disable-doc --enable-user=root --enable-group=root --with-cflags=-ggdb \
2019-06-10 19:41:27 +01:00
--sysconfdir=/usr/local/etc/quagga --enable-vtysh \
--localstatedir=/var/run/quagga
make
sudo make install
2018-07-31 20:57:30 +01:00
```
2019-12-20 20:55:52 +00:00
Note that the configuration directory */usr/local/etc/quagga* shown for Quagga above could be */etc/quagga* ,
if you create a symbolic link from */etc/quagga/Quagga.conf -> /usr/local/etc/quagga/Quagga.conf* on the host.
2019-06-10 19:41:27 +01:00
The *quaggaboot.sh* script in a Linux network namespace will try and do this for you if needed.
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
If you try to run quagga after installing from source and get an error such as:
2018-07-31 20:57:30 +01:00
```shell
2019-06-10 19:41:27 +01:00
error while loading shared libraries libzebra.so.0
2018-07-31 20:57:30 +01:00
```
2019-06-10 19:41:27 +01:00
this is usually a sign that you have to run ```sudo ldconfig```` to refresh the cache file.
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
# Installing from Packages
2018-07-31 20:57:30 +01:00
2019-12-20 20:55:52 +00:00
The easiest way to install CORE is using the pre-built packages. The package managers on Ubuntu or Fedora/CentOS
will help in automatically installing most dependencies, except for the python ones described previously.
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
You can obtain the CORE packages from [CORE Releases ](https://github.com/coreemu/core/releases ).
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
## Ubuntu
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
Ubuntu package defaults to using systemd for running as a service.
2018-07-31 20:57:30 +01:00
```shell
2019-12-30 06:55:26 +00:00
sudo apt install ./core_$VERSION_amd64.deb
2018-07-31 20:57:30 +01:00
```
2019-06-10 19:41:27 +01:00
Run the CORE GUI as a normal user:
2018-07-31 20:57:30 +01:00
```shell
2019-06-10 19:41:27 +01:00
core-gui
2018-07-31 20:57:30 +01:00
```
2019-12-20 20:55:52 +00:00
After running the *core-gui* command, a GUI should appear with a canvas for drawing topologies.
2019-06-10 19:41:27 +01:00
Messages will print out on the console about connecting to the CORE daemon.
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
## Fedora/CentOS
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
**NOTE: tkimg is not required for the core-gui, but if you get an error message about it you can install the package
2019-12-20 20:55:52 +00:00
on CentOS < = 6, or build from source otherwise**
2018-07-31 20:57:30 +01:00
```shell
2019-12-30 06:55:26 +00:00
yum install ./core_$VERSION_x86_64.rpm
2018-07-31 20:57:30 +01:00
```
2019-06-10 22:59:42 +01:00
Disabling SELINUX:
2018-07-31 20:57:30 +01:00
```shell
2019-06-10 22:59:42 +01:00
# change the following in /etc/sysconfig/selinux
SELINUX=disabled
# add the following to the kernel line in /etc/grub.conf
selinux=0
2018-07-31 20:57:30 +01:00
2019-06-10 22:59:42 +01:00
# Fedora 15 and newer, disable sandboxd
# reboot in order for this change to take effect
chkconfig sandbox off
```
2018-07-31 20:57:30 +01:00
Turn off firewalls:
```shell
systemctl disable firewalld
systemctl disable iptables.service
systemctl disable ip6tables.service
chkconfig iptables off
chkconfig ip6tables off
```
2018-08-02 18:12:05 +01:00
You need to reboot after making these changes, or flush the firewall using
2018-07-31 20:57:30 +01:00
```shell
iptables -F
ip6tables -F
```
2019-06-10 19:41:27 +01:00
Start the CORE daemon.
2018-07-31 20:57:30 +01:00
```shell
# systemd
sudo systemctl daemon-reload
sudo systemctl start core-daemon
# sysv
sudo service core-daemon start
```
Run the CORE GUI as a normal user:
```shell
core-gui
```
After running the *core-gui* command, a GUI should appear with a canvas for drawing topologies. Messages will print out on the console about connecting to the CORE daemon.
2019-06-10 19:41:27 +01:00
# Building and Installing from Source
2018-07-31 20:57:30 +01:00
2019-12-20 20:55:52 +00:00
This option is listed here for developers and advanced users who are comfortable patching and building source code.
2019-06-10 19:41:27 +01:00
Please consider using the binary packages instead for a simplified install experience.
2018-07-31 20:57:30 +01:00
2019-07-02 16:42:01 +01:00
## Download and Extract Source Code
2018-07-31 20:57:30 +01:00
2019-07-02 16:42:01 +01:00
You can obtain the CORE source from the [CORE GitHub ](https://github.com/coreemu/core ) page.
2019-06-10 20:41:30 +01:00
2019-07-02 16:42:01 +01:00
## Install grpcio-tools
2019-06-10 20:41:30 +01:00
2019-06-10 21:15:34 +01:00
Python module grpcio-tools is currently needed to generate code from the CORE protobuf file during the build.
2018-09-10 23:25:28 +01:00
```shell
2019-12-30 06:55:26 +00:00
sudo pip3 install grpcio-tools
2018-09-10 23:25:28 +01:00
```
2019-07-02 16:42:01 +01:00
## Distro Requirements
2018-07-31 20:57:30 +01:00
2019-07-02 16:42:01 +01:00
### Ubuntu 18.04 Requirements
2018-08-03 16:24:55 +01:00
```shell
2019-12-30 07:18:40 +00:00
sudo apt install automake pkg-config gcc iproute2 libev-dev ebtables python3.6 python3.6-dev python3-pip tk libtk-img ethtool python3-tk
2018-08-03 16:24:55 +01:00
```
2019-07-02 16:42:01 +01:00
### Ubuntu 16.04 Requirements
2018-07-31 20:57:30 +01:00
```shell
2019-12-23 22:48:56 +00:00
sudo apt-get install automake ebtables python3-dev libev-dev python3-setuptools libtk-img ethtool
2018-10-18 18:56:41 +01:00
```
2019-07-02 16:42:01 +01:00
### CentOS 7 with Gnome Desktop Requirements
2018-07-31 20:57:30 +01:00
2018-10-18 18:56:41 +01:00
```shell
2019-12-30 06:55:26 +00:00
sudo yum -y install automake gcc python36 python36-devel libev-devel tk ethtool iptables-ebtables iproute python3-pip python3-tkinter
2018-10-18 18:56:41 +01:00
```
2019-06-10 19:41:27 +01:00
## Build and Install
2018-10-18 21:12:30 +01:00
2018-10-18 18:56:41 +01:00
```shell
./bootstrap.sh
2019-12-23 22:48:56 +00:00
./configure
2018-10-18 18:56:41 +01:00
make
2018-07-31 20:57:30 +01:00
sudo make install
2018-10-18 18:56:41 +01:00
```
2018-07-31 20:57:30 +01:00
2019-07-02 16:42:01 +01:00
# Building Documentation
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
Building documentation requires python-sphinx not noted above.
2018-07-31 20:57:30 +01:00
```shell
2019-06-10 20:26:44 +01:00
sudo apt install python3-sphinx
sudo yum install python3-sphinx
2018-07-31 20:57:30 +01:00
2018-10-18 18:56:41 +01:00
./bootstrap.sh
2019-12-23 22:48:56 +00:00
./configure
2019-06-10 19:41:27 +01:00
make doc
2018-07-31 20:57:30 +01:00
```
2019-07-02 16:42:01 +01:00
# Building Packages
2019-06-10 22:59:42 +01:00
Build package commands, DESTDIR is used to make install into and then for packaging by fpm.
2018-07-31 20:57:30 +01:00
2019-06-10 22:59:42 +01:00
**NOTE: clean the DESTDIR if re-using the same directory**
2018-07-31 20:57:30 +01:00
2019-06-10 19:41:27 +01:00
* Install [fpm ](http://fpm.readthedocs.io/en/latest/installing.html )
2018-07-31 20:57:30 +01:00
```shell
2019-06-10 19:41:27 +01:00
./bootstrap.sh
2019-12-23 22:48:56 +00:00
./configure
2018-07-31 20:57:30 +01:00
make
2019-06-10 19:41:27 +01:00
mkdir /tmp/core-build
make fpm DESTDIR=/tmp/core-build
2018-07-31 20:57:30 +01:00
```
2019-12-20 20:55:52 +00:00
This will produce and RPM and Deb package for the currently configured python version.