Commit 973573a8 authored by root's avatar root

update start.sh and subnet

parent e0999117
This diff is collapsed.
......@@ -13,7 +13,7 @@ services:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.0.0.4
ipv4_address: 10.0.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
......@@ -52,7 +52,7 @@ services:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.1.0.4
ipv4_address: 10.1.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
......@@ -90,7 +90,7 @@ services:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.2.0.4
ipv4_address: 10.2.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
......@@ -128,7 +128,7 @@ services:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.3.0.4
ipv4_address: 10.3.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
......
......@@ -13,7 +13,7 @@ services:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.0.0.4
ipv4_address: 10.0.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
......
......@@ -12,7 +12,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.5
ipv4_address: 10.0.0.11
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -23,8 +23,8 @@ services:
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.5
- AMF_IP=10.0.0.4
- GNB_IP=10.0.0.11
- AMF_IP=10.0.0.10
- NIC=0x000000010
- COREIP=127.0.0.1
- COREPORT=7777
......@@ -57,7 +57,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.6
ipv4_address: 10.0.0.12
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -68,7 +68,7 @@ services:
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.5
- GNB_IP=10.0.0.11
- IMSI=466920000000001
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
......@@ -87,7 +87,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.1.0.5
ipv4_address: 10.1.0.11
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -98,8 +98,8 @@ services:
- MCC=466
- MNC=91
- TAC=100
- GNB_IP=10.1.0.5
- AMF_IP=10.1.0.4
- GNB_IP=10.1.0.11
- AMF_IP=10.1.0.10
- NIC=0x000000020
- COREIP=127.0.0.1
- COREPORT=7777
......@@ -132,7 +132,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.1.0.6
ipv4_address: 10.1.0.12
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -143,7 +143,7 @@ services:
- MCC=466
- MNC=91
- TAC=100
- GNB_IP=10.1.0.5
- GNB_IP=10.1.0.11
- IMSI=466910000000001
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
......@@ -162,7 +162,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.2.0.5
ipv4_address: 10.2.0.11
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -173,8 +173,8 @@ services:
- MCC=466
- MNC=93
- TAC=100
- GNB_IP=10.2.0.5
- AMF_IP=10.2.0.4
- GNB_IP=10.2.0.11
- AMF_IP=10.2.0.10
- NIC=0x000000030
- COREIP=127.0.0.1
- COREPORT=7777
......@@ -207,7 +207,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.2.0.6
ipv4_address: 10.2.0.12
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -218,7 +218,7 @@ services:
- MCC=466
- MNC=93
- TAC=100
- GNB_IP=10.2.0.5
- GNB_IP=10.2.0.11
- IMSI=466930000000001
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
......@@ -237,7 +237,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.3.0.5
ipv4_address: 10.3.0.11
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -248,8 +248,8 @@ services:
- MCC=466
- MNC=94
- TAC=100
- GNB_IP=10.3.0.5
- AMF_IP=10.3.0.4
- GNB_IP=10.3.0.11
- AMF_IP=10.3.0.10
- NIC=0x000000040
- COREIP=127.0.0.1
- COREPORT=7777
......@@ -282,7 +282,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.3.0.6
ipv4_address: 10.3.0.12
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -293,7 +293,7 @@ services:
- MCC=466
- MNC=94
- TAC=100
- GNB_IP=10.3.0.5
- GNB_IP=10.3.0.11
- IMSI=466940000000001
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
......
......@@ -12,7 +12,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.5
ipv4_address: 10.0.0.11
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -23,8 +23,8 @@ services:
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.5
- AMF_IP=10.0.0.4
- GNB_IP=10.0.0.11
- AMF_IP=10.0.0.10
- NIC=0x000000010
- COREIP=127.0.0.1
- COREPORT=7777
......@@ -57,7 +57,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.6
ipv4_address: 10.0.0.12
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -68,7 +68,7 @@ services:
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.5
- GNB_IP=10.0.0.11
- IMSI=466920000000001
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
......
......@@ -12,7 +12,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.5
ipv4_address: 10.0.0.11
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -23,8 +23,8 @@ services:
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.5
- AMF_IP=10.0.0.4
- GNB_IP=10.0.0.11
- AMF_IP=10.0.0.10
- NIC=0x000000010
- COREIP=127.0.0.1
- COREPORT=7777
......@@ -57,7 +57,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.6
ipv4_address: 10.0.0.12
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -68,7 +68,7 @@ services:
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.5
- GNB_IP=10.0.0.11
- IMSI=466920000000001
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
......@@ -89,7 +89,7 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.7
ipv4_address: 10.0.0.13
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
......@@ -100,7 +100,7 @@ services:
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.5
- GNB_IP=10.0.0.11
- IMSI=466920000000002
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
......
......@@ -13,7 +13,7 @@ help() {
}
close() {
docker rm -f $(docker ps -aq)
docker rm -f $(docker ps -aq | grep -v $(docker ps -aqf "name=mysql") | grep -v $(docker ps -aqf "name=phpmyadmin"))
}
# 处理命令行参数的函数
process_args() {
......@@ -21,6 +21,7 @@ process_args() {
case $1 in
--5gc)
if [[ -n $2 && $2 != --* ]]; then
fivegc_flag=true
fivegc_value=$2
shift 2
else
......@@ -66,7 +67,7 @@ process_args() {
start_5gc() {
docker run -itd --log-opt max-size=10m --privileged=true \
--name $1 \
--network docker-openxg --ip 10.$2.0.4 \
--network docker-openxg --ip 10.$2.0.10 \
-v "$SRC/template/amf.template:/opt/5gcs/etc/amf.template" \
-v "$SRC/template/smf.template:/opt/5gcs/etc/smf.template" \
-v "$SRC/template/upf.template:/opt/5gcs/etc/upf.template" \
......@@ -158,6 +159,7 @@ SRC=$(dirname $THIS_SCRIPT_PATH)
fivegc_value="1"
gnb_value=""
ue_value=""
fivegc_flag=false
# 处理命令行参数
process_args "$@"
......@@ -180,14 +182,16 @@ mnc=91
nic=0x000000000
for ((i=0; i<fivegc_value; i++)); do
echo "Start 5GC: openxg-5gc-$i"
start_5gc openxg-5gc-$i $i $mcc $mnc 0
if [ "$fivegc_flag" = true ]; then
echo "Start 5GC: openxg-5gc-$i"
start_5gc openxg-5gc-$i $i $mcc $mnc 0
sleep 3
fi
amf_ip="10.$i.0.4"
amf_ip="10.$i.0.10"
gnb_ue_ipv4=$amf_ip
imsi=$(($(($mcc$mnc)) * 10000000000))
sleep 3
for ((j=0; j<gnb_value; j++)); do
......@@ -214,6 +218,5 @@ for ((i=0; i<fivegc_value; i++)); do
exit 0
fi
sleep 3
done
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