Commit 430e1190 authored by Lionel Gauthier's avatar Lionel Gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5370 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c29f7557
......@@ -73,7 +73,7 @@ MME :
MME_INTERFACE_NAME_FOR_S1_MME = "tun11";
MME_IPV4_ADDRESS_FOR_S1_MME = "192.168.10.17/24";
MME_INTERFACE_NAME_FOR_S11_MME = "none";
MME_INTERFACE_NAME_FOR_S11_MME = "tun111";
MME_IPV4_ADDRESS_FOR_S11_MME = "192.168.11.117/24";
};
};
......@@ -82,7 +82,7 @@ S-GW :
{
NETWORK_INTERFACES :
{
SGW_INTERFACE_NAME_FOR_S11 = "none";
SGW_INTERFACE_NAME_FOR_S11 = "tun110";
SGW_IPV4_ADDRESS_FOR_S11 = "192.168.11.17/24";
SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP = "tun21";
......@@ -100,8 +100,8 @@ P-GW =
PGW_INTERFACE_NAME_FOR_S5_S8 = "none";
PGW_IPV4_ADDRESS_FOR_S5_S8 = "192.168.5.1/24";
PGW_INTERFACE_NAME_FOR_SGI = "none";
PGW_IPV4_ADDR_FOR_SGI = "192.168.14.17/24";
PGW_INTERFACE_NAME_FOR_SGI = "eth1";
PGW_IPV4_ADDRESS_FOR_SGI = "192.168.13.17/24";
};
IP_ADDRESS_POOL :
......@@ -119,7 +119,7 @@ P-GW =
APN :
{
}
};
};
HSS =
......
......@@ -101,7 +101,7 @@ fi
#######################################################
# CHECK MISC SOFTWARES AND LIBS
#######################################################
check_install_epc_software
#check_install_epc_software
######################################
# compile EPC #
......@@ -149,24 +149,36 @@ cd $THIS_SCRIPT_PATH
#######################################################
SEARCHED_CONFIG_FILE_ENB="enb*.conf"
CONFIG_FILE_ENB=`find $CONFIG_FILE_DIR -iname $SEARCHED_CONFIG_FILE_ENB`
if [ -f $CONFIG_FILE_ENB ]; then
if [ a$CONFIG_FILE_ENB != a ]; then
if [ -f $CONFIG_FILE_ENB ]; then
echo_warning "eNB config file found is now $CONFIG_FILE_ENB"
else
echo_error "eNB config file not found, exiting (searched for $SEARCHED_CONFIG_FILE_ENB in $CONFIG_FILE_DIR)"
exit 1
fi
else
echo_error "eNB config file not found, exiting"
echo_error "eNB config file not found, exiting (searched for $SEARCHED_CONFIG_FILE_ENB in $CONFIG_FILE_DIR)"
exit 1
fi
SEARCHED_CONFIG_FILE_EPC="epc*.conf"
SEARCHED_CONFIG_FILE_EPC="epc.*.*.conf"
CONFIG_FILE_EPC=`find $CONFIG_FILE_DIR -iname $SEARCHED_CONFIG_FILE_EPC`
if [ -f $CONFIG_FILE_EPC ]; then
if [ a$CONFIG_FILE_EPC != a ]; then
if [ -f $CONFIG_FILE_EPC ]; then
echo_warning "EPC config file found is now $CONFIG_FILE_EPC"
else
echo_error "EPC config file not found, exiting (searched for $SEARCHED_CONFIG_FILE_EPC in $CONFIG_FILE_DIR)"
exit 1
fi
else
echo_error "EPC config file not found, exiting (searched for $SEARCHED_CONFIG_FILE_EPC)"
echo_error "EPC config file not found, exiting (searched for $SEARCHED_CONFIG_FILE_EPC in $CONFIG_FILE_DIR)"
exit 1
fi
#######################################################
# SOURCE CONFIG FILES for MME AND eNB
#######################################################
echo_success "PARSING CONFIG FILES..."
rm -f /tmp/source.txt
VARIABLES="
ENB_INTERFACE_NAME_FOR_S1_MME\|\
......@@ -188,9 +200,9 @@ VARIABLES="
PGW_INTERFACE_NAME_FOR_S5_S8\|\
PGW_IPV4_ADDRESS_FOR_S5_S8\|\
PGW_INTERFACE_NAME_FOR_SGI\|\
PGW_IPV4_ADDR_FOR_SGI\|\
PGW_IPV4_ADDRESS_FOR_SGI\|\
HSS_INTERFACE_NAME_FOR_S6A\|\
HSS_IPV4_ADDR_FOR_S6A"
HSS_IPV4_ADDRESS_FOR_S6A"
VARIABLES=$(echo $VARIABLES | sed -e 's/\\r//g')
VARIABLES=$(echo $VARIABLES | tr -d ' ')
......@@ -207,8 +219,8 @@ declare SGW_IPV4_NETMASK_FOR_S11=$( echo $SGW_IPV4_ADDRESS_FOR_S11
declare SGW_IPV4_NETMASK_FOR_S1U_S12_S4_UP=$(echo $SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP | cut -f2 -d '/')
declare SGW_IPV4_NETMASK_FOR_S5_S8_UP=$( echo $SGW_IPV4_ADDRESS_FOR_S5_S8_UP | cut -f2 -d '/')
declare PGW_IPV4_NETMASK_FOR_S5_S8=$( echo $PGW_IPV4_ADDRESS_FOR_S5_S8 | cut -f2 -d '/')
declare PGW_IPV4_NETMASK_FOR_SGI=$( echo $PGW_IPV4_ADDR_FOR_SGI | cut -f2 -d '/')
declare HSS_IPV4_NETMASK_FOR_S6A=$( echo $HSS_IPV4_ADDR_FOR_S6A | cut -f2 -d '/')
declare PGW_IPV4_NETMASK_FOR_SGI=$( echo $PGW_IPV4_ADDRESS_FOR_SGI | cut -f2 -d '/')
declare HSS_IPV4_NETMASK_FOR_S6A=$( echo $HSS_IPV4_ADDRESS_FOR_S6A | cut -f2 -d '/')
ENB_IPV4_ADDRESS_FOR_S1_MME=$( echo $ENB_IPV4_ADDRESS_FOR_S1_MME | cut -f1 -d '/')
ENB_IPV4_ADDRESS_FOR_S1U=$( echo $ENB_IPV4_ADDRESS_FOR_S1U | cut -f1 -d '/')
......@@ -219,15 +231,15 @@ SGW_IPV4_ADDRESS_FOR_S11=$( echo $SGW_IPV4_ADDRESS_FOR_S11
SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP=$( echo $SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP | cut -f1 -d '/')
SGW_IPV4_ADDRESS_FOR_S5_S8_UP=$( echo $SGW_IPV4_ADDRESS_FOR_S5_S8_UP | cut -f1 -d '/')
PGW_IPV4_ADDRESS_FOR_S5_S8=$( echo $PGW_IPV4_ADDRESS_FOR_S5_S8 | cut -f1 -d '/')
PGW_IPV4_ADDR_FOR_SGI=$( echo $PGW_IPV4_ADDR_FOR_SGI | cut -f1 -d '/')
HSS_IPV4_ADDR_FOR_S6A=$( echo $HSS_IPV4_ADDR_FOR_S6A | cut -f1 -d '/')
PGW_IPV4_ADDRESS_FOR_SGI=$( echo $PGW_IPV4_ADDRESS_FOR_SGI | cut -f1 -d '/')
HSS_IPV4_ADDRESS_FOR_S6A=$( echo $HSS_IPV4_ADDRESS_FOR_S6A | cut -f1 -d '/')
#######################################################
# BUILD NETWORK
#######################################################
clean_tun_network
build_tun_network
build_epc_tun_network
test_tun_network
##################################################
......@@ -253,7 +265,8 @@ cd $OPENAIRCN_DIR/$OBJ_DIR
nohup tshark -i MME_INTERFACE_NAME_FOR_S1_MME -w $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$MME_PCAP_LOG_FILE &
nohup xterm -e $OPENAIRCN_DIR/$OBJ_DIR/OAI_EPC/oai_epc -K $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$MME_ITTI_LOG_FILE -c $THIS_SCRIPT_PATH/$CONFIG_FILE_EPC 2>&1 | tee $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$MME_STDOUT_LOG_FILE &
$OPENAIRCN_DIR/$OBJ_DIR/OAI_EPC/oai_epc -K $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$MME_ITTI_LOG_FILE -c $THIS_SCRIPT_PATH/$CONFIG_FILE_EPC 2>&1 | tee $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$MME_STDOUT_LOG_FILE &
#nohup xterm -e $OPENAIRCN_DIR/$OBJ_DIR/OAI_EPC/oai_epc -K $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$MME_ITTI_LOG_FILE -c $THIS_SCRIPT_PATH/$CONFIG_FILE_EPC 2>&1 | tee $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$MME_STDOUT_LOG_FILE &
##################################################
......
......@@ -541,21 +541,6 @@ build_mme_spgw_vlan_network() {
# +------+ +-------+ +----+ +----+
# | | 11 VLANS | |
# +-----------+ ids=[5..15] +--------------+
cat $OPENAIRCN_DIR/$OBJ_DIR/Makefile | grep CFLAGS\ \=\ | grep DENABLE_USE_NETFILTER_FOR_SGI
if [ $? -ne 0 ]
then
export ENABLE_USE_NETFILTER_FOR_SGI=0
else
export ENABLE_USE_NETFILTER_FOR_SGI=1
fi
cat $OPENAIRCN_DIR/$OBJ_DIR/Makefile | grep CFLAGS\ \=\ | grep DENABLE_USE_RAW_FOR_SGI
if [ $? -ne 0 ]
then
export ENABLE_USE_RAW_FOR_SGI=0
else
export ENABLE_USE_RAW_FOR_SGI=1
fi
bash_exec "modprobe 8021q"
......@@ -728,7 +713,7 @@ build_tun_network() {
set_interface_up $MME_INTERFACE_NAME_FOR_S1_MME $MME_IPV4_ADDRESS_FOR_S1_MME $MME_IPV4_NETMASK_FOR_S1_MME
set_interface_up $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP $SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP $SGW_IPV4_NETMASK_FOR_S1U_S12_S4_UP
set_interface_up $MME_INTERFACE_NAME_FOR_S1_MME $MME_IPV4_ADDRESS_FOR_S1_MME $MME_IPV4_NETMASK_FOR_S1_MME
set_interface_up $ENB_INTERFACE_NAME_FOR_S1_MME $ENB_IPV4_ADDRESS_FOR_S1_MME $ENB_IPV4_NETMASK_FOR_S1_MME
set_interface_up $ENB_INTERFACE_NAME_FOR_S1U $ENB_IPV4_ADDRESS_FOR_S1U $ENB_IPV4_NETMASK_FOR_S1U
set_interface_up $MME_INTERFACE_NAME_FOR_S11_MME $MME_IPV4_ADDRESS_FOR_S11_MME $MME_IPV4_NETMASK_FOR_S11_MME
......@@ -807,11 +792,12 @@ test_tun_network() {
# Get MAC address of router.eur
ping -c 1 hss.eur > /dev/null || { echo_fatal "hss.eur does not respond to ping" >&2 ; }
ping -c 1 router.eur > /dev/null || { echo_fatal "router.eur does not respond to ping" >&2 ; }
#TEMP ping -c 1 router.eur > /dev/null || { echo_fatal "router.eur does not respond to ping" >&2 ; }
return 0
}
clean_tun_network() {
bash_exec "modprobe tun"
##################################################
# del interfaces eNB and MME/SPGW and HSS
##################################################
......@@ -827,28 +813,12 @@ clean_tun_network() {
build_epc_tun_network() {
cat $OPENAIRCN_DIR/$OBJ_DIR/Makefile | grep CFLAGS\ \=\ | grep DENABLE_USE_NETFILTER_FOR_SGI
if [ $? -ne 0 ]
then
export ENABLE_USE_NETFILTER_FOR_SGI=0
else
export ENABLE_USE_NETFILTER_FOR_SGI=1
fi
cat $OPENAIRCN_DIR/$OBJ_DIR/Makefile | grep CFLAGS\ \=\ | grep DENABLE_USE_RAW_FOR_SGI
if [ $? -ne 0 ]
then
export ENABLE_USE_RAW_FOR_SGI=0
else
export ENABLE_USE_RAW_FOR_SGI=1
fi
build_tun_network
ping -c 1 router.eur > /dev/null || { echo_fatal "router.eur does not respond to ping" >&2 ; }
IP_ROUTER=`python -c 'import socket; print socket.gethostbyname("router.eur")'`
export MAC_ROUTER=`ip neigh show | grep $IP_ROUTER | cut -d ' ' -f5 | tr -d ':'`
echo_success "ROUTER MAC ADDRESS= $MAC_ROUTER"
#TEMP ping -c 1 router.eur > /dev/null || { echo_fatal "router.eur does not respond to ping" >&2 ; }
#TEMP IP_ROUTER=`python -c 'import socket; print socket.gethostbyname("router.eur")'`
#TEMP export MAC_ROUTER=`ip neigh show | grep $IP_ROUTER | cut -d ' ' -f5 | tr -d ':'`
#TEMP echo_success "ROUTER MAC ADDRESS= $MAC_ROUTER"
bash_exec "modprobe 8021q"
......
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