Commit db50078e authored by Joanne Hugé's avatar Joanne Hugé

Add multi-UE demo config used for ORS5 UE

parent e0053539
#!/bin/bash
# Copyright (C) 2022 Amarisoft
# lteue PDN configurator script version 2022-08-19
ue_id="$1" # UE ID
pdn_id="$2" # PDN unique id (start from 0)
ifname="$3" # Interface name
ipv4_addr="$4" # IPv4 address
ipv4_dns="$5" # IPv4 DNS
ipv6_local_addr="$6" # IPv6 local address
ipv6_dns="$7" # IPv6 DNS
old_link_local=""
#echo "Configure $ue_id/$pdn_id, tun=$ifname, ip=$ipv4_addr, dns=$ipv4_dns"
ifname1="pdn$pdn_id"
ip link set dev $ifname name $ifname1
ifname="$ifname1"
if [ "$ipv6_local_addr" != "" ] ; then
bash -c "echo '0' > /proc/sys/net/ipv6/conf/$ifname/disable_ipv6"
bash -c "echo '2' > /proc/sys/net/ipv6/conf/$ifname/accept_ra"
bash -c "echo '2' > /proc/sys/net/ipv6/conf/$ifname/router_solicitation_delay"
bash -c "echo '2' > /proc/sys/net/ipv6/conf/$ifname/autoconf"
else
bash -c "echo '1' > /proc/sys/net/ipv6/conf/$ifname/disable_ipv6"
fi
if [ "$pdn_id" = "0" ] ; then
ifconfig lo up
fi
ifconfig $ifname up
if [ "$ipv4_addr" != "" ] ; then
ifconfig $ifname $ipv4_addr/24
if [ "$pdn_id" = "0" ] ; then
ip route add default via $ipv4_addr
fi
fi
if [ "$ipv6_local_addr" != "" ] ; then
old_link_local=`ip addr show dev $ifname | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d'`
if [ "$old_link_local" != "" ] ; then
ifconfig $ifname inet6 del $old_link_local/64
fi
ifconfig $ifname inet6 add $ipv6_local_addr/64
fi
iptables -t nat -D POSTROUTING -o pdn0 -j MASQUERADE
ip6tables -t nat -D POSTROUTING -o pdn0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o pdn0 -j MASQUERADE
ip6tables -t nat -A POSTROUTING -o pdn0 -j MASQUERADE
ip -6 route add default via fe80::a1f0:e37f:f44c:907 dev pdn0
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
{
log_options: "all.level=info,all.max_size=1",
log_filename: "/tmp/ue0.log",
com_addr: "0.0.0.0:9002",
rf_driver: {
name: "sdr",
args: "dev0=/dev/sdr0",
rx_antenna:"tx_rx",
},
tx_gain: 20.0,
rx_gain: 15.0,
cell_groups: [{
group_type: "nr",
multi_ue: false,
cells: [{
rf_port: 0,
bandwidth: 40,
band: 78,
dl_nr_arfcn: 646666,
ssb_nr_arfcn: 645984,
subcarrier_spacing: 30,
n_antenna_dl: 2,
n_antenna_ul: 2,
}],
}],
ue_list: [
{
as_release: 15,
ue_category: "nr",
tun_setup_script: "ue-ifup",
attach_pdn_type: "ipv4v6",
apn: "internet",
sim_algo: "milenage",
imsi: "001010000000486",
opc: "000102030405060708090A0B0C0D0E0F",
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: "impu486",
impi: "impi486@amarisoft.com",
}
],
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment