aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2018-09-18 19:35:10 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2018-11-29 10:48:57 +0100
commit9b8a6f74c7ee4fe750f33e5c55eacef1acb798fd (patch)
tree313c873b5a59f7e4b9849447305e2e42408174ab
parentbf304cc068e16edcf9656375bb85cb5d4244a405 (diff)
osmo-cn-latest: Make sure sgsn/ggsn work and are reachable from outside
-rw-r--r--osmo-cn-latest/Dockerfile5
-rw-r--r--osmo-cn-latest/osmo-sgsn.cfg5
-rwxr-xr-xosmo-cn-latest/run.sh5
-rwxr-xr-xosmo-cn-latest/runit/ggsn-run1
4 files changed, 13 insertions, 3 deletions
diff --git a/osmo-cn-latest/Dockerfile b/osmo-cn-latest/Dockerfile
index ab9f3a2..3b49c29 100644
--- a/osmo-cn-latest/Dockerfile
+++ b/osmo-cn-latest/Dockerfile
@@ -18,7 +18,7 @@ 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 && \
+ runit telnet iptables && \
apt-get clean
WORKDIR /tmp
@@ -40,3 +40,6 @@ COPY runit/ggsn-run /etc/service/osmo-ggsn/run
WORKDIR /data
CMD ["/sbin/runit"]
+
+
+EXPOSE 23000/udp
diff --git a/osmo-cn-latest/osmo-sgsn.cfg b/osmo-cn-latest/osmo-sgsn.cfg
index 3b52d87..ef18604 100644
--- a/osmo-cn-latest/osmo-sgsn.cfg
+++ b/osmo-cn-latest/osmo-sgsn.cfg
@@ -17,6 +17,9 @@ 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
@@ -25,7 +28,7 @@ ns
timer tns-test 30
timer tns-alive 3
timer tns-alive-retries 10
- encapsulation udp local-ip 192.168.42.10
+ encapsulation udp local-ip 0.0.0.0
encapsulation udp local-port 23000
encapsulation framerelay-gre enabled 0
bssgp
diff --git a/osmo-cn-latest/run.sh b/osmo-cn-latest/run.sh
index bfd198a..f11c994 100755
--- a/osmo-cn-latest/run.sh
+++ b/osmo-cn-latest/run.sh
@@ -2,7 +2,7 @@
. ../jenkins-common.sh
-network_create 192.168.42.0/24
+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/
@@ -15,7 +15,10 @@ 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
diff --git a/osmo-cn-latest/runit/ggsn-run b/osmo-cn-latest/runit/ggsn-run
index b03ccd6..db050f9 100755
--- a/osmo-cn-latest/runit/ggsn-run
+++ b/osmo-cn-latest/runit/ggsn-run
@@ -1,3 +1,4 @@
#!/bin/sh
+iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
exec /usr/bin/osmo-ggsn -c /data/osmo-ggsn.cfg