Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
canghaiwuhen
OpenXG-RAN
Commits
6fbb56e9
Commit
6fbb56e9
authored
Jun 17, 2014
by
Lionel Gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@5407
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
9248559e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
107 deletions
+140
-107
targets/PROJECTS/GENERIC-LTE-EPC/interfaces.bash
targets/PROJECTS/GENERIC-LTE-EPC/interfaces.bash
+12
-0
targets/PROJECTS/GENERIC-LTE-EPC/networks.bash
targets/PROJECTS/GENERIC-LTE-EPC/networks.bash
+9
-37
targets/PROJECTS/GENERIC-LTE-EPC/start_epc.bash
targets/PROJECTS/GENERIC-LTE-EPC/start_epc.bash
+72
-63
targets/PROJECTS/GENERIC-LTE-EPC/utils.bash
targets/PROJECTS/GENERIC-LTE-EPC/utils.bash
+40
-0
targets/PROJECTS/GENERIC-LTE-EPC/virtual_box.bash
targets/PROJECTS/GENERIC-LTE-EPC/virtual_box.bash
+7
-7
No files found.
targets/PROJECTS/GENERIC-LTE-EPC/interfaces.bash
View file @
6fbb56e9
...
...
@@ -177,6 +177,10 @@ is_openvswitch_interface() {
else
if
[
"a
${
var
:0:3
}
"
==
"atun"
]
;
then
return
0
;
else
if
[
"a
${
var
:0:4
}
"
==
"avbox"
]
;
then
return
0
;
fi
fi
fi
fi
...
...
@@ -194,6 +198,14 @@ delete_tun_interface() {
fi
}
delete_vlan_interface
()
{
is_vlan_interface
$1
if
[
$?
-eq
0
]
;
then
ifconfig
$1
down
>
/dev/null 2>&1
vconfig rem
$1
>
/dev/null 2>&1
fi
}
create_tun_interface
()
{
is_tun_interface
$1
...
...
targets/PROJECTS/GENERIC-LTE-EPC/networks.bash
View file @
6fbb56e9
...
...
@@ -257,33 +257,7 @@ build_mme_spgw_vlan_network() {
#
is_real_interface
$PGW_INTERFACE_NAME_FOR_SGI
if
[
$?
-eq
1
]
;
then
get_mac_router
# # get ipv4 address from PGW_INTERFACE_NAME_FOR_SGI
#IP_ADDR=`ifconfig $PGW_INTERFACE_NAME_FOR_SGI | awk '/inet addr/ {split ($2,A,":"); print A[2]}' | tr '\n' ' ' | sed -n '1h;1!H;${;g;s/^[ \t]*//g;s/[ \t]*$//g;p;}'`
#NETWORK=`echo $IP_ADDR | cut -d . -f 1,2,3`
bash_exec
"modprobe 8021q"
for
i
in
5 6 7 8 9 10 11 12 13 14 15
do
# create vlan interface
ifconfig
$PGW_INTERFACE_NAME_FOR_SGI
.
$i
down
>
/dev/null 2>&1
vconfig rem
$PGW_INTERFACE_NAME_FOR_SGI
.
$i
>
/dev/null 2>&1
sync
bash_exec
"vconfig add
$PGW_INTERFACE_NAME_FOR_SGI
$i
"
sync
bash_exec
"ifconfig
$PGW_INTERFACE_NAME_FOR_SGI
.
$i
up"
sync
# configure vlan interface
#CIDR=$NETWORK'.'$i'/24'
base
=
200
NET
=
$((
$i
+
$base
))
CIDR
=
'10.0.'
$NET
'.2/8'
bash_exec
"ip -4 addr add
$CIDR
dev
$PGW_INTERFACE_NAME_FOR_SGI
.
$i
"
done
bash_exec
"ip link set
$PGW_INTERFACE_NAME_FOR_SGI
promisc on"
create_sgi_vlans
else
echo_warning
"SGI interface disabled by config file"
fi
...
...
@@ -326,20 +300,15 @@ clean_epc_vlan_network() {
bash_exec
"modprobe 8021q"
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
down
>
/dev/null 2>&1
vconfig rem
$SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
>
/dev/null 2>&1
delete_vlan_interface
$MME_INTERFACE_NAME_FOR_S1_MME
delete_vlan_interface
$SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
for
i
in
5 6 7 8 9 10 11 12 13 14 15
do
# delete vlan interface
ifconfig
$PGW_INTERFACE_NAME_FOR_SGI
.
$i
down
>
/dev/null 2>&1
vconfig rem
$PGW_INTERFACE_NAME_FOR_SGI
.
$i
>
/dev/null 2>&1
delete_vlan_interface
$PGW_INTERFACE_NAME_FOR_SGI
.
$i
down
done
#ip link set $PGW_INTERFACE_NAME_FOR_SGI down > /dev/null 2>&1
clean_network
}
...
...
@@ -509,6 +478,10 @@ clean_tun_network() {
build_epc_tun_network
()
{
build_tun_network
create_sgi_vlans
}
create_sgi_vlans
()
{
get_mac_router
...
...
@@ -528,11 +501,10 @@ build_epc_tun_network() {
#CIDR=$NETWORK'.'$i'/24'
base
=
200
NET
=
$((
$i
+
$base
))
CIDR
=
'10.0.'
$NET
'.2/
8
'
CIDR
=
'10.0.'
$NET
'.2/
24
'
bash_exec
"ip -4 addr add
$CIDR
dev
$PGW_INTERFACE_NAME_FOR_SGI
.
$i
"
done
bash_exec
"ip link set
$PGW_INTERFACE_NAME_FOR_SGI
promisc on"
}
...
...
targets/PROJECTS/GENERIC-LTE-EPC/start_epc.bash
View file @
6fbb56e9
...
...
@@ -46,33 +46,73 @@
# setting or a VLAN setting.
#
###########################################################################################################################
# VIRTUAL
SWITCH
SETTING
# VIRTUAL
BOX
SETTING
###########################################################################################################################
# hss.eur
# |
# +-----------+ +------+ +-----------+ v +----------+
# | eNB +------+ | ovs | VLAN 1+------+ MME +----+ +---+ HSS |
# | |cpenb0+------------------+cpmme0| | +------+ | |
# | +------+ |bridge| +------+ +----+ +---+ |
# | |upenb0+-------+ | | | +----------+
# +-----------+------+ | | | +-+-------+-+
# | | +----------------| s11mme|---+
# | | +---+---+ |
# | | (optional)| |
# | | +---+---+ |
# +---|------------------ | s11sgw|---+ router.eur
# | +-+-------+-+ | +--------------+
# | | S+P-GW | v | ROUTER |
# | VLAN2 +------+ +-------+ +----+ +----+
# +----------+upsgw0| |sgi +-...-+ | | +---...Internet
# +------+ +-------+ +----+ +----+
# | | 11 VLANS | |
# +-----------+ ids=[5..15] +--------------+
# NETWORK SETTING AT EURECOM IN EXPERIMENTAL NETWORK (192.168.12.X)
#
#
# INTERNET GW 192.168.12.100
# |
# |
# 192.168.12.X/24 |
# +-----------+----------------+---+--+---------------------------------------+
# | COMPUTER 1| | eth0 | |
# +-----------+ +---+--+ |
# | | |
# | | |
# | ROUTER +-----+------+ |
# | |MASQUERADING| |
# | |FORWARDING | |
# | +-----+------+ |
# | | |
# | | |
# | | |
# | | |
# | | |
# | +---+--+ |
# | | eth1 | |
# +----------------------------+---+--+---------------------------------------+
# |router.eur
# 11 VLANS | INTERNET GW 192.168.12.100
# ids=[5..15] | |
# 192.168.13.X/24 | |
# +-----------+----------------+---+--+---------------------+---+--+----------+
# | COMPUTER 2| SGI | eth1 | Physical | eth0 | |
# +-----------+ +-+--+-+ Interface +------+ |
# | | | 'HOST_BRIDGED_IF_NAME' |
# | | | |
# | | | +-----------+ |
# | | | +------+ HSS | |
# | | +----------+ eth0 | (VM) | |
# | | +------+ | |
# | | | | |
# | | +-+------+--+ |
# | | |eth1 | hss.eur |
# | virtual box | +--+---+ |
# | +------------------+ | virtual box |
# | | bridged network | host-only |
# | | | network |
# | | | 192.168.57/24 |
# | | | |
# | +--+---+ +--+-----+ |
# | |eth0 | |vboxnet1| |
# | +-+------+--+192.168.56.101 192.168.56.1+-+--------++ |
# | | eNB 0 +------+ virtual box +--------+ MME | |
# | | (VM) |eth1 +----------------+vboxnet0| S+P/GW | |
# | | +------+ host-only +--------+(execu. on | |
# | | | network |COMPUTER2) | |
# | | | 192.168.56/24 | | |
# | | LTE eNB 1 | | | |
# | | LTE UEs | | | |
# | +-----------+ +-----------+ |
# | |
# | |
# +---------------------------------------------------------------------------+
#
###########################################################################################################################
# VLAN SETTING
###########################################################################################################################
#
hss.eur
#
each box is a host
hss.eur
# |
# +-----------+ +-----------+ v +----------+
# | eNB +------+ VLAN 1+------+ MME +----+ +---+ HSS |
...
...
@@ -113,7 +153,7 @@ fi
#
check_install_epc_software
check_install_epc_software
##################################
...
...
@@ -236,50 +276,19 @@ SGW_IPV4_ADDRESS_FOR_S5_S8_UP=$( echo $SGW_IPV4_ADDRESS_FOR_S5_S8_UP
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
'/'
)
is_
openvswitch_interface
$ENB
_INTERFACE_NAME_FOR_S1_MME
\
$ENB_INTERFACE_NAME_FOR_S1U
\
$MME_INTERFACE_NAME_FOR_S1_MME
\
$SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
is_
vlan_interface
$MME
_INTERFACE_NAME_FOR_S1_MME
\
$SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
if
[
$?
-eq
1
]
;
then
ovs_setting
=
1
vlan_setting
=
0
echo_success
"Found open-vswitch network configuration"
# May we have booted on a new kernel, not the one when we build vswitch kernel module
if
[
!
-f
/lib/modules/
`
uname
-r
`
/extra/openvswitch.ko
]
;
then
$OPENAIRCN_DIR
/SCRIPTS/install_openvswitch1.9.0.bash
fi
clean_epc_ovs_network
build_epc_ovs_network
test_epc_ovs_network
else
is_vlan_interface
$MME_INTERFACE_NAME_FOR_S1_MME
\
$SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
if
[
$?
-eq
1
]
;
then
echo_success
"Found open VLAN network configuration"
ovs_setting
=
0
vlan_setting
=
1
# may be openvswitch is needed for S11
is_openvswitch_interface
$MME_IPV4_ADDRESS_FOR_S11_MME
\
$SGW_IPV4_ADDRESS_FOR_S11
if
[
$?
-eq
1
]
;
then
# May we have booted on a new kernel, not the one when we build vswitch kernel module
if
[
!
-f
/lib/modules/
`
uname
-r
`
/extra/openvswitch.ko
]
;
then
$OPENAIRCN_DIR
/SCRIPTS/install_openvswitch1.9.0.bash
fi
fi
clean_epc_vlan_network
build_mme_spgw_vlan_network
else
is_real_interface
$MME_IPV4_ADDRESS_FOR_S11_MME
\
$SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
if
[
$?
-eq
1
]
;
then
echo_success
"Found standart network configuration"
else
echo_error
"Cannot find open-vswitch network configuration or VLAN network configuration or standart network configuration"
exit
1
fi
fi
else
ovs_setting
=
0
vlan_setting
=
0
clean_epc_vlan_network
create_sgi_vlans
fi
##################################################
...
...
targets/PROJECTS/GENERIC-LTE-EPC/utils.bash
View file @
6fbb56e9
...
...
@@ -592,6 +592,46 @@ function svn_find_str_in_file_history()
done
}
compile_hss
()
{
cd
$OPENAIRCN_DIR
/OPENAIRHSS
OBJ_DIR
=
`
find
.
-maxdepth
1
-type
d
-iname
obj
*
`
if
[
!
-n
"
$OBJ_DIR
"
]
then
OBJ_DIR
=
"objs"
bash_exec
"mkdir -m 777 ./
$OBJ_DIR
"
echo_success
"Created
$OBJ_DIR
directory"
else
OBJ_DIR
=
`
basename
$OBJ_DIR
`
fi
if
[
!
-f
$OBJ_DIR
/Makefile
]
then
if
[
!
-n
"m4"
]
then
mkdir
-m
777 m4
fi
echo_success
"Invoking autogen"
bash_exec
"./autogen.sh"
cd
./
$OBJ_DIR
echo_success
"Invoking configure"
../configure
else
cd
./
$OBJ_DIR
fi
if
[
-f
Makefile
]
then
echo_success
"Compiling..."
make
-j
`
cat
/proc/cpuinfo |
grep
processor |
wc
-l
`
if
[
$?
-ne
0
]
;
then
echo_error
"Build failed, exiting"
exit
1
fi
else
echo_error
"Configure failed, exiting"
exit
1
fi
}
compile_epc
()
{
cd
$OPENAIRCN_DIR
OBJ_DIR
=
`
find
.
-maxdepth
1
-type
d
-iname
obj
*
`
...
...
targets/PROJECTS/GENERIC-LTE-EPC/virtual_box.bash
View file @
6fbb56e9
...
...
@@ -18,7 +18,7 @@ source $THIS_SCRIPT_PATH/utils.bash
# INTERNET GW 192.168.12.100
# |
# |
# 192.168.12.
X/24
|
# 192.168.12.
17/24
|
# +-----------+----------------+---+--+---------------------------------------+
# | COMPUTER 1| | eth0 | |
# +-----------+ +---+--+ |
...
...
@@ -35,10 +35,10 @@ source $THIS_SCRIPT_PATH/utils.bash
# | +---+--+ |
# | | eth1 | |
# +----------------------------+---+--+---------------------------------------+
#
|
#
192.168.13.17/24
|
# | INTERNET GW 192.168.12.100
# | |
#
192.168.13.X/24 |
|
#
192.168.13.175/24 | 192.168.12.175/24
|
# +-----------+----------------+---+--+---------------------+---+--+----------+
# | COMPUTER 2| | eth1 | Physical | eth0 | |
# +-----------+ +-+--+-+ Interface +------+ |
...
...
@@ -48,15 +48,15 @@ source $THIS_SCRIPT_PATH/utils.bash
# | | | +------+ HSS | |
# | | +----------+ eth0 | (VM) | |
# | | +------+ | |
# | |
| | |
# | |
192.168.13.177
| | |
# | | +-+------+--+ |
# | | |eth1 |
|
# | | |eth1 |
192.168.57.101
|
# | | +--+---+ |
# | +------------------+ | |
# | | bridged network | host-only |
# | | | network |
# | | | 192.168.57/24 |
# | |
|
|
# | |
92.168.13.176 |192.168.57.1
|
# | +--+---+ +--+-----+ |
# | |eth0 | |vboxnet1| |
# | +-+------+--+192.168.56.101 192.168.56.1+-+--------++ |
...
...
@@ -181,7 +181,7 @@ build_vms() {
echo_warning
"!!!!!!! in this case, help yourself...) !!!!!!!"
echo_warning
"!!!!!!! exchange ssh keys between host and guests !!!!!!!"
echo_warning
"!!!!!!! in /etc/fstab on guests: add following line: !!!!!!!"
echo_warning
"!!!!!!! sshfs#root@
192.168.13.175:/root/trunk /mnt/sshfs/trunk fuse comment=sshfs
!!!!!!!"
echo_warning
"!!!!!!! sshfs#root@
<IP@ of host>:/root/trunk /mnt/sshfs/trunk fuse comment=sshfs
!!!!!!!"
echo_warning
"!!!!!!! ,noauto,users,exec,uid=0,gid=0,allow_other,reconnect,transform_symlinks, !!!!!!!"
echo_warning
"!!!!!!! BatchMode=yes 0 0 !!!!!!!"
echo_warning
"!!!!!!! on guest: create a mount point: /mnt/sshfs/trunk for example, then mount: !!!!!!!"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment