blob: 9f87131afeb6d52b29dcb00a5d11d2493ea10291 [file] [log] [blame]
Neels Hofmeyr25dd7852017-09-25 16:37:34 +02001== Managing Subscribers
2
3Subscribers are kept in a local SQLite database file and can be managed via VTY
4and CTRL interfaces.
5
Neels Hofmeyr0c331ab2018-07-02 15:12:33 +02006This section provides some examples; also refer to the OsmoHLR VTY reference
Neels Hofmeyr25dd7852017-09-25 16:37:34 +02007manual <<vty-ref-osmohlr>> as well as the Control interface described in
8<<hlr-ctrl>>.
9
10=== Example: Add/Update/Delete Subscriber via VTY
11
Neels Hofmeyr0c331ab2018-07-02 15:12:33 +020012The following telnet VTY session adds a subscriber complete with GSM (2G) and
13UMTS (3G and 2G) authentication tokens, and finally removes the subscriber
14again; it assumes that osmo-hlr is running and listening for telnet VTY
15connections on localhost:
Neels Hofmeyr25dd7852017-09-25 16:37:34 +020016
17----
18$ telnet localhost 4258
19include::../example_subscriber_add_update_delete.vty[]
20----
21
22[[subscriber-params]]
23=== Subscriber Parameters
24
25The following parameters are managed for each subscriber of the HLR, modelled
26roughly after 3GPP TS 23.008, version 13.3.0; note that not all of these
Neels Hofmeyr0c331ab2018-07-02 15:12:33 +020027parameters are necessarily in active use.
28
29The `aud3g` table also applies to 2G networks: it provides UMTS AKA tokens for
30Milenage authentication, which is available both on 3G and 2G networks. On 2G,
31when both MS and network are R99 capable (like OsmoMSC and OsmoSGSN are), the
32full UMTS AKA with Milenage keys from `aud_3g`, using AUTN and extended RES
33tokens, is available. With pre-R99 MS or network configurations, the GSM AKA
34compatible variant of Milenage, still using the Milenage keys from `aud_3g` but
35transceiving only RAND and SRES, may be applicable. (See 3GPP TS 33.102, chapter
366.8.1, Authentication and key agreement of UMTS subscribers.)
Neels Hofmeyr25dd7852017-09-25 16:37:34 +020037
38.OsmoHLR's subscriber parameters
39[options="header",width="100%",cols="20%,20%,60%"]
40|===
41|Name|Example|Description
42|imsi|901700000014701|identity of the SIM/USIM, 3GPP TS 23.008 chapter 2.1.1.1
43|msisdn|2342123|number to dial to reach this subscriber (multiple MSISDNs can be stored per subscriber), 3GPP TS 23.008 chapter 2.1.2
44|imeisv|4234234234234275|identity of the mobile device and software version, 3GPP TS 23.008 chapter 2.2.3
Neels Hofmeyr0c331ab2018-07-02 15:12:33 +020045|aud2g.algo|comp128v3|Authentication algorithm ID for GSM AKA, corresponds to enum osmo_auth_algo
Neels Hofmeyr25dd7852017-09-25 16:37:34 +020046|aud2g.ki||Subscriber's secret key (128bit)
Neels Hofmeyr0c331ab2018-07-02 15:12:33 +020047|aud3g.algo|milenage|Authentication algorithm ID for UMTS AKA (applies to both 3G and 2G networks), corresponds to enum osmo_auth_algo
Neels Hofmeyr25dd7852017-09-25 16:37:34 +020048|aud3g.k|(32 hexadecimal digits)|Subscriber's secret key (128bit)
49|aud3g.op|(32 hexadecimal digits)|Operator's secret key (128bit)
50|aud3g.opc|(32 hexadecimal digits)|Secret key derived from OP and K (128bit), alternative to using OP which does not disclose OP to subscribers
51|aud3g.sqn|123|Sequence number of last used key (64bit unsigned)
52|aud3g.ind_bitlen|5|Nr of index bits at lower SQN end
53|apn||
54|vlr_number||3GPP TS 23.008 chapter 2.4.5
55|hlr_number||3GPP TS 23.008 chapter 2.4.6
56|sgsn_number||3GPP TS 23.008 chapter 2.4.8.1
57|sgsn_address||3GPP TS 23.008 chapter 2.13.10
58|ggsn_number||3GPP TS 23.008 chapter 2.4.8.2
59|gmlc_number||3GPP TS 23.008 chapter 2.4.9.2
60|smsc_number||3GPP TS 23.008 chapter 2.4.23
61|periodic_lu_tmr||3GPP TS 23.008 chapter 2.4.24
62|periodic_rau_tau_tmr||3GPP TS 23.008 chapter 2.13.115
63|nam_cs|1|Enable/disable voice access (3GPP TS 23.008 chapter 2.1.1.2: network access mode)
64|nam_ps|0|Enable/disable data access (3GPP TS 23.008 chapter 2.1.1.2: network access mode)
65|lmsi||3GPP TS 23.008 chapter 2.1.8
66|ms_purged_cs|0|3GPP TS 23.008 chapter 2.7.5
67|ms_purged_ps|1|3GPP TS 23.008 chapter 2.7.6
68|===
69
Oliver Smithc4157232019-03-06 20:23:01 +010070=== Configuring the Subscribers Create on Demand Feature
71
72Usually a HLR will only allow mobile equipment (ME) on the network, if the HLR
73has a subscriber entry with the ME's IMSI. But OsmoHLR can also be configured to
74automatically create new entries for new IMSIs, with the
75subscriber-create-on-demand VTY option. The obvious use case is creating the
76new subscriber entry and then allowing the ME to use both the CS
77(Circuit Switched) and PS (Packet Switched) NAM (Network Access Mode).
78
79On the other hand, operators might only want to give network access to IMSIs, of
80which they know the owner. In order to do that, one can set the default NAM to
81"none" and manually approve new subscribers by enabling their nam_cs and nam_ps
82parameters (e.g. over the VTY).
83
84Oftentimes it is hard to know, which IMSI belongs to which ME, but the IMEI is
85readily available. If you configure your MSC to send IMEI checking requests to
86the HLR, before sending location update requests, the subscribers created on
87demand can also have the IMEI stored in the HLR database. With OsmoMSC, this
88is done by writing "check-imei-rqd early" in the "msc" section of osmo-msc.cfg.
89Then enable storing the IMEI when receiving check IMEI requests with
90"store-imei" in the OsmoHLR configuration.