DISCLAIMER¶
This page is user-contributed information, and not official documentation by the Osmocom project. It might be outdated or inaccurate.
Please help by improving this document, or reporting any issues to the relevant mailing list.
This page will describe how to install and configure OpenBSC, OsmoBTS, OsmoTRX, OsmoPCU and OpenGGSN to create an opensource 2G/GSM network with your Ettus USRP B200/B210 SDR hardware.
This page in under development, please stay tuned.
Pre-Req:
The following guide is created on Ubuntu 14.14.03 LTS 64bit with kernel 3.19.0-26-lowlatency
Installing the UHD driver stack for Ettus USRP SDRs:
http://files.ettus.com/manual/page_install.html#install_linux_ourbins
Installing dependencies:
apt-get install libdbi0-dev libdbd-sqlite3 build-essential libtool autoconf automake git-core pkg-config libssl-dev libpcsclite-dev libusb-1.0 libncurses5-dev libgsm1-dev libpcap-dev libc-ares-dev libtalloc-dev libsctp-dev
Get Opencore AMR:
wget http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz tar xvzf opencore-amr-0.1.3.tar.gz cd opencore-amr-0.1.3 ./configure make make install ldconfig cd ..
Get ORTP:
Note: 0.24.2 is not working with OpenBSC!
wget http://download.savannah.gnu.org/releases/linphone/ortp/sources/ortp-0.22.0.tar.gz tar xvzf ortp-0.22.0.tar.gz cd ortp-0.22.0 ./configure make make install ldconfig cd ..
Please refer to Build from source to get, built and install source for the projects listed below.
- libosmocore
- libosmo-abis
- libosmo-netif
- openggsn
- libosmo-sccp
- openbsc after command autoreconf -fi enter @export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
- osmo-pcu
- osmo-trx
- osmo-bts
for osmo-bts use branch: 201509-fairwaves-rebase by issuing command bellow:
git checkout 201509-fairwaves-rebase
./configure --enable-trx
Get mISDN kernel and user space:
Note: if you see "configure: error: kernel build tree does not exist" then you need to install kernel headers.
git clone git://git.misdn.eu/mISDN.git cd mISDN ./configure cp mISDN.cfg.default standalone/mISDN.cfg make modules make modules_install ldconfig cd ..
git clone git://git.misdn.eu/mISDNuser.git cd mISDNuser make ./configure make sudo make install ldconfig cd ..
depmod –a modprobe mISDN_core modprobe mISDN_dsp modprobe mISDN_l1loop nchannel=30 interfaces=2
To auto-load the mISDN kernel modules do:
cd /etc/modules-load.d/ cat > misdn-modules.conf mISDN_core mISDN_dsp mISDN_l1loop nchannel=30 interfaces=2
Hit Ctrl+C
chmod 644 misdn-modules.conf cd /
Install Asterisk (ver 1.8 !):
On Ubuntu 14.04 there is no version 1.8 Asterisk anymore, to get it, do the following:
wget http://launchpadlibrarian.net/153943558/asterisk-modules_1.8.13.1~dfsg-3ubuntu3_amd64.deb wget http://launchpadlibrarian.net/153943773/asterisk-config_1.8.13.1~dfsg-3ubuntu3_all.deb wget http://launchpadlibrarian.net/153943772/asterisk-dev_1.8.13.1~dfsg-3ubuntu3_all.deb wget http://launchpadlibrarian.net/153943557/asterisk_1.8.13.1~dfsg-3ubuntu3_amd64.deb wget http://launchpadlibrarian.net/107480639/asterisk-core-sounds-en-gsm_1.4.22-1_all.deb wget http://launchpadlibrarian.net/58272892/asterisk-moh-opsound-gsm_2.03-1_all.deb dpkg -i *.deb apt-get -f install
Otherwise the Asterisk channel driver (chan_lcr) will not compile.
Get LCR (master):
git clone git://git.misdn.eu/lcr.git/ cd lcr autoreconf -fi ./configure --with-gsm-bs --with-misdn --with-asterisk make make install cp chan_lcr.so /usr/lib/asterisk/modules/ ldconfig cd ..
Configure the LCR interfaces:
cat > /usr/etc/lcr/interface.conf [GSM] gsm-bs tones no earlyb no bridge ast [ast] remote asterisk context from-lcr earlyb no tones yes bridge GSM
Hit Ctrl+C
Add the following two lines to the bottom of options.conf:
nano /usr/etc/lcr/options.conf socketuser asterisk socketgroup asterisk
Configuration of Asterisk:
You can find an attached configuration file extensions.conf. Please put that file and overwrite the original configuration at /etc/asterisk/exetensions.conf
Then restart asterisk:
sudo service asterisk restart
Configuring the GGSN:
Use the example configuration file called "ggsn.conf" and put it to /etc/ggsn.conf
The traffic from the UEs (mobiles, USB modems etc) are terminated on a TUN interface with the IP address: 10.0.0.1
The UEs are going to get an address from this range: 10.0.0.2 - 10.0.0.254
The GGSN will listen on 127.0.0.5. In this example all the services (BSC, GGSN, SGSN, PCU etc.) are running on the same computer.
Configuring OpenBSC, OsmoSGSN, OsmoPCU
Please use the attached example config files at the bottom of this page.
Starting the services
Please note that in this example we are going to need quite a few terminals to be open, because except for LCR, GGSN and Asterisk, we are going to run the services in foreground.
Start the GGSN:
ggsn
Start LCR:
lcr fork
Open a new terminal and start the SGSN (with the sample config file provided):
sudo osmo-sgsn -c sgsn.conf
Open a new terminal and start the BSC (with the sample config file provided):
sudo osmo-nitb -C -c openbsc.conf -T -P -m
Open a new terminal and start Osmo-TRX:
sudo osmo-trx
Open a new terminal and start Osmo-BTS (with the sample config file provided):
sudo osmobts-trx -c osmo-bts.cfg
Open a new terminal and start Osmo-PCU (with the sample config file provided):
sudo osmo-pcu -c osmo-pcu.cfg
Setting up NAT for GPRS:
In order for the UEs to be able to "see" the internet, we need to enable network address translation (NAT).
First determine which network interface is connected to the internet with:
ifconfig
After you know the interface name (for example: eth0 or eth1 or em1 etc.), run the following commands.
Note that in the second command you need to use your interface name instead of "em1".
sudo echo 1 > /proc/sys/net/ipv4/ip_forward sudo iptables -A POSTROUTING -s 10.0.0.0/24 -t nat -o em1 -j MASQUERADE
Updated by laforge about 4 years ago · 26 revisions