Commit 544d50cc authored by Joanne Hugé's avatar Joanne Hugé

wip

parent f19a85df
......@@ -20,7 +20,7 @@ md5sum = 2e30c07c6436895ac0bc6c177cf7013d
[template-ors]
filename = instance-ors.cfg
md5sum = f025ab93e016fa3609a1bb4de69245ec
md5sum = 8a2fca573220c2abcc28a197be6048ce
[slaplte.jinja2]
_update_hash_filename_ = slaplte.jinja2
......@@ -96,7 +96,7 @@ md5sum = 315633c8d09b84ef1c699094810c654a
[template-ors-ue]
_update_hash_filename_ = instance-ors-ue.jinja2.cfg
md5sum = b5f880719b827b70736dff2a335d2876
md5sum = f4389a92fb111447e7976e452db78607
[template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg
......@@ -152,12 +152,16 @@ md5sum = f07c85916bcb7e4002c8edc3d087c1be
[ue.jinja2.cfg]
filename = config/ue.jinja2.cfg
md5sum = 15e571b83f821319f24b0e903f2ea157
md5sum = 2653ee016af078188e9310db44e7c1e8
[ru_lopcomm_CreateProcessingEle.jinja2.xml]
_update_hash_filename_ = ru/lopcomm/CreateProcessingEle.jinja2.xml
md5sum = e435990eb0a0d4be41efa9bd16dce09b
[ue-ifup]
_update_hash_filename_ = config/ue-ifup
md5sum = f02fbfd31ba89cf243e2752adcae28d9
[ru_lopcomm_cu_config.jinja2.xml]
_update_hash_filename_ = ru/lopcomm/cu_config.jinja2.xml
md5sum = 346c911e1ac5e5001a39c8926b44c91e
......
#!/bin/bash
ue_id="$1"
pdn_id="$2"
ifname="$3"
ipv4_addr="$4"
ipv4_dns="$5"
ipv6_local_addr="$6"
ipv6_dns="$7"
param="$8"
old_link_local=""
shift; shift; shift; shift; shift; shift; shift; shift;
while [ "$1" != "" ] ; do
case "$1" in
--mtu)
mtu="$2"
shift
;;
*)
echo "Bad parameter: $1" >&2
exit 1
;;
esac
shift
done
if [ "$pdn_id" != "0" ] ; then
echo "We should have only PDN 0, exiting..."
exit 1
fi
echo "Configure $ue_id($param) on pdn $pdn_id, tun=$ifname, ip=$ipv4_addr, dns=$ipv4_dns, ip6=$ipv6_local_addr, ip6_dns=$ipv6_dns"
if [ "$ipv4_dns" != "" ] || [ "$ipv6_dns" != "" ] ; then
if [ "$ipv4_dns" != "" ] ; then
echo "nameserver $ipv4_dns" >> /etc/resolv.conf
fi
if [ "$ipv6_dns" != "" ] ; then
echo "nameserver $ipv6_dns" >> /etc/resolv.conf
fi
fi
if [ "$ipv6_local_addr" != "" ] ; then
echo '0' > /proc/sys/net/ipv6/conf/$ifname/disable_ipv6
echo '1' > /proc/sys/net/ipv6/conf/$ifname/accept_ra
echo '1' > /proc/sys/net/ipv6/conf/$ifname/router_solicitation_delay
echo '1' > /proc/sys/net/ipv6/conf/$ifname/autoconf
else
echo '1' > /proc/sys/net/ipv6/conf/$ifname/disable_ipv6
fi
ifconfig $ifname up
if [ "$ipv4_addr" != "" ] ; then
ifconfig $ifname $ipv4_addr/24
if [ "$mtu" != "" ] ; then
ifconfig $ifname mtu $mtu
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
if [ "$ipv4_addr" != "" -a "$ipv6_local_addr" != "" ] ; then
echo "MAC_ADDR="$(ip link show dev $ifname | grep -oP "ether \K[\d:a-f]+")
fi
......@@ -114,7 +114,7 @@
{%- else %}
{%- do bug('unreachable') %}
{%- endif %}
tun_setup_script: "ue-ifup",
tun_setup_script: "{{ ue_ifup }}",
apn: "internet",
},
{%- endfor %}
......
......@@ -76,6 +76,7 @@ context -=
json ors false
context +=
key ors :ors
raw ue_ifup {{ ue_ifup }}
ors = {{ dumps(ors_version) }}
# add ORS-specific bits to published information
......
......@@ -40,6 +40,7 @@ filename = instance-ue.cfg
extra-context +=
section ors ors-version
section ors_version ors-version
raw ue_ifup ${ue-ifup:target}
import-list +=
rawfile instance-ue-base.jinja2.cfg ${template-ue:target}
......
......@@ -25,3 +25,6 @@ output = ${buildout:directory}/template.cfg
[template-ors-ue]
<= download-base
[ue-ifup]
<= download-base
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