Add first osmo-cn-latest image

Core network in a container. Starts all the services, configuration
needs to be tweaked.

Change-Id: Icfddc75447fbd94f9d5c19408ccc7f3a914e083f
This commit is contained in:
Daniel Willmann 2018-08-30 12:04:18 +02:00
parent 8dea5c8a5a
commit 5ff268371f
17 changed files with 343 additions and 0 deletions

2
osmo-cn-latest/.release Normal file
View File

@ -0,0 +1,2 @@
release=0.0.0
tag=osmo-cn-latest-0.0.0

45
osmo-cn-latest/Dockerfile Normal file
View File

@ -0,0 +1,45 @@
FROM debian:stretch
MAINTAINER Daniel Willmann <dwillmann@sysmocom.de>
ARG OSMOCOM_REPO="http://download.opensuse.org/repositories/network:/osmocom:/latest/Debian_9.0/"
COPY Release.key /tmp/Release.key
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gnupg
RUN apt-key add /tmp/Release.key && \
rm /tmp/Release.key && \
echo "deb " $OSMOCOM_REPO " ./" > /etc/apt/sources.list.d/osmocom-latest.list
ADD $OSMOCOM_REPO/Release /tmp/Release
RUN apt-get update && \
apt-get install -y --no-install-recommends \
osmo-msc osmo-hlr osmo-sgsn osmo-ggsn osmo-mgw osmo-stp \
runit telnet iptables && \
apt-get clean
WORKDIR /tmp
VOLUME /data
COPY osmo-stp.cfg /data/osmo-stp.cfg
COPY osmo-msc.cfg /data/osmo-msc.cfg
COPY osmo-hlr.cfg /data/osmo-hlr.cfg
COPY osmo-mgw.cfg /data/osmo-mgw.cfg
COPY osmo-sgsn.cfg /data/osmo-sgsn.cfg
COPY osmo-ggsn.cfg /data/osmo-ggsn.cfg
COPY runit/stp-run /etc/service/osmo-stp/run
COPY runit/msc-run /etc/service/osmo-msc/run
COPY runit/hlr-run /etc/service/osmo-hlr/run
COPY runit/mgw-run /etc/service/osmo-mgw/run
COPY runit/sgsn-run /etc/service/osmo-sgsn/run
COPY runit/ggsn-run /etc/service/osmo-ggsn/run
WORKDIR /data
CMD ["/sbin/runit"]
EXPOSE 23000/udp

1
osmo-cn-latest/Makefile Normal file
View File

@ -0,0 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-----END PGP PUBLIC KEY BLOCK-----

View File

@ -0,0 +1,51 @@
!
! OpenGGSN (0.94.1-adac) configuration saved from vty
!!
!
log file /data/osmo-ggsn.log
logging filter all 1
logging color 0
logging print category 1
logging timestamp 1
logging level ip info
logging level tun info
logging level ggsn info
logging level sgsn notice
logging level icmp6 debug
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp info
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
logging level lmgcp notice
!
stats interval 5
!
line vty
no login
bind 0.0.0.0
!
ggsn ggsn0
gtp state-dir /tmp
gtp bind-ip 127.0.0.2
apn internet
gtpu-mode tun
tun-device tun4
type-support v4
ip prefix dynamic 10.0.0.1/24
ip dns 0 9.9.9.9
ip ifconfig 10.0.0.0/24
no shutdown
default-apn internet
no shutdown ggsn

View File

@ -0,0 +1,19 @@
!
! OsmoHLR example configuration
!
log file /data/osmo-hlr.log
logging filter all 1
logging color 0
logging print category 1
logging timestamp 1
logging print extended-timestamp 1
logging level all debug
logging level linp error
!
line vty
bind 0.0.0.0
ctrl
bind 0.0.0.0
hlr
gsup
bind ip 127.0.0.1

View File

@ -0,0 +1,53 @@
!
! OsmoMGW (1.2.0.17-52e3) configuration saved from vty
!!
!
log file /data/osmo-mgw.log
logging filter all 1
logging color 1
logging print category 1
logging timestamp 0
logging level all everything
logging level rtp notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 notice
logging level lsccp notice
logging level lsua notice
logging level lm3ua notice
logging level lmgcp debug
!
stats interval 5
!
line vty
no login
bind 0.0.0.0
!
mgcp
bind ip 127.0.0.1
bind port 2427
rtp port-range 4002 16000
rtp bind-ip 192.168.42.10
rtp ip-probing
rtp ip-dscp 184
no rtp keep-alive
no rtcp-omit
no rtp-patch
sdp audio-payload number 98
sdp audio-payload name GSM
sdp audio-payload send-ptime
sdp audio-payload send-name
loop 0
number endpoints 31
allow-transcoding
osmux off

