open5gs/docs/_docs/platform/05-macosx.md

3.0 KiB

title head_inline
Mac OS X <style> .blue { color: blue; } </style>

This guide is based on macOS High Sierra 10.13.3. {: .blue}

Installing Homebrew


$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Getting MongoDB


Install MongoDB with Package Manager.

$ brew tap mongodb/brew
$ brew install mongodb-community

Run MongoDB server.

$ mkdir -p ./data/db
$ mongod --dbpath ./data/db

Setting up TUN device (No persistent after rebooting)


Install TUN/TAP driver

Configure the TUN device.

$ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
$ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
$ sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
$ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255

Enable IP forwarding & Masquerading

$ sudo sysctl -w net.inet.ip.forwarding=1
$ sudo sh -c "echo 'nat on {en0} from 45.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.nextepc"
$ sudo pfctl -e -f /etc/pf.anchors/org.nextepc

Tip: The script provided in [$GIT_REPO/support/network/restart.sh](https://github.com/{{ site.github_username }}/nextepc/blob/master/support/network/restart.sh) makes it easy to configure the TUN device as follows:
$ sudo ./support/network/restart.sh {: .notice--info}

Building NextEPC


Install the depedencies for building the source code.

$ brew install autoconf automake libtool gnu-sed mongo-c-driver libusrsctp gnutls libgcrypt libidn libyaml pkg-config

Git clone with --recursive option.

➜  open5gs git clone --recursive https://github.com/{{ site.github_username }}/nextepc

To compile with autotools:

➜  open5gs cd nextepc
➜  nextepc git:(master) ✗ autoreconf -iv
➜  nextepc git:(master) ✗ ./configure --prefix=`pwd`/install
➜  nextepc git:(master) ✗ make -j `nproc`

Check whether the compilation is correct.

Note: This should require sudo due to access /dev/tun0. {: .notice--danger}

➜  nextepc git:(master) ✗ sudo make check

Tip: You can also check the result of make check with a tool that captures packets. If you are running wireshark, select the loopback interface and set FILTER to s1ap || gtpv2 || diameter || gtp. You can see the virtually created packets. testcomplex.pcapng({{ site.url }}{{ site.baseurl }}/assets/pcapng/testcomplex.pcapng) {: .notice--info}

You need to perform the installation process.

➜  nextepc git:(master) ✗ make install

Building WebUI of NextEPC


Node.js is required to build WebUI of NextEPC

$ brew install node

Install the dependencies to run WebUI

➜  nextepc git:(master)cd webui
➜  webui git:(master) ✗ npm install

The WebUI runs as an npm script.

➜  webui git:(master) ✗ npm run dev