<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to build Magma AGW for source with dev build using Vagrant]]></title><description><![CDATA["Discover the power of Magma - our blog explores innovative ideas, trends, and updates in technology and beyond. Stay informed!"]]></description><link>https://blog.redemptionincsoftwares.co.zw</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1690520234717/CnjI06fRs.jpeg</url><title>How to build Magma AGW for source with dev build using Vagrant</title><link>https://blog.redemptionincsoftwares.co.zw</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 00:10:19 GMT</lastBuildDate><atom:link href="https://blog.redemptionincsoftwares.co.zw/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to build Magma AGW using Vagrant]]></title><description><![CDATA[Prerequisites
VirtualBox Vagrant
Setting up AGW

Download magma repo:
Magma repo
git clone https://github.com/magma/magma.git

Move to gateway folder:
cd magma/lte/gateway

download vagrant box:
vagrant box add magmacore/magma_dev \
  --box-version=1...]]></description><link>https://blog.redemptionincsoftwares.co.zw/how-to-build-magma-agw-using-vagrant</link><guid isPermaLink="true">https://blog.redemptionincsoftwares.co.zw/how-to-build-magma-agw-using-vagrant</guid><category><![CDATA[magma agw, magma lte, magma access gateway]]></category><dc:creator><![CDATA[Redemption Paradzai Gwira]]></dc:creator><pubDate>Sun, 23 Apr 2023 20:57:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/A7v1wiCx84c/upload/ff869ecd9832474cf63a19c3e5e25303.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-prerequisites"><code>Prerequisites</code></h3>
<p><a target="_blank" href="https://www.virtualbox.org/"><code>VirtualBox</code></a> <a target="_blank" href="https://vagrantup.com/"><code>Vagrant</code></a></p>
<h3 id="heading-setting-up-agw"><code>Setting up AGW</code></h3>
<hr />
<h2 id="heading-download-magma-repo"><code>Download magma repo</code>:</h2>
<p><a target="_blank" href="https://github.com/magma/magma.git">Magma repo</a></p>
<pre><code class="lang-go">git clone https:<span class="hljs-comment">//github.com/magma/magma.git</span>
</code></pre>
<h3 id="heading-move-to-gateway-folder"><code>Move to gateway folder:</code></h3>
<pre><code class="lang-go">cd magma/lte/gateway
</code></pre>
<h3 id="heading-download-vagrant-box"><code>download vagrant box:</code></h3>
<pre><code class="lang-go">vagrant box add magmacore/magma_dev \
  --box-version=<span class="hljs-number">1.1</span><span class="hljs-number">.20210618</span> \
  --provider=virtualbox
</code></pre>
<h3 id="heading-install-ansible"><code>install ansible:</code></h3>
<pre><code class="lang-go">Ubuntu
sudo apt install ansible

Fedora/Centos
sudo dnf install ansible

Mac
brew install ansible
</code></pre>
<h3 id="heading-start-vagrant-box"><code>start vagrant box:</code></h3>
<pre><code class="lang-go">vagrant up magma
</code></pre>
<p><code>ssh inside vagrant box:</code></p>
<pre><code class="lang-go">vagrant ssh magma
username: vagrant 
password: vagrant
</code></pre>
<h2 id="heading-build-agw"><code>Build AGW</code></h2>
<h3 id="heading-build-agw-1"><code>build AGW</code></h3>
<pre><code class="lang-go">cd magma/lte/gateway
<span class="hljs-built_in">make</span> run
</code></pre>
<h3 id="heading-install-scp-plugin-for-vagrant-and-copy-the-rootcapem-file-to-agw"><code>Install scp plugin for Vagrant and copy the rootCA.pem file to AGW</code></h3>
<pre><code class="lang-go">vagrant plugin install vagrant-scp
vagrant scp /tmp/rootCA.pem magma:~

