blob: 73a8d2f3690de142c215d10e90fafef090e1a7e0 [file] [log] [blame]
Neels Hofmeyr697a6172018-08-22 17:32:21 +02001=== WHAT IS THIS?
2
3* quickly configure, launch and tear down an entire Osmocom core network on
4 your box (see net/README).
5
6This is the set of tools I wrote for myself and use every day to run and test
7the Osmocom core network. I hope this helps, and I would appreciate
8contributions of any improvements you may have!
9
10
11=== Quick Start
12
13cp config_2g3g config_mine
14$EDITOR config_mine
15# update IP addresses and device names as required
16
17mkdir my_network
18cd my_network
Neels Hofmeyrcbdd7182019-03-04 00:39:32 +010019../fill_config.py ../config_mine ../templates
Neels Hofmeyr697a6172018-08-22 17:32:21 +020020
21./run.sh
22# Launches numerous x-terminals with one component running in each.
23# Logs and pcap traces are being taken automatically.
24
25# hit enter in the original first terminal to tear down all programs.
26# Enter a name to save logs, otherwise all logging will be stored
27# under autolog/<timestamp>
28
29Then possibly modify the config and refresh:
30
31# tweak config?
32$EDITOR ../config_mine
Neels Hofmeyr57e42882018-08-23 15:19:35 +020033../fill_config.py
Neels Hofmeyrcbdd7182019-03-04 00:39:32 +010034# picks up same ../config_mine and ../templates from last time
Neels Hofmeyr697a6172018-08-22 17:32:21 +020035
36# own templates?
Neels Hofmeyrcbdd7182019-03-04 00:39:32 +010037cp -r ../templates ../templates_mine
38$EDITOR ../templates_mine/*
39../fill_config.py ../templates_mine
40# picks up same ../config_mine from last time, and ../templates_mine from cmdline
Neels Hofmeyr697a6172018-08-22 17:32:21 +020041
42
Neels Hofmeyr5a9bf172018-08-23 15:31:44 +020043If you wanted to change to dynamic timeslots, you can:
44
45cd ..
Neels Hofmeyrcbdd7182019-03-04 00:39:32 +010046mkdir templates_dyn
47cd templates_dyn
48ln -s ../templates/* .
Neels Hofmeyr5a9bf172018-08-23 15:31:44 +020049rm ./osmo-bsc.cfg
Neels Hofmeyrcbdd7182019-03-04 00:39:32 +010050cp ../templates/osmo-bsc.cfg .
Neels Hofmeyr5a9bf172018-08-23 15:31:44 +020051sed -i 's#TCH/F#TCH/F_TCH/H_PDCH#' osmo-bsc.cfg
52
53cd ../my_network
Neels Hofmeyrcbdd7182019-03-04 00:39:32 +010054../fill_config.py ../templates_dyn
Neels Hofmeyr5a9bf172018-08-23 15:31:44 +020055
56
57If you moved your laptop to a different location, you can:
58
59cp ../config_mine ../config_foo
60$EDITOR ../config_foo # set new IP address(es)
61../fill_config.py ../config_foo
62
Neels Hofmeyr697a6172018-08-22 17:32:21 +020063
64=== Config file templates
65
66A *directory* contains template files that are filled with specific values by the
Neels Hofmeyrcbdd7182019-03-04 00:39:32 +010067fill_config.py script. See e.g. templates/.
Neels Hofmeyr697a6172018-08-22 17:32:21 +020068
Neels Hofmeyr5a9bf172018-08-23 15:31:44 +020069A *file* contains local config items as name=val pairs that are put into the
70templates. See e.g. config_2g3g.
Neels Hofmeyr697a6172018-08-22 17:32:21 +020071
Neels Hofmeyr57e42882018-08-23 15:19:35 +020072The fill_config.py script helps to fill the templates with the config values. Simply
73invoke fill_config.py with a dir argument (templates dir) and a file argument (specific
Oliver Smithfd7446f2018-10-22 11:59:55 +020074config values). The dir argument can be used in the templates with ${NET_DIR},
75temporary files (sockets etc.) should be placed inside this folder.
Neels Hofmeyr697a6172018-08-22 17:32:21 +020076
77If one or both are omitted, the script tries to re-use the most recent paths,
78they were stored in local files '.last_config' and '.last_templates'.
79
80The result is a complete set of .cfg files that match your local machine and
81network config.
82
83
84=== Launch
85
Neels Hofmeyrcbdd7182019-03-04 00:39:32 +010086A run.sh script template (templates/run.sh) also gets filled with specifics and
Neels Hofmeyr697a6172018-08-22 17:32:21 +020087placed next to the .cfg files.
88
89run.sh uses sudo to start tcpdump, configure ip forwarding and masquerading
90(for the GGSN's APN tunnel required for data services).
91
92When you launch run.sh, many xterms are launched, and when hitting enter, all
93of them get destroyed again. This is obviously intended to be run on your
94desktop computer or laptop, not on a remote box. It may also make sense to
95launch all of them in the current shell, and maybe or maybe not switch off
96stderr logging; or to launch each component in a tmux window or whatnot -- if
97you figure out something in that line, I would be glad to get contributions and
98incorporate that.
99
100
101=== Logging and pcaps
102
103The run.sh script automatically stores all configs, logs and pcap traces in
104./autolog/<timestamp> dirs. After closing the components (by hitting enter),
105you may also enter a name for the logs, after which they are stored in
106./logs/<name>. The idea is to keep all important logs with a name, and that you
107can every now and then just 'rm -rf ./autolog' to make space.
108
109
110=== 3G
111
112You may notice that the templates include nano3G.txt files. These include a
113convenient listing of commands to connect to an ip.access nano3G DMI and
114connect it to the HNBGW as configured by the templates.
115
116
117=== 2G BTS
118
119At the time of writing, there are no osmo-bts.cfg files, since this is intended
120for the core network and BSC components only. Feel free to add!
121
122Typically you'd need to edit only the /etc/osmocom/osmo-bts.cfg to match your
123IP address and ipa unit-id:
124
125bts 0
Neels Hofmeyr5a9bf172018-08-23 15:31:44 +0200126 oml remote-ip 192.168.0.23
127 ipa unit-id 1234 0