Try   HackMD

20180914_5G Workshop Commands - NextEPC part

KVM installation

sudo apt-get -y install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser `id -un` libvirtd
sudo virsh list --all

sudo apt-get install virt-manager
sudo virt-manager

NextEPC installation

  1. Install Mongo DB
sudo apt-get update 
sudo apt-get -y install mongodb 
sudo systemctl start mongodb
  1. Set TUN device
ls -al /dev/net/tun

If it is not "crw-rw-rw- 1 root 28 10, 200 Feb 11 05:13 /dev/net/tun", then

chmod 666 /dev/net/tun
  1. Write the configuration file for the TUN deivce
sudo sh -c "cat << EOF > /etc/systemd/network/99-nextepc.netdev
[NetDev]
Name=pgwtun
Kind=tun
EOF"
  1. Create the TUN device
sudo systemctl enable systemd-networkd
sudo systemctl restart systemd-networkd
sudo apt-get -y install net-tools
ifconfig pgwtun
  1. Check IPv6 Kernel Configuration
sysctl -n net.ipv6.conf.pgwtun.disable_ipv6
(if the output is 0 and IPv6 is enabled, skip the following 2 lines)
sudo sh -c "echo 'net.ipv6.conf.pgwtun.disable_ipv6=0' > /etc/sysctl.d/30-nextepc.conf"
sudo sysctl -p /etc/sysctl.d/30-nextepc.conf
  1. Set the IP address on TUN device
sudo sh -c "cat << EOF > /etc/systemd/network/99-nextepc.network
[Match]
Name=pgwtun
[Network]
Address=45.45.0.1/16
Address=cafe::1/64
EOF"

sudo systemctl enable systemd-networkd
sudo systemctl restart systemd-networkd
ifconfig pgwtun
  1. Install the necessary packages (15x packages)
sudo apt-get -y install autoconf libtool gcc pkg-config git flex bison libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev libyaml-dev
  1. Git clone and compile
git clone https://github.com/acetcom/nextepc
cd nextepc
autoreconf -iv
./configure --prefix=`pwd`/install
make -j `nproc`
make install
  1. Verify the installation
./test/testepc

WebUI installation

  1. Install npm and Nodejs for webui to control HSS database
sudo apt-get -y install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get -y install nodejs

cd webui
npm install
  1. Run WebUI
npm run dev
  1. Add new user to HSS database
Connect to http://localhost:3000/
Account: admin / Password: 1423
Click “+” buttion
Fill the K/OPc/IMSI and click “Save”

SIM card Information

IMSI: 208930000000003
OPc: 8e27b6af0e692e750f32667a3b14605d
K: 8baf473f2f8fd09487cccbd7097c6862

  1. Modify the configuration of NextEPC
gedit ./install/etc/nextepc/nextepc.conf

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. Set the rule for forwading packets from NextEPC to Internet
sudo ifconfig ens38 192.188.2.2
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
sudo iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE
sudo iptables -I INPUT -i pgwtun -j ACCEPT

Run nextepc

./nextepc-epcd