mirror of https://gerrit.osmocom.org/osmo-dev
net: add osmo-bsc-nat
Make STP_CN_IP and STP_RAN_IP configurable. If they are not set to the same IP, run a second OsmoSTP and OsmoBSCNAT to connect both OsmoSTP. Related: OS#2545 Change-Id: I8bfbd00bfeeebc6e1b87a8cd6333212db4380653
This commit is contained in:
parent
8fd5098f3f
commit
a3a1a0d94a
|
@ -109,6 +109,18 @@ GGSN_GTP_STATE_DIR=/tmp
|
||||||
SIPCON_SIP="${TO_SIP_IP}"
|
SIPCON_SIP="${TO_SIP_IP}"
|
||||||
SIPCON_SIP_PORT="5060"
|
SIPCON_SIP_PORT="5060"
|
||||||
|
|
||||||
|
STP_CN_IP="127.0.0.1"
|
||||||
|
STP_RAN_IP="127.0.0.1"
|
||||||
|
# Set STP_CN_IP different from STP_RAN_IP, to run a second OsmoSTP and
|
||||||
|
# OsmoBSCNAT to connect both
|
||||||
|
# STP_RAN_IP="127.0.0.2"
|
||||||
|
|
||||||
|
# Enabled only when STP_CN_IP != STP_RAN_IP
|
||||||
|
BSCNAT_CN_PC="${BSC_PC}"
|
||||||
|
BSCNAT_CN_IP="127.0.0.3"
|
||||||
|
BSCNAT_RAN_PC="${MSC_PC}"
|
||||||
|
BSCNAT_RAN_IP="127.0.0.4"
|
||||||
|
|
||||||
# PBX_SERVER:
|
# PBX_SERVER:
|
||||||
# "kamailio" -- launch kamailio
|
# "kamailio" -- launch kamailio
|
||||||
# "freeswitch" -- launch freeswitch
|
# "freeswitch" -- launch freeswitch
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
${include(common_template_warning)}
|
||||||
|
cs7 instance 0
|
||||||
|
point-code ${BSCNAT_CN_PC}
|
||||||
|
asp asp-clnt-OsmoBSCNAT-CN 2905 0 m3ua
|
||||||
|
remote-ip ${STP_CN_IP}
|
||||||
|
local-ip ${BSCNAT_CN_IP}
|
||||||
|
|
||||||
|
cs7 instance 1
|
||||||
|
point-code ${BSCNAT_RAN_PC}
|
||||||
|
asp asp-clnt-OsmoBSCNAT-RAN 2905 0 m3ua
|
||||||
|
remote-ip ${STP_RAN_IP}
|
||||||
|
local-ip ${BSCNAT_RAN_IP}
|
||||||
|
|
||||||
|
bsc-nat
|
||||||
|
cs7-instance-cn 0
|
||||||
|
cs7-instance-ran 1
|
||||||
|
|
||||||
|
${foreach(LOG_OUTPUT)}
|
||||||
|
log ${LOG_OUTPUTn_TYPE}
|
||||||
|
${include(common_logging)}
|
||||||
|
${foreach_end}
|
|
@ -19,7 +19,8 @@ e1_input
|
||||||
ipa bind ${BSC_IP}
|
ipa bind ${BSC_IP}
|
||||||
cs7 instance 0
|
cs7 instance 0
|
||||||
point-code ${BSC_PC}
|
point-code ${BSC_PC}
|
||||||
asp asp-clnt-msc-0 2905 0 m3ua
|
asp asp-clnt-bsc-0 2905 0 m3ua
|
||||||
|
remote-ip ${STP_RAN_IP}
|
||||||
network
|
network
|
||||||
network country code ${MCC}
|
network country code ${MCC}
|
||||||
mobile network code ${MNC}
|
mobile network code ${MNC}
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
${include(common_template_warning)}
|
${include(common_template_warning)}
|
||||||
|
cs7 instance 0
|
||||||
|
point-code ${MSC_PC}
|
||||||
|
asp asp-clnt-msc-0 2905 0 m3ua
|
||||||
|
remote-ip ${STP_CN_IP}
|
||||||
network
|
network
|
||||||
network country code ${MCC}
|
network country code ${MCC}
|
||||||
mobile network code ${MNC}
|
mobile network code ${MNC}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
${include(common_template_warning)}
|
||||||
|
|
||||||
|
# By default, osmo-dev starts one osmo-stp with this config. If STP_CN_IP and
|
||||||
|
# STP_RAN_IP are changed to be different, osmo-dev starts two osmo-stp, one
|
||||||
|
# with this config and another one with osmo-stp-ran.cfg.
|
||||||
|
|
||||||
|
line vty
|
||||||
|
bind ${STP_CN_IP}
|
||||||
|
|
||||||
|
cs7 instance 0
|
||||||
|
xua rkm routing-key-allocation dynamic-permitted
|
||||||
|
listen m3ua 2905
|
||||||
|
accept-asp-connections dynamic-permitted
|
||||||
|
local-ip ${STP_CN_IP}
|
||||||
|
|
||||||
|
${foreach(LOG_OUTPUT)}
|
||||||
|
log ${LOG_OUTPUTn_TYPE}
|
||||||
|
${include(common_logging)}
|
||||||
|
logging level linp notice
|
||||||
|
logging level lss7 notice
|
||||||
|
logging level lsccp notice
|
||||||
|
logging level lsua notice
|
||||||
|
logging level lm3ua notice
|
||||||
|
${foreach_end}
|
|
@ -1,8 +1,16 @@
|
||||||
${include(common_template_warning)}
|
${include(common_template_warning)}
|
||||||
|
|
||||||
|
# This file does not get used by default, only if STP_CN_IP and STP_RAN_IP are
|
||||||
|
# changed to be different!
|
||||||
|
|
||||||
|
line vty
|
||||||
|
bind ${STP_RAN_IP}
|
||||||
|
|
||||||
cs7 instance 0
|
cs7 instance 0
|
||||||
xua rkm routing-key-allocation dynamic-permitted
|
xua rkm routing-key-allocation dynamic-permitted
|
||||||
listen m3ua 2905
|
listen m3ua 2905
|
||||||
accept-asp-connections dynamic-permitted
|
accept-asp-connections dynamic-permitted
|
||||||
|
local-ip ${STP_RAN_IP}
|
||||||
|
|
||||||
${foreach(LOG_OUTPUT)}
|
${foreach(LOG_OUTPUT)}
|
||||||
log ${LOG_OUTPUTn_TYPE}
|
log ${LOG_OUTPUTn_TYPE}
|
|
@ -81,8 +81,10 @@ mgw4msc="osmo-mgw -c osmo-mgw-for-msc.cfg"
|
||||||
#mgw4bsc="strace osmo-mgw -c osmo-mgw-for-bsc.cfg"
|
#mgw4bsc="strace osmo-mgw -c osmo-mgw-for-bsc.cfg"
|
||||||
mgw4bsc="osmo-mgw -c osmo-mgw-for-bsc.cfg"
|
mgw4bsc="osmo-mgw -c osmo-mgw-for-bsc.cfg"
|
||||||
hlr="LD_LIBRARY_PATH=/usr/local/lib gdb -ex run --args osmo-hlr --db-upgrade"
|
hlr="LD_LIBRARY_PATH=/usr/local/lib gdb -ex run --args osmo-hlr --db-upgrade"
|
||||||
stp="osmo-stp"
|
stp4cn="osmo-stp -c osmo-stp-cn.cfg"
|
||||||
|
stp4ran="osmo-stp -c osmo-stp-ran.cfg"
|
||||||
bsc="LD_LIBRARY_PATH=/usr/local/lib gdb -ex run --args osmo-bsc -c osmo-bsc.cfg"
|
bsc="LD_LIBRARY_PATH=/usr/local/lib gdb -ex run --args osmo-bsc -c osmo-bsc.cfg"
|
||||||
|
bscnat="osmo-bsc-nat"
|
||||||
|
|
||||||
if [ "x${MSC_MNCC}" != "xinternal" ]; then
|
if [ "x${MSC_MNCC}" != "xinternal" ]; then
|
||||||
sipcon="osmo-sip-connector -c osmo-sip-connector.cfg"
|
sipcon="osmo-sip-connector -c osmo-sip-connector.cfg"
|
||||||
|
@ -123,9 +125,23 @@ PIDS=""
|
||||||
term "$ggsn" GGSN &
|
term "$ggsn" GGSN &
|
||||||
PIDS="$PIDS $!"
|
PIDS="$PIDS $!"
|
||||||
|
|
||||||
sleep .2
|
if [ "${STP_CN_IP}" = "${STP_RAN_IP}" ]; then
|
||||||
term "$stp" STP &
|
sleep .2
|
||||||
PIDS="$PIDS $!"
|
term "$stp4cn" STP &
|
||||||
|
PIDS="$PIDS $!"
|
||||||
|
else
|
||||||
|
sleep .2
|
||||||
|
term "$stp4cn" STP4CN &
|
||||||
|
PIDS="$PIDS $!"
|
||||||
|
|
||||||
|
sleep .2
|
||||||
|
term "$stp4ran" STP4RAN &
|
||||||
|
PIDS="$PIDS $!"
|
||||||
|
|
||||||
|
sleep .2
|
||||||
|
term "$bscnat" BSCNAT &
|
||||||
|
PIDS="$PIDS $!"
|
||||||
|
fi
|
||||||
|
|
||||||
sleep .2
|
sleep .2
|
||||||
term "$hlr" HLR &
|
term "$hlr" HLR &
|
||||||
|
@ -199,6 +215,7 @@ killall osmo-hlr
|
||||||
killall -9 osmo-stp
|
killall -9 osmo-stp
|
||||||
sudo killall tcpdump
|
sudo killall tcpdump
|
||||||
killall osmo-ggsn
|
killall osmo-ggsn
|
||||||
|
killall osmo-bsc-nat
|
||||||
|
|
||||||
if [ "x${MSC_MNCC}" != "xinternal" ]; then
|
if [ "x${MSC_MNCC}" != "xinternal" ]; then
|
||||||
# 'killall' seems to work only with the shortened name
|
# 'killall' seems to work only with the shortened name
|
||||||
|
|
Loading…
Reference in New Issue