View File

@ -0,0 +1,30 @@
!
! OsmoMSC configuration saved from vty
!
log file /data/osmo-msc.log
logging filter all 1
logging color 1
logging print category 1
logging timestamp 0
logging level all everything
!
line vty
no login
bind 0.0.0.0
!
cs7 instance 0
asp asp-clnt-OsmoMSC-A-Iu 2905 2904 m3ua
remote-ip 192.168.42.10
network
network country code 901
mobile network code 1
short name OsmoMSC
long name OsmoMSC
encryption a5 0
rrlp mode none
mm info 1
msc
mgw remote-ip 127.0.0.1
assign-tmsi
auth-tuple-max-reuse-count 3
auth-tuple-reuse-on-error 1

View File

@ -0,0 +1,34 @@
!
! Osmocom SGSN (0.9.0.474-0ede2) configuration saved from vty
!!
!
log file /data/osmo-sgsn.log
logging filter all 1
logging color 1
logging print category 1
logging timestamp 0
logging level all everything
!
line vty
no login
bind 0.0.0.0
!
sgsn
gtp local-ip 127.0.0.1
ggsn 0 remote-ip 127.0.0.2
ggsn 0 gtp-version 1
auth-policy remote
gsup remote-ip 127.0.0.1
gsup remote-port 4222
ns
timer tns-block 3
timer tns-block-retries 3
timer tns-reset 3
timer tns-reset-retries 3
timer tns-test 30
timer tns-alive 3
timer tns-alive-retries 10
encapsulation udp local-ip 0.0.0.0
encapsulation udp local-port 23000
encapsulation framerelay-gre enabled 0
bssgp

View File

@ -0,0 +1,36 @@
!
! osmo-stp (0.0.6.3.179-b248) configuration saved from vty
!!
!
log file /data/osmo-stp.log
logging filter all 1
logging color 0
logging print category 1
logging timestamp 1
logging level all everything
logging level lglobal notice
logging level llapd notice
logging level linp debug
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
logging level lss7 debug
logging level lsccp debug
logging level lsua debug
logging level lm3ua debug
!
line vty
no login
bind 0.0.0.0
!
cs7 instance 0
xua rkm routing-key-allocation dynamic-permitted
listen m3ua 2905
accept-asp-connections dynamic-permitted
local-ip 192.168.42.10

33
osmo-cn-latest/run.sh Executable file
View File

@ -0,0 +1,33 @@
#! /bin/sh
. ../jenkins-common.sh
docker_images_require \
"osmo-cn-latest"
docker network create --subnet 192.168.42.0/24 $NET_NAME
mkdir $VOL_BASE_DIR/osmo-cn
cp osmo-stp.cfg $VOL_BASE_DIR/osmo-cn/
cp osmo-msc.cfg $VOL_BASE_DIR/osmo-cn/
cp osmo-hlr.cfg $VOL_BASE_DIR/osmo-cn/
cp osmo-mgw.cfg $VOL_BASE_DIR/osmo-cn/
cp osmo-sgsn.cfg $VOL_BASE_DIR/osmo-cn/
cp osmo-ggsn.cfg $VOL_BASE_DIR/osmo-cn/
cp hlr.db $VOL_BASE_DIR/osmo-cn/
echo Starting Osmocom core services
docker run --rm \
--cap-add=NET_ADMIN \
--device /dev/net/tun:/dev/net/tun \
--network $NET_NAME --ip 192.168.42.10 \
-p 0.0.0.0:23000:23000/udp \
-v $VOL_BASE_DIR/osmo-cn:/data \
--name osmo-cn \
$REPO_USER/osmo-cn-latest
echo Stopping containers
docker container kill osmo-cn
network_remove

4
osmo-cn-latest/runit/ggsn-run Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
exec /usr/bin/osmo-ggsn -c /data/osmo-ggsn.cfg

3
osmo-cn-latest/runit/hlr-run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/bin/osmo-hlr -c /data/osmo-hlr.cfg -l /data/hlr.db

3
osmo-cn-latest/runit/mgw-run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/bin/osmo-mgw -c /data/osmo-mgw.cfg

3
osmo-cn-latest/runit/msc-run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/bin/osmo-msc -c /data/osmo-msc.cfg

3
osmo-cn-latest/runit/sgsn-run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/bin/osmo-sgsn -c /data/osmo-sgsn.cfg

3
osmo-cn-latest/runit/stp-run Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/bin/osmo-stp -c /data/osmo-stp.cfg