Commit 49390b25 authored by Lionel Gauthier's avatar Lionel Gauthier

explicit vlan interface name (ethx.y) in config file

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5073 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 58b09eb3
......@@ -32,10 +32,10 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth1";
ENB_INTERFACE_NAME_FOR_S1_MME = "eth1.1";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.15.17/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth1";
ENB_INTERFACE_NAME_FOR_S1U = "eth1.2";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.16.17/24";
};
}
......
MME :
{
REALM = "eur";
# Define the limits of the system in terms of served eNB and served UE.
# When the limits will be reached, overload procedure will take place.
MAXENB = 10;
MAXUE = 100;
RELATIVE_CAPACITY = 10;
# Display statistics about whole system (expressed in seconds)
MME_STATISTIC_TIMER = 10;
EMERGENCY_ATTACH_SUPPORTED = "no";
UNAUTHENTICATED_IMSI_SUPPORTED = "no";
INTERTASK_INTERFACE :
{
# max queue size per task
ITTI_QUEUE_SIZE = 2000000;
};
S6A :
{
S6A_CONF = "../objs/UTILS/CONF/s6a.conf";
};
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 32;
SCTP_OUTSTREAMS = 32;
};
# ------- S1AP definitions
S1AP :
{
# outcome drop timer value (seconds)
S1AP_OUTCOME_TIMER = 10;
};
# ------- MME served GUMMEI
GUMMEI :
{
# MME code DEFAULT = 0
# size = 8 bits
# maximum of 256 values, comma separated
MME_CODE = [ 30 , 56 , 1 , 8 ];
# MME GROUP ID DEFAULT = 0
# size = 16 bits
# maximum of 65535 values, comma separated
MME_GID = [ 3 , 4 , 5 , 30 , 8 , 9 , 50021 ];
# TA (mcc.mnc:tracking area code) DEFAULT = 208.34:0
# max values = 999.999:65535
# maximum of 32 values, comma separated
PLMN = (
{MCC=208 ; MNC=10; TAC = 1; },
{MCC=209 ; MNC=130; TAC = 4; },
{MCC=208 ; MNC=35; TAC = 8; }
);
};
NETWORK_INTERFACES :
{
MME_INTERFACE_NAME_FOR_S1_MME = "eth1.1";
MME_IPV4_ADDRESS_FOR_S1_MME = "192.168.15.145/24";
MME_INTERFACE_NAME_FOR_S11_MME = "none";
MME_IPV4_ADDRESS_FOR_S11_MME = "192.168.33.117/24";
};
};
S-GW :
{
NETWORK_INTERFACES :
{
SGW_INTERFACE_NAME_FOR_S11 = "none";
SGW_IPV4_ADDRESS_FOR_S11 = "192.168.33.17/24";
SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP = "eth1.2";
SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP = "192.168.16.145/24";
SGW_INTERFACE_NAME_FOR_S5_S8_UP = "none";
SGW_IPV4_ADDRESS_FOR_S5_S8_UP = "192.168.5.2/24";
};
};
P-GW =
{
NETWORK_INTERFACES :
{
PGW_INTERFACE_NAME_FOR_S5_S8 = "none";
PGW_IPV4_ADDRESS_FOR_S5_S8 = "192.168.5.1/24";
PGW_INTERFACE_NAME_FOR_SGI = "eth4";
PGW_IPV4_ADDR_FOR_SGI = "192.168.14.145/24";
};
IP_ADDRESS_POOL :
{
IPV4_LIST = (
"192.168.87.32",
"192.168.88.0<--->192.168.88.255",
"192.168.90.0<--->192.168.90.255"
);
IPV6_LIST = (
"2014:01:26::32",
"2014:02:26::0/120"
);
};
};
......@@ -160,7 +160,7 @@ fi
ip rule add fwmark 5 table lte
ip route add default dev $LTEIF table lte
ITTI_LOG_FILE=/tmp/itti_enb.$HOSTNAME.log
ITTI_LOG_FILE=./itti_enb.$HOSTNAME.log
rotate_log_file $ITTI_LOG_FILE
......
......@@ -183,7 +183,7 @@ build_mme_spgw_vlan_network
cd $OPENAIRCN_DIR/$OBJ_DIR
ITTI_LOG_FILE=/tmp/itti_mme.log
ITTI_LOG_FILE=./itti_mme.log
rotate_log_file $ITTI_LOG_FILE
gdb --args $OPENAIRCN_DIR/$OBJ_DIR/OAI_EPC/oai_epc -K $ITTI_LOG_FILE -c $CONFIG_FILE
......@@ -336,6 +336,10 @@ is_openvswitch_interface() {
else
if [ "a${1:0:4}" == "awifi" ]; then
return 0;
else
if [ "a${1:0:4}" == "anone" ]; then
return 0;
fi
fi
fi
fi
......@@ -363,6 +367,32 @@ is_real_interface() {
return 0
}
is_vlan_interface() {
if [ "a$1" == "a" ]; then
return 0
fi
if [[ $1 == *.* ]]
then
interface_name=`echo $1 | cut -f1 -d '.'`
vlan=`echo $1 | cut -f2 -d '.'`
IF=`cat /etc/udev/rules.d/70-persistent-net.rules | grep $interface_name | sed 's/^.*NAME=//' | tr -d '"'`
if [ "$IF" == "$interface_name" ]; then
if [ "a${interface_name:0:3}" == "aeth" ]; then
return 1;
else
if [ "a${interface_name:0:4}" == "awlan" ]; then
return 1;
else
if [ "a${interface_name:0:4}" == "awifi" ]; then
return 1;
fi
fi
fi
fi
fi
return 0
}
delete_openvswitch_interface() {
is_openvswitch_interface $1
......@@ -381,47 +411,51 @@ create_openvswitch_interface() {
build_enb_vlan_network() {
# create vlan interface
is_real_interface $ENB_INTERFACE_NAME_FOR_S1_MME
is_vlan_interface $ENB_INTERFACE_NAME_FOR_S1_MME
if [ $? -eq 1 ]; then
ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME.1 down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1_MME.1 > /dev/null 2>&1
interface_name=`echo $ENB_INTERFACE_NAME_FOR_S1_MME | cut -f1 -d '.'`
vlan=`echo $ENB_INTERFACE_NAME_FOR_S1_MME | cut -f2 -d '.'`
ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1_MME > /dev/null 2>&1
sync
bash_exec "vconfig add $ENB_INTERFACE_NAME_FOR_S1_MME 1"
bash_exec "vconfig add $interface_name $vlan"
sync
bash_exec "ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME.1 up"
bash_exec "ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME up"
sync
bash_exec "ip -4 addr add $ENB_IPV4_ADDRESS_FOR_S1_MME/$ENB_IPV4_NETMASK_FOR_S1_MME dev $ENB_INTERFACE_NAME_FOR_S1_MME.1"
bash_exec "ip -4 addr add $ENB_IPV4_ADDRESS_FOR_S1_MME/$ENB_IPV4_NETMASK_FOR_S1_MME dev $ENB_INTERFACE_NAME_FOR_S1_MME"
else
echo_fatal "BAD INTERFACE NAME FOR ENB S1-MME $ENB_INTERFACE_NAME_FOR_S1_MME"' (waiting for ethx)'
echo_fatal "BAD INTERFACE NAME FOR ENB S1-MME $ENB_INTERFACE_NAME_FOR_S1_MME"' (waiting for ethx.y, wlanx.y or wifix.y)'
fi;
is_real_interface $ENB_INTERFACE_NAME_FOR_S1U
is_vlan_interface $ENB_INTERFACE_NAME_FOR_S1U
if [ $? -eq 1 ]; then
ifconfig $ENB_INTERFACE_NAME_FOR_S1U.2 down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1U.2 > /dev/null 2>&1
interface_name=`echo $ENB_INTERFACE_NAME_FOR_S1U | cut -f1 -d '.'`
vlan=`echo $ENB_INTERFACE_NAME_FOR_S1U | cut -f2 -d '.'`
ifconfig $ENB_INTERFACE_NAME_FOR_S1U down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1U > /dev/null 2>&1
sync
bash_exec "vconfig add $ENB_INTERFACE_NAME_FOR_S1U 2"
bash_exec "vconfig add $interface_name $vlan"
sync
bash_exec "ifconfig $ENB_INTERFACE_NAME_FOR_S1U.2 up"
bash_exec "ifconfig $ENB_INTERFACE_NAME_FOR_S1U up"
sync
bash_exec "ip -4 addr add $ENB_IPV4_ADDRESS_FOR_S1U/$ENB_IPV4_NETMASK_FOR_S1U dev $ENB_INTERFACE_NAME_FOR_S1U".2
bash_exec "ip -4 addr add $ENB_IPV4_ADDRESS_FOR_S1U/$ENB_IPV4_NETMASK_FOR_S1U dev $ENB_INTERFACE_NAME_FOR_S1U"
sync
else
echo_fatal "BAD INTERFACE NAME FOR ENB S1U $ENB_INTERFACE_NAME_FOR_S1U"' (waiting for ethx)'
echo_fatal "BAD INTERFACE NAME FOR ENB S1U $ENB_INTERFACE_NAME_FOR_S1U"' (waiting for ethx.y, wlanx.y or wifix.y)'
fi;
}
clean_enb_vlan_network() {
is_real_interface $ENB_INTERFACE_NAME_FOR_S1_MME
is_vlan_interface $ENB_INTERFACE_NAME_FOR_S1_MME
if [ $? -eq 1 ]; then
ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME.1 down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1_MME.1 > /dev/null 2>&1
ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1_MME > /dev/null 2>&1
fi;
is_real_interface $ENB_INTERFACE_NAME_FOR_S1U
is_vlan_interface $ENB_INTERFACE_NAME_FOR_S1U
if [ $? -eq 1 ]; then
ifconfig $ENB_INTERFACE_NAME_FOR_S1U.2 down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1U.2 > /dev/null 2>&1
ifconfig $ENB_INTERFACE_NAME_FOR_S1U down > /dev/null 2>&1
vconfig rem $ENB_INTERFACE_NAME_FOR_S1U > /dev/null 2>&1
fi;
sync;
}
......@@ -476,33 +510,37 @@ build_mme_spgw_vlan_network() {
bash_exec "modprobe 8021q"
# create vlan interface
is_real_interface $MME_INTERFACE_NAME_FOR_S1_MME
is_vlan_interface $MME_INTERFACE_NAME_FOR_S1_MME
if [ $? -eq 1 ]; then
ifconfig $MME_INTERFACE_NAME_FOR_S1_MME.1 down > /dev/null 2>&1
vconfig rem $MME_INTERFACE_NAME_FOR_S1_MME.1 > /dev/null 2>&1
interface_name=`echo $MME_INTERFACE_NAME_FOR_S1_MME | cut -f1 -d '.'`
vlan=`echo $MME_INTERFACE_NAME_FOR_S1_MME | cut -f2 -d '.'`
ifconfig $MME_INTERFACE_NAME_FOR_S1_MME down > /dev/null 2>&1
vconfig rem $MME_INTERFACE_NAME_FOR_S1_MME > /dev/null 2>&1
sync
bash_exec "vconfig add $MME_INTERFACE_NAME_FOR_S1_MME 1"
bash_exec "vconfig add $interface_name $vlan"
sync
bash_exec "ifconfig $MME_INTERFACE_NAME_FOR_S1_MME.1 up"
bash_exec "ifconfig $MME_INTERFACE_NAME_FOR_S1_MME up"
sync
bash_exec "ip -4 addr add $MME_IPV4_ADDRESS_FOR_S1_MME/$MME_IPV4_NETMASK_FOR_S1_MME dev $MME_INTERFACE_NAME_FOR_S1_MME.1"
bash_exec "ip -4 addr add $MME_IPV4_ADDRESS_FOR_S1_MME/$MME_IPV4_NETMASK_FOR_S1_MME dev $MME_INTERFACE_NAME_FOR_S1_MME"
else
echo_fatal "BAD INTERFACE NAME FOR SGW S1-MME $MME_INTERFACE_NAME_FOR_S1_MME"' (waiting for ethx)'
echo_fatal "BAD INTERFACE NAME FOR SGW S1-MME $MME_INTERFACE_NAME_FOR_S1_MME"' (waiting for ethx.y, wlanx.y or wifix.y)'
fi;
is_real_interface $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
is_vlan_interface $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
if [ $? -eq 1 ]; then
ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP.2 down > /dev/null 2>&1
vconfig rem $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP.2 > /dev/null 2>&1
interface_name=`echo $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP | cut -f1 -d '.'`
vlan=`echo $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP | cut -f2 -d '.'`
ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP down > /dev/null 2>&1
vconfig rem $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP > /dev/null 2>&1
sync
bash_exec "vconfig add $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP 2"
bash_exec "vconfig add $interface_name $vlan"
sync
bash_exec "ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP.2 up"
bash_exec "ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP up"
sync
bash_exec "ip -4 addr add $SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP/$SGW_IPV4_NETMASK_FOR_S1U_S12_S4_UP dev $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP.2"
bash_exec "ip -4 addr add $SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP/$SGW_IPV4_NETMASK_FOR_S1U_S12_S4_UP dev $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP"
sync
else
echo_fatal "BAD INTERFACE NAME FOR SGW S1U $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP"' (waiting for ethx)'
echo_fatal "BAD INTERFACE NAME FOR SGW S1U $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP"' (waiting for ethx.y, wlanx.y or wifix.y)'
fi;
ping -c 1 router.eur > /dev/null || { echo_fatal "router.eur does not respond to ping" >&2 ; }
......@@ -651,11 +689,11 @@ clean_epc_vlan_network() {
bash_exec "modprobe 8021q"
ifconfig $MME_INTERFACE_NAME_FOR_S1_MME.1 down > /dev/null 2>&1
vconfig rem $MME_INTERFACE_NAME_FOR_S1_MME.1 > /dev/null 2>&1
ifconfig $MME_INTERFACE_NAME_FOR_S1_MME down > /dev/null 2>&1
vconfig rem $MME_INTERFACE_NAME_FOR_S1_MME > /dev/null 2>&1
ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP.2 down > /dev/null 2>&1
vconfig rem $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP.2 > /dev/null 2>&1
ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP down > /dev/null 2>&1
vconfig rem $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP > /dev/null 2>&1
for i in 5 6 7 8 9 10 11 12 13 14 15
......@@ -995,6 +1033,7 @@ clean_epc_ovs_network() {
clean_openvswitch_network
}
###########################################################
IPTABLES=/sbin/iptables
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
......
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