# How to Install OsmoBTS

OsmoBTS is an open-source software package that allows you to build and deploy a complete GSM Base Transceiver Station.

In this blog post, we will show you how to get your OsmoBTS up and running in no time, so you can start using it right away. First, we will configure our machine and then install OsmoBTS.

Read on to learn the easy steps for setting up OsmoBTS on your system.

| Software | Download |
| --- | --- |
| Debian 12.1.0 |  |
| VMWare WorkStation Pro 17 |  |
| OsmoBTS |  |
| OsmoBTS Virtual |  |
| RFS VM OsmoBTS.ova |  |

```bash
rfs@bts01:~$ uname -a
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693522645575/d62469d2-2f0b-41a3-96f5-4594671a0ac8.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693522519431/e8678efc-64f1-4b50-b21a-03b72e4835c6.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693950077384/6580a93d-613a-4729-aa04-251e02829239.png align="center")

## Basic Machine Config

Install some packages

```bash
root# apt install -y sudo git curl vim locate
```

Add user to Sudo Group

```bash
usermod -a -G sudo rfs
```

Define hostname

```bash
sudo hostnamectl set-hostname bts01.telecom.rfs
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693520197394/4a63395e-322d-4987-8af5-76955b9faf10.png align="center")

Add hostname to Hosts file

```bash
sudo vim /etc/hosts
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693528237624/db12be60-a034-4b0c-8d55-391216af15a7.png align="center")

## Networking

Local services

| IP | Port | Service |
| --- | --- | --- |
| 10.20.20.10 | 4729 | OsmoBTS Virtual |
| 127.0.0.1 | 4241 | OsmoBTS Console |

Network Devices

| IP | Machine | Hostname |
| --- | --- | --- |
| 10.20.20.10 | BTS01 | bts01.telecom.rfs |
| 10.20.20.21 | BSC01 | bsc01.telecom.rfs |
| 10.20.20.22 | MGW | mgw.telecom.rfs |
| 10.20.20.23 | STP01 | stp01.telecom.rfs |
| 10.20.20.24 | MSC | msc.telecom.rfs |
| 10.20.20.25 | HLR | hlr.telecom.rfs |
| 10.20.20.26 | SGSN | sgsn.telecom.rfs |
| 10.20.20.27 | GGSN | ggsn.telecom.rfs |
| 10.20.20.28 | SIP Connector | sip.telecom.rfs |

```bash
sudo vim /etc/network/interfaces
auto ens33
iface ens33 inet static 
  address 10.20.20.21
  netmask 255.255.255.0
  gateway 10.20.20.1
  dns-nameservers 10.20.20.5
  dns-nameservers 8.8.8.8
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693520242464/e58a12db-1067-4c08-9c59-fa885485e464.png align="center")

Define DNS Server

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693520335749/9223866f-fdee-4347-9fd2-789b0b96e727.png align="center")

```bash
sudo vim /etc/resolv.conf

nameserver 10.20.20.5
nameserver 8.8.4.4
```

```bash
sudo systemctl restart networking.service
sudo systemctl status networking.service
sudo systemctl daemon-reload
```

Configure GRUB

```bash
sudo vim /etc/default/grub
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT = 0
```

```bash
sudo update-grub
```

## Install OsmoBTS

```bash
sudo apt-get install -y osmo-bts*
```

```bash
sudo systemctl start osmo-bts
sudo systemctl status osmo-bts
sudo systemctl enable osmo-bts
```

```bash
telnet localhost 4241
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693525574401/a0628265-df37-4cd8-a8f9-35a500d40e35.png align="center")

Troubleshoot OsmoBTS Service

```bash
journalctl -xeu osmo-bts.service
sudo systemctl status osmo-bts
```

OsmoBTS Parameters

```bash
rfs@bts01:/etc/osmocom$ /usr/bin/osmo-bts-trx -h
Some useful options:
  -h    --help                  this text
  -d    --debug MASK            Enable debugging (e.g. -d DRSL:DOML:DLAPDM)
  -D    --daemonize             For the process into a background daemon
  -c    --config-file           Specify the filename of the config file
  -s    --disable-color         Don't use colors in stderr log output
  -T    --timestamp             Prefix every log line with a timestamp
  -V    --version               Print version information and exit
  -e    --log-level             Set a global log-level

VTY reference generation:
        --vty-ref-mode MODE     VTY reference generation mode (e.g. 'expert').
        --vty-ref-xml           Generate the VTY reference XML output and exit.

Regression testing:
       --vty-test               VTY test mode. Do not connect to BSC, do not exit.
```

OsmoBTS Configuration file

```bash
cd /etc/osmocom
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693527622996/08171540-397d-4ccb-aeed-643b58715f14.png align="center")

| File | Download |
| --- | --- |
| osmo-bts.cfg |  |
| osmo-bts-trx.cfg |  |
| osmo-bts-virtual.cfg |  |

## Install Virtual OsmoBTS

Install Virtual OsmoBTS Service

```bash
sudo apt-get install -y osmo-bts-virtual
```

Manage Virtual OsmoBTS Service

```bash
sudo systemctl start osmo-bts
sudo systemctl status osmo-bts
sudo systemctl enable osmo-bts
```

That's all it takes to install OsmoBTS on your system. With a few simple steps, you can have your own GSM/GPRS/EDGE/UMTS/HSPA cell network up and running.

Combined with the right SDR hardware, OsmoBTS can make operating a cell network a breeze.

## References

[https://osmocom.org/projects/osmobts/wiki](https://osmocom.org/projects/osmobts/wiki)

* [OsmoBTS User Manual](https://ftp.osmocom.org/docs/latest/osmobts-usermanual.pdf)
    
* [OsmoBTS Abis Protocol Manual](https://ftp.osmocom.org/docs/latest/osmobts-abis.pdf)
    

%[https://www.youtube.com/watch?v=n5iqEaxTerQ]
