2019-04-27 15:01:51 +00:00
---
title: Build on Ubuntu/Debian
---
2019-10-27 08:41:14 +00:00
### Using Meson
2019-04-27 15:01:51 +00:00
2019-10-27 08:41:14 +00:00
Install the depedencies for using Meson.
2019-04-27 15:01:51 +00:00
```bash
2019-10-27 08:41:14 +00:00
$ sudo apt install python3 python3-pip python3-setuptools python3-wheel ninja-build
2019-04-27 15:01:51 +00:00
```
2019-10-27 08:41:14 +00:00
Install Meson using Python
2019-04-27 15:01:51 +00:00
```bash
2019-10-27 08:41:14 +00:00
$ pip3 install --user meson
2019-04-27 15:01:51 +00:00
```
### Making TUN Permanent
---
Write a configuration file for the TUN deivce.
```bash
2019-10-27 08:41:14 +00:00
$ sudo sh -c "cat < < EOF > /etc/systemd/network/99-open5gs.netdev
2019-04-27 15:01:51 +00:00
[NetDev]
2019-10-27 08:41:14 +00:00
Name=ogstun
2019-04-27 15:01:51 +00:00
Kind=tun
EOF"
```
2019-10-27 08:41:14 +00:00
Create a TUN device. The interface name will be `ogstun` .
2019-04-27 15:01:51 +00:00
```bash
$ sudo systemctl enable systemd-networkd
$ sudo systemctl restart systemd-networkd
$ sudo apt install net-tools
2019-10-27 08:41:14 +00:00
$ ifconfig ogstun
ogstun: flags=4241< UP , POINTOPOINT , NOARP , MULTICAST > mtu 1500
2019-04-27 15:01:51 +00:00
inet6 fe80::e86e:86d8:ea24:f8ee prefixlen 64 scopeid 0x20< link >
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 255 (255.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
```
Then, to support IPv6-enabled UEs, you must configure your TUN device to support IPv6.
```bash
2019-10-27 08:41:14 +00:00
$ sysctl -n net.ipv6.conf.ogstun.disable_ipv6
2019-04-27 15:01:51 +00:00
1
2019-10-27 08:41:14 +00:00
$ sudo sh -c "echo 'net.ipv6.conf.ogstun.disable_ipv6=0' > /etc/sysctl.d/30-open5gs.conf"
$ sudo sysctl -p /etc/sysctl.d/30-open5gs.conf
2019-04-27 15:01:51 +00:00
2019-10-27 08:41:14 +00:00
$ sysctl -n net.ipv6.conf.ogstun.disable_ipv6
2019-04-27 15:01:51 +00:00
0
```
**Note:** If your TUN device already supports IPv6, you can skip this steps above.
{: .notice--warning}
You are now ready to set the IP address on TUN device.
```bash
2019-10-27 08:41:14 +00:00
$ sudo sh -c "cat < < EOF > /etc/systemd/network/99-open5gs.network
2019-04-27 15:01:51 +00:00
[Match]
2019-10-27 08:41:14 +00:00
Name=ogstun
2019-04-27 15:01:51 +00:00
[Network]
2020-02-17 01:41:16 +00:00
Address=10.45.0.1/16
2022-01-14 02:50:27 +00:00
Address=2001:db8:cafe::1/48
2019-04-27 15:01:51 +00:00
EOF"
```
Restart the TUN device
```bash
$ sudo systemctl restart systemd-networkd
```
Make sure it is set up properly.
```bash
2019-10-27 08:41:14 +00:00
$ ifconfig ogstun
ogstun: flags=4305< UP , POINTOPOINT , RUNNING , NOARP , MULTICAST > mtu 1500
2020-02-17 01:41:16 +00:00
inet 10.45.0.1 netmask 255.255.0.0 destination 10.45.0.1
2022-01-14 02:50:27 +00:00
inet6 2001:db8:cafe::1 prefixlen 64 scopeid 0x0< global >
2019-04-27 15:01:51 +00:00
inet6 fe80::e86e:86d8:ea24:f8ee prefixlen 64 scopeid 0x20< link >
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 20 bytes 2019 (2.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
```
2019-10-27 08:41:14 +00:00
**Note:** On *Linux* , you should run `open5gs-pgwd` first to correctly verify the IP address of TUN device. Otherwise, the TUN device's IP address is not displayed by the [ifconfig ](http://net-tools.sourceforge.net/man/ifconfig.8.html ) command.
2019-04-27 15:01:51 +00:00
{: .notice--warning}