vagrant ssh magma
</code></pre>
<h2 id="heading-configure-agw"><code>Configure AGW</code></h2>
<h3 id="heading-first-copy-the-root-ca-for-your-orchestrator-deployment-into-your-agw"><code>First, copy the root CA for your Orchestrator deployment into your AGW:</code></h3>
<pre><code class="lang-go">sudo mkdir -p /<span class="hljs-keyword">var</span>/opt/magma/tmp/certs/
sudo mv rootCA.pem /<span class="hljs-keyword">var</span>/opt/magma/tmp/certs/rootCA.pem
</code></pre>
<h3 id="heading-then-point-your-agw-to-your-orchestrator"><code>Then, point your AGW to your Orchestrator:</code></h3>
<pre><code class="lang-go">sudo mkdir -p /<span class="hljs-keyword">var</span>/opt/magma/configs
cd /<span class="hljs-keyword">var</span>/opt/magma/configs
sudo vim control_proxy.yml
</code></pre>
<h3 id="heading-put-the-following-contents-into-the-file"><code>Put the following contents into the file:</code></h3>
<pre><code class="lang-go">cloud_address: controller.magma.redemption.com 
cloud_port: <span class="hljs-number">443</span>
bootstrap_address: bootstrapper-controller.magma.redemption.com
bootstrap_port: <span class="hljs-number">443</span>
fluentd_address: fluentd.magma.redemption.com
fluentd_port: <span class="hljs-number">24224</span>

You can use your custom dns configs <span class="hljs-keyword">for</span> the above 

rootca_cert: /<span class="hljs-keyword">var</span>/opt/magma/tmp/certs/rootCA.pem
</code></pre>
<h3 id="heading-then-restart-your-services-to-pick-up-the-config-changes"><code>Then restart your services to pick up the config changes:</code></h3>
<pre><code class="lang-go">sudo service magma@* stop
sudo service magma@magmad restart
sudo service magma@magmad status

# check status of magma services
sudo systemctl status magma@*
</code></pre>
<h3 id="heading-check-logs"><code>check logs:</code></h3>
<pre><code class="lang-go">sudo tail -f /<span class="hljs-keyword">var</span>/log/syslog
sudo journalctl -fu magma@magmad
</code></pre>
<h3 id="heading-grab-the-hardware-secrets-off-your-agw"><code>Grab the hardware secrets off your AGW:</code></h3>
<pre><code class="lang-go">show_gateway_info.py

# <span class="hljs-keyword">if</span> above command doesn<span class="hljs-string">'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</span>
</code></pre>
<p>test network:</p>
<pre><code class="lang-go">checkin_cli.py
</code></pre>
<h2 id="heading-extras"><code>Extras</code></h2>
<h3 id="heading-generate-new-challenge-key"><code>Generate new Challenge key:</code></h3>
<pre><code class="lang-go">cd /<span class="hljs-keyword">var</span>/opt/magma/certs

# Generate Private key
sudo openssl ecparam -name secp384r1 -genkey -noout -out gw_challenge.key
sudo chmod <span class="hljs-number">644</span> gw_challenge.key

# Generate Public key
openssl ec -in gw_challenge.key -pubout -out gw_challenge.pem
GW_CHALLENGE=$(cat gw_challenge.pem | sed <span class="hljs-string">'5d'</span> | sed <span class="hljs-string">'1d'</span> | tr -d <span class="hljs-string">'\n'</span>)
echo ${GW_CHALLENGE}
</code></pre>
<h3 id="heading-generate-new-hardware-id"><code>Generate new Hardware ID:</code></h3>
<pre><code class="lang-go">sudo uuidgen &gt; /etc/snowflake
sudo snowflake --force-<span class="hljs-built_in">new</span>-key
</code></pre>
<h3 id="heading-remove-gateway-keys-and-network-config"><code>Remove gateway keys and network config:</code></h3>
<pre><code class="lang-go">sudo rm /<span class="hljs-keyword">var</span>/opt/magma/certs/gateway.crt
sudo rm /<span class="hljs-keyword">var</span>/opt/magma/certs/gateway.key
sudo rm /<span class="hljs-keyword">var</span>/opt/magma/configs/gateway.mconfig
</code></pre>
<h3 id="heading-check-certificate-details"><code>Check certificate details:</code></h3>
<pre><code class="lang-go">openssl x509 -text -noout -in rootCA.pem

openssl x509 -text -noout -in /<span class="hljs-keyword">var</span>/opt/magma/tmp/certs/rootCA.pem
</code></pre>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/channel/UCf-tTLM6XzMZK7WPXpUKVMg">https://www.youtube.com/channel/UCf-tTLM6XzMZK7WPXpUKVMg</a></div>
]]></content:encoded></item></channel></rss>