Skip to content

ShubhamTatvamasi/magma-agw

Repository files navigation

magma-agw

Prerequisites

VirtualBox Vagrant


Setup AGW

download magma repo:

git clone https://github.com/magma/magma.git --depth 1

move to gateway folder:

cd magma/lte/gateway

download vagrant box:

vagrant box add magmacore/magma_dev \
  --box-version=1.1.20210618 \
  --provider=virtualbox

install ansible:

sudo apt install ansible

start vagrant box:

vagrant up magma

ssh inside vagrant box:

vagrant ssh magma

Build AGW

build AGW

cd magma/lte/gateway
make run

Install scp plugin for Vagrant and copy the rootCA.pem file to AGW

vagrant plugin install vagrant-scp
vagrant scp /tmp/rootCA.pem magma:~

vagrant ssh magma

Configure AGW

First, copy the root CA for your Orchestrator deployment into your AGW:

sudo mkdir -p /var/opt/magma/tmp/certs/
sudo mv rootCA.pem /var/opt/magma/tmp/certs/rootCA.pem

Then, point your AGW to your Orchestrator:

sudo mkdir -p /var/opt/magma/configs
cd /var/opt/magma/configs
sudo vim control_proxy.yml

Put the following contents into the file:

cloud_address: controller.magma.shubhamtatvamasi.com
cloud_port: 443
bootstrap_address: bootstrapper-controller.magma.shubhamtatvamasi.com
bootstrap_port: 443
fluentd_address: fluentd.magma.shubhamtatvamasi.com
fluentd_port: 24224

rootca_cert: /var/opt/magma/tmp/certs/rootCA.pem

Then restart your services to pick up the config changes:

sudo service magma@* stop
sudo service magma@magmad restart
sudo service magma@magmad status

# check status of magma services
sudo systemctl status magma@*

check logs:

sudo tail -f /var/log/syslog
sudo journalctl -fu magma@magmad

grab the hardware secrets off your AGW:

show_gateway_info.py

# if above command doesn't work
sudo pip3 install snowflake
export AGW_SCRIPTS=/home/vagrant/magma/orc8r/gateway/python
ln -s ${AGW_SCRIPTS}/magma ${AGW_SCRIPTS}/scripts/
${AGW_SCRIPTS}/scripts/show_gateway_info.py

test network:

checkin_cli.py

Extras

Generate new Challenge key:

cd /var/opt/magma/certs

# Generate Private key
sudo openssl ecparam -name secp384r1 -genkey -noout -out gw_challenge.key
sudo chmod 644 gw_challenge.key

# Generate Public key
openssl ec -in gw_challenge.key -pubout -out gw_challenge.pem
GW_CHALLENGE=$(cat gw_challenge.pem | sed '5d' | sed '1d' | tr -d '\n')
echo ${GW_CHALLENGE}

Generate new Hardware ID:

sudo uuidgen > /etc/snowflake
sudo snowflake --force-new-key

remove gateway keys and network config:

sudo rm /var/opt/magma/certs/gateway.crt
sudo rm /var/opt/magma/certs/gateway.key
sudo rm /var/opt/magma/configs/gateway.mconfig

check certificate details:

openssl x509 -text -noout -in rootCA.pem

openssl x509 -text -noout -in /var/opt/magma/tmp/certs/rootCA.pem

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages