From 67cd47f0e8c2f889733434a48b86c8a4a774e8a5 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 23 Feb 2022 15:25:32 +0100 Subject: [PATCH] net: virtphy, osmo-bts-virtual: use loopback-dev Use the loopback device for virtual Um traffic, so it doesn't slow down other net devs. Change-Id: Ibc7ff3aaaca4872f4105825167eb33b66bc23342 --- net/templates/common_osmo_bts | 1 + net/templates/run.sh | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/net/templates/common_osmo_bts b/net/templates/common_osmo_bts index 4244e34..06bd439 100644 --- a/net/templates/common_osmo_bts +++ b/net/templates/common_osmo_bts @@ -3,6 +3,7 @@ line vty phy 0 instance 0 + virtual-um net-device lo bts 0 band ${BTS_BAND} diff --git a/net/templates/run.sh b/net/templates/run.sh index a5a8720..e4e8356 100755 --- a/net/templates/run.sh +++ b/net/templates/run.sh @@ -46,6 +46,18 @@ if [ -z "$(ip addr show | grep "${TO_RAN_IU_IP}")" ]; then sudo ip addr add ${TO_RAN_IU_IP}/32 dev $dev fi +# Enable multicast on lo for virtual MS +if [ "${MS_RUN_IN_OSMO_DEV}" = 1 ]; then + if [ -z "$(ip link show lo | grep MULTICAST)" ]; then + echo "Loopback device doesn't have multicast enabled! Hit enter to enable it" + read enter_to_continue + sudo ip link set lo multicast on + fi + if [ -z "$(ip route show dev lo | grep '224\.0\.0\.0/4')" ]; then + sudo ip route add 224.0.0.0/4 dev lo + fi +fi + logdir="current_log" piddir="run/pids" launcherdir="run/launchers" @@ -183,7 +195,7 @@ stp4ran="osmo-stp -c osmo-stp-ran.cfg" bsc="LD_LIBRARY_PATH=/usr/local/lib gdb -ex run --args osmo-bsc" bscnat="osmo-bsc-nat" bts="osmo-bts-virtual" -virtphy="virtphy" +virtphy="virtphy -D lo" ms="mobile -c mobile.cfg" if [ "x${MSC_MNCC}" != "xinternal" ]; then