OAI 安装好之后网络配置。
HowToConnectCOTSUEwithOAIeNBNew
All in one OpenAirInterface
安装Ubuntu
设备要求:
至少真4核,没有超线程。
安装的Ubuntu 18.04
安装好后
- 更新
sudo apt update
sudo apt upgrade
- 安装git并在git中配置您的标识:
sudo apt install git
git config --global user.name "XXX" % 这里填你的用户名
git config --global user.email "XXXX@XXXX.com" % 这里填你的邮箱
- 将OAI存储库添加为授权的远程系统
echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
安装USRP设备
安装UHD
sudo apt-get install libboost-all-dev libusb-1.0-0-dev python-mako doxygen python-docutils python-requests python3-pip cmake build-essential
git clone git://github.com/EttusResearch/uhd.git
cd uhd; mkdir host/build; cd host/build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install
sudo ldconfig
sudo /usr/lib/uhd/utils/uhd_images_downloader.py
下载补丁
cd ~
wget https://open-cells.com/opencells-mods-20190923.tgz
tar xf opencells-mods-20190923.tgz
安装EPC
克隆OAI EPC:
# maybe go back to home directory (leave openairinterface5g directory)
git clone https://gitlab.eurecom.fr/oai/openair-cn.git
cd openair-cn
git checkout develop
输入以下命令查看当前的commit版本号
git log
测试的commit为:724542d0b59797b010af8c5df15af7f669c1e838
打补丁:
git apply ~/opencells-mods/EPC.patch
如果要与其他版本的OpenAir EPC合并,则源文件的新版本也位于tar中。
为EPC安装第三方软件
cd openair-cn; source oaienv; cd scripts
./build_hss -i
- 安装:freeDiameter 1.2.0 回答是
- phpmyadmin:
* 在此过程的后面,我们将不使用phpmyadmin来更新MySQL数据库
* 我们删除了phpmyadmin的安装(当然,您可以根据需要使用它)
对于ubuntu 18.04,我们调回旧版mysql安全级别
sudo mysql -u root << END
USE mysql;
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
FLUSH PRIVILEGES;
END
sudo systemctl restart mysql.service
sudo mysql_secure_installation
最后一个命令将问几个问题:
- password: set your password (linux is set in our default config files)
- VALIDATE PASSWORD PLUGIN: no
- Remove anonymous users: yes
- Disallow root login remotely: yes
- Remove test database and access to it: yes
- Reload privilege tables now: yes
为mme和spgw安装3PP SW
./build_mme -i
- Do you want to install freeDiameter 1.2.0: no
- Do you want to install asn1c rev 1516 patched? <y/N>: yes
- Do you want to install libgtpnl ? <y/N>: yes
- wireshark permissions: as you prefer
./build_spgw -i
- Do you want to install libgtpnl ? <y/N>: no
编译EPC节点
cd openair-cn; source oaienv; cd scripts
./build_hss
./build_mme
./build_spgw
以上一般都可以顺利安装完毕,没有报错
在18.04下载并编译eNB
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g
git checkout edb74831da
测试的commit版本号为: edb74831dabf79686eb5a92fbf8fc06e6b267d35
分两步构建
这里最好能够先fanqiang,中间的步骤需要从外网下载东西,不然会报错
source oaienv
./cmake_targets/build_oai -I # install SW packages from internet
./cmake_targets/build_oai -w USRP --eNB --UE # compile eNB and UE
执行此步骤时,安装过程中出现一个警告:
Log file for compilation has been written to: /home/sdr/openairinterface5g/cmake_targets/log/params_libconfig.Rel14.txt
params_libconfig compiled
Log file for compilation has been written to: /home/sdr/openairinterface5g/cmake_targets/log/coding.Rel14.txt
coding compiled
Log file for compilation has been written to: /home/sdr/openairinterface5g/cmake_targets/log/nasmesh.Rel14.txt
nasmesh compiled
WARNING: 1 warnings. See /home/sdr/openairinterface5g/cmake_targets/log/nasmesh.Rel14.txt
Log file for compilation has been written to: /home/sdr/openairinterface5g/cmake_targets/log/rb_tool.Rel14.txt
rb_tool compiled
Log file for compilation has been written to: /home/sdr/openairinterface5g/cmake_targets/log/oai_usrpdevif.Rel14.txt
oai_usrpdevif compiled
liboai_device.so is linked to USRP device library
Compiling rfsimulator
Log file for compilation has been written to: /home/sdr/openairinterface5g/cmake_targets/log/rfsimulator.Rel14.txt
rfsimulator compiled
Compiling basicsimulator
Log file for compilation has been written to: /home/sdr/openairinterface5g/cmake_targets/log/tcp_bridge_oai.Rel14.txt
tcp_bridge_oai compiled
Log file for compilation has been written to: /home/sdr/openairinterface5g/cmake_targets/log/oai_eth_transpro.Rel14.txt
oai_eth_transpro compiled
liboai_transpro.so is linked to ETHERNET transport
10. Bypassing the Tests ...
配置网络设置
我为这种多合一设置进行了简单的配置。
每个节点都位于单独的IP地址上,该地址用于其所有接口。对于我们的多合一情况,我们在回送上获取地址:在您的所有计算机上都可以。
HSS is on localhost: 127.0.0.1
eNB is on 127.0.0.10
MME is on 127.0.0.20
SPGW is on 127.0.0.30
LTE直径配置现已与Linux主机名隔离。
我们的EPC领域:“ OpenAir5G.Alliance”,因此,完整的专有名称(FQDN)为:hss.OpenAir5G.Alliance,主机名.OpenAir5G.Alliance
查看hostname (主机名)
sdr@sdr:~$ cat /etc/hostname
sdr
sdr@sdr:~$ hostname
sdr
sdr@sdr:~$ hostname -f
sdr.OpenAir5G.Alliance
sudo gedit /etc/hosts
127.0.0.1 localhost
127.0.1.1 sdr.OpenAir5G.Alliance sdr
127.0.1.1 hss.OpenAir5G.Alliance hss
为eNB安装此配置
在您的eNB配置文件中,网络现在已修复,因为lo接口始终存在,并且我们的计算机内部地址也:
////////// MME parameters:
mme_ip_address = ( { ipv4 = "127.0.0.20";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.10/8";
ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.10/8";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
在eNB配置文件中,还需要根据您的SIM卡设置MCC和MNC:
tracking_area_code = “1”;
mobile_country_code = “208”;
mobile_network_code = “92”;
显然,您的无线电参数。
我们用以下文件测试了USRP B210 20MHz频段,Huawei E3272 UE,腔双工器,简单天线,约1米距离的UE / eNB天线,并使用以下文件进行了测试:
~/opencells-mods/enb.10MHz.b200
如果您使用OpenAir UE,则为与我们的hss数据库示例匹配的sim卡文件:opencells-mods / sim.conf。我们将制作另一个教程,以结合使用OpenAir UE和RF板仿真
为EPC安装此配置
对于EPC,我们安装在OAI默认目录中:/usr/local/etc/oai
(未完待补充。。。)
检验额外软件安装
(1)安装mysql-server
sudo apt-get install mysql-server
密码自己设置,但是要记住,偷懒就和Linux的root密码一样就完事了。
(2)安装apache2:
sudo apt-get install apache2
测试apache2:
浏览器访问 localhost或者127.0.0.1 会出现apache2主页 (注:不可开VPN,否则不会出现)
(3) 安装php
sudo apt-get install php7.0
sudo apt-get install libapache2-mod-php7.0
sudo service apache2 restart
测试php
sudo gedit /var/www/html/info.php
在该文件里添加php语句:
<?php
echo "<P>Hello World!</P> "?>
保存退出,然后浏览器访问 localhost/info.php
,浏览器会显示hello world页面(不可挂VPN!)
(4) 安装mysql
sudo apt-get install mysql-server mysql-client
测试mysql
输入mysql –u root –p
输入安装mysql时设置的root密码,会出现mysql操作界面(我的好像不要输密码,也不会出来,不碍事)
- 登陆有问题可参考: Ubuntu MySQL第一次登陆
(5) 安装 phpmyadmin
sudo apt-get install phpmyadmin
sudo ln -s /usr/share/phpmyadmin /var/www/html
测试phpmyadmin:
浏览器访问localhost/phpmyadmin
或者127.0.0.1/phpmyadmin
浏览器会显示数据库登录页面
如果报错:mbstringextension is missing.Please check your PHP configuration. (我是每次装都报这个错)
解决办法:
sudo gedit /etc/php/7.0/mods-available/json.ini
把文件里第二行的分号去掉,保存退出,重启网络:
sudo service apache2 restart
报错
mme报错
sdr@sdr:~/openair-cn/scripts$ ./run_mme
OPENAIRCN_DIR = /home/sdr/openair-cn
Initializing OAI Logging
Initializing MSC logs
Initializing MSC logs Done
Function s6a_init (&mme_config) has failed
returning 22
百度之后,是由于内核原因导致报错。
参考:OAI搭建EPC遇到的问题合集
OAI搭建 EPC(2018-09最新版)
EPC搭建对内核敏感,官网推荐说安装低延迟内核,原文如下:
1. Installation and Configuration of OAI eNB + EPC + HSS
Checklist prior to OAI installation:
Ubuntu 14.04 LTS (64-bit). We only test Ubuntu 14.04 extensively, so please do not try any other distribution for the first time.
Kernel Setup Instructions, https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirKernelMainSetup # 内核设置说明disable C-states from BIOS (or from GRUB)
disable CPU freq. scaling
install low-latency kernelInstall git with the command sudo apt-get install git (we will be downloading source codes from the trunk at this moment).
Note: If GNURadio has already been installed, check the version of UHD. So
the simplest way is to uninstall GNURadio and outdated UHD libraries. Please do not install UHD from sources as different versions can cause problems with the code. The recommended way to install UHD is through OAI scripts only ($OPENAIR_DIR/cmake_targets/build_oai -I -w USRP). We have tested versions 3.9.2/3.9.3/3.9.4/3.10.0 recently.