## Preparation This example requires a PNF, emulated with a VyOS router (image [here](http://osm-download.etsi.org/ftp/osm-6.0-six/7th-hackfest/images/vyos-1.1.7-cloudinit.qcow2.tgz)), connected to a shared management network (osm-ext in this example) and to a shared internal "sgi" network where the Slice will be placed. 1. Upload the descriptors to OSM, make sure you add the following charms to your package: * PNF --> https://github.com/charmed-osm/vyos-config * AGW VNF --> https://github.com/charmed-osm/magmagw 2. Add the PDU with the yaml file (emulated by a VyOS VM in this environment) 3. Upload the Slice template with `osm netslice-template-create magma_slice.yaml` 4. Make sure you got the images for AGW and srsLTE emulator, available at ETSI VIM or at the hackfest@172.21.248.19 home directory. ## Launching the Slice 1. Edit the params.yaml and set a MetalLB address for your Magma Orc8r-proxy service, which AGW will connect to. Set a name and ID for th first AGW as well. 2. Launch the slice with: `osm nsi-create --nsi_name magma_slice --nst_name magma_slice_hackfest_nst --config_file params.yaml --vim_account ` 3. Go to the K8s cluster and run the following commands before the AGW's charm run (temporal workaround for running a command in a POD): ``` NAMESPACE= kubectl exec -it -n $NAMESPACE $(kubectl get pod -n $NAMESPACE -l app.kubernetes.io/component=controller -o jsonpath="{.items[0].metadata.name}") -- /var/opt/magma/bin/accessc add-existing -admin -cert /var/opt/magma/certs/admin_operator.pem admin_operator error: unable to upgrade connection: container not found ("orc8r-controller") ``` ## Verifying the services 1. Visit the Orc8r at the KNF's nginx-proxy svc (https) with credentials admin@magma.test / password1234, then check that your AGW has been registered successfully (after proxy charms are finished) 2. Via this dashboard, add the test subscriber with the following parameters: - IMSI: 722070000000008 - KEY: c8eba87c1074edd06885cb0486718341 - OPC: 17b6c0157895bcaa1efc1cef55033f5f 3. The emulator is ready to connect, Day-2 primitives for this is WIP, in the meantime, the following commands can be used to connect the eNB and UE, respectively and in that order. ### Configuring eNodeB example `srsenb --enb.name=dummyENB01 --enb.mcc=901 --enb.mnc=70 --enb.mme_addr=192.168.100.254 --enb.gtp_bind_addr=192.168.100.10 --enb.s1c_bind_addr=192.168.100.10 --enb_files.rr_config=/config/rr.conf --enb_files.sib_config=/config/sib.conf --enb_files.drb_config=/config/drb.conf /config/enb.conf.fauxrf` ### Attaching UE example `sudo srsue --usim.imsi=722070000000008 --usim.k=c8eba87c1074edd06885cb0486718341 --usim.algo=milenage --usim.opc=17b6c0157895bcaa1efc1cef55033f5f --nas.apn=oai.ipv4 /config/ue.conf.fauxrf` ## Testing traffic After UE is attached (at emulator machine), a default route should be added (pending to put as Day-2 primitive), pointing to the GTP tunnel endpoint: `sudo route add -net 0.0.0.0/0 gw 192.168.128.1` Finally, a Day-2 primitive must be executed against the PNF to allow traffic from the specific Magma SGI IP address: `osm ns-action magma_slice.slice_hackfest_nsd_1 --vnf_name 2 --action_name configure-remote --params '{magmaIP: "192.168.239.10"}'` With this, the UE machine will have access to Internet through the AGW and then the VyOS PNF.