osmo-hlr/tests/test_nodes.vty

506 lines
18 KiB
Plaintext
Raw Normal View History

OsmoHLR> ?
show Show running system information
list Print command list
exit Exit current mode and down to previous mode
help Description of the interactive help system
enable Turn on privileged mode command
terminal Set terminal line parameters
who Display who is on vty
logging Configure logging
no Negate a command or set its defaults
logp Print a message on all log outputs; useful for placing markers in test logs
subscriber Subscriber management commands
OsmoHLR> list
...
show gsup-connections
show subscribers all
show subscribers (imei|imsi|msisdn) FILTER
show subscribers (cs|ps) (on|off)
show subscribers last-seen
subscriber (imsi|msisdn|id|imei) IDENT show
show subscriber (imsi|msisdn|id|imei) IDENT
show mslookup services
...
OsmoHLR> enable
OsmoHLR# ?
...
subscriber Subscriber management commands
OsmoHLR# configure terminal
OsmoHLR(config)# ?
...
hlr Configure the HLR
mslookup Configure Distributed GSM mslookup
...
OsmoHLR(config)# list
...
hlr
mslookup
...
OsmoHLR(config)# hlr
OsmoHLR(config-hlr)# ?
...
euse Configure a particular External USSD Entity
no Negate a command or set its defaults
ussd USSD Configuration
ncss-guard-timeout Set guard timer for NCSS (call independent SS) session activity
smsc Configuration of GSUP routing to SMSCs
reject-cause GSUP/GMM cause to be sent
store-imei Save the IMEI in the database when receiving Check IMEI requests. Note that an MSC does not necessarily send Check IMEI requests (for OsmoMSC, you may want to set 'check-imei-rqd 1').
subscriber-create-on-demand Make a new record when a subscriber is first seen.
OsmoHLR(config-hlr)# list
...
gsup
ps
database PATH
euse NAME
no euse NAME
ussd route prefix PREFIX internal (own-msisdn|own-imsi|test-idle)
ussd route prefix PREFIX external EUSE
no ussd route prefix PREFIX
ussd default-route external EUSE
no ussd default-route
ncss-guard-timeout <0-255>
smsc entity NAME
no smsc entity NAME
smsc route NUMBER NAME
no smsc route NUMBER
smsc default-route NAME
no smsc default-route
reject-cause (not-found|no-proxy) (imsi-unknown|illegal-ms|plmn-not-allowed|la-not-allowed|roaming-not-allowed|no-suitable-cell-in-la|net-fail|congestion|auth-unacceptable|proto-error-unspec)
store-imei
no store-imei
subscriber-create-on-demand (no-msisdn|<3-15>) (none|cs|ps|cs+ps)
no subscriber-create-on-demand
OsmoHLR(config-hlr)# gsup
OsmoHLR(config-hlr-gsup)# ?
...
bind Listen/Bind related socket option
ipa-name Set the IPA name of this HLR, for proxying to remote HLRs
OsmoHLR(config-hlr-gsup)# list
...
bind ip A.B.C.D
ipa-name NAME
OsmoHLR(config-hlr-gsup)# exit
OsmoHLR(config-hlr)# exit
OsmoHLR(config)# exit
OsmoHLR# configure terminal
OsmoHLR(config)# hlr
OsmoHLR(config-hlr)# store-imei
OsmoHLR(config-hlr)# gsup
OsmoHLR(config-hlr-gsup)# end
OsmoHLR# disable
OsmoHLR> enable
OsmoHLR# show running-config
Current configuration:
!
!
log stderr
...
logging level main notice
logging level db notice
logging level auc notice
logging level ss notice
1/2: refactor: add and use lu_fsm, osmo_gsup_req, osmo_ipa_name These are seemingly orthogonal changes in one patch, because they are in fact sufficiently intertwined that we are not willing to spend the time to separate them. They are also refactoring changes, unlikely to make sense on their own. ** lu_fsm: Attempting to make luop.c keep state about incoming GSUP requests made me find shortcomings in several places: - since it predates osmo_fsm, it is a state machine that does not strictly enforce the order of state transitions or the right sequence of incoming events. - several places OSMO_ASSERT() on data received from the network. - modifies the subscriber state before a LU is accepted. - dead code about canceling a subscriber in a previous VLR. That would be a good thing to actually do, which should also be trivial now that we record vlr_name and sgsn_name, but I decided to remove the dead code for now. To both step up the LU game *and* make it easier for me to integrate osmo_gsup_req handling, I decided to create a lu_fsm, drawing from my, by now, ample experience of writing osmo_fsms. ** osmo_gsup_req: Prepare for D-GSM, where osmo-hlr will do proxy routing for remote HLRs / communicate with remote MSCs via a proxy: a) It is important that a response that osmo-hlr generates and that is sent back to a requesting MSC contains all IEs that are needed to route it back to the requester. Particularly source_name must become destination_name in the response to be able to even reach the requesting MSC. Other fields are also necessary to match, which were so far taken care of in individual numerous code paths. b) For some operations, the response to a GSUP request is generated asynchronously (like Update Location Request -> Response, or taking the response from an EUSE, or the upcoming proxying to a remote HLR). To be able to feed a request message's information back into the response, we must thus keep the request data around. Since struct osmo_gsup_message references a lot of external data, usually with pointers directly into the received msgb, it is not so trivial to pass GSUP message data around asynchronously, on its own. osmo_gsup_req is the combined solution for both a and b: it keeps all data for a GSUP message by taking ownership of the incoming msgb, and it provides an explicit API "forcing" callers to respond with osmo_gsup_req_respond(), so that all code paths trivially are definitely responding with the correct IEs set to match the request's routing (by using osmo_gsup_make_response() recently added to libosmocore). Adjust all osmo-hlr code paths to use *only* osmo_gsup_req to respond to incoming requests received on the GSUP server (above LU code being one of them). In fact, the same should be done on the client side. Hence osmo_gsup_req is implemented in a server/client agnostic way, and is placed in libosmo-gsupclient. As soon as we see routing errors in complex GSUP setups, using osmo_gsup_req in the related GSUP client is likely to resolve those problems without much thinking required beyond making all code paths use it. libosmo-gsupclient is hence added to osmo-hlr binary's own library dependencies. It would have been added by the D-GSM proxy routing anyway, we are just doing it a little sooner. ** cni_peer_id.c / osmo_ipa_name: We so far handle an IPA unit name as pointer + size, or as just pointer with implicit talloc size. To ease working with GSUP peer identification data, I require: - a non-allocated storage of an IPA Name. It brings the drawback of being size limited, but our current implementation is anyway only able to handle MSC and SGSN names of 31 characters (see struct hlr_subscriber). - a single-argument handle for IPA Name, - easy to use utility functions like osmo_ipa_name_to_str(), osmo_ipa_name_cmp(), and copying by simple assignment, a = b. Hence this patch adds a osmo_ipa_name in cni_peer_id.h and cni_peer_id.c. Heavily used in LU and osmo_gsup_req. Depends: libosmocore Id9692880079ea0f219f52d81b1923a76fc640566 Change-Id: I3a8dff3d4a1cbe10d6ab08257a0138d6b2a082d9
2019-11-20 01:36:45 +00:00
logging level mslookup notice
logging level lu notice
logging level dgsm notice
...
hlr
store-imei
database hlr_vty_test.db
gsup
bind ip 127.0.0.1
ipa-name unnamed-HLR
ussd route prefix *#100# internal own-msisdn
ussd route prefix *#101# internal own-imsi
ps
pdp-profiles default
profile 1
apn internet
profile 2
apn *
end
OsmoHLR# configure terminal
OsmoHLR(config)# mslookup
OsmoHLR(config-mslookup)# ?
...
mdns Multicast DNS related configuration
no Negate a command or set its defaults
server Enable and configure Distributed GSM mslookup server
client Enable and configure Distributed GSM mslookup client
OsmoHLR(config-mslookup)# list
...
mdns bind [IP] [<1-65535>]
mdns domain-suffix DOMAIN_SUFFIX
no mdns bind
server
no server
client
no client
OsmoHLR(config-mslookup)# ?
...
mdns Multicast DNS related configuration
no Negate a command or set its defaults
server Enable and configure Distributed GSM mslookup server
client Enable and configure Distributed GSM mslookup client
OsmoHLR(config-mslookup)# no?
no Negate a command or set its defaults
OsmoHLR(config-mslookup)# no ?
mdns Disable both server and client for mDNS mslookup
server Disable Distributed GSM mslookup server
client Disable Distributed GSM mslookup client
OsmoHLR(config-mslookup)# mdns ?
bind Convenience shortcut: enable and configure both server and client for mDNS mslookup
domain-suffix mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don't collide with top-level domains administrated by IANA
OsmoHLR(config-mslookup)# mdns bind ?
[IP] multicast IPv4 address like 239.192.23.42 or IPv6 address like ff08::23:42
OsmoHLR(config-mslookup)# mdns bind 1.2.3.4 ?
[<1-65535>] mDNS UDP Port number
OsmoHLR(config-mslookup)# mdns domain-suffix ?
DOMAIN_SUFFIX mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don't collide with top-level domains administrated by IANA
OsmoHLR(config-mslookup)# server
OsmoHLR(config-mslookup-server)# ?
...
mdns Multicast DNS related configuration
no Negate a command or set its defaults
service Configure addresses of local services, as sent in replies to remote mslookup requests.
msc Configure services for individual local MSCs
OsmoHLR(config-mslookup-server)# list
...
mdns bind [IP] [<1-65535>]
mdns domain-suffix DOMAIN_SUFFIX
no mdns bind
service NAME at IP <1-65535>
no service NAME
no service NAME at IP <1-65535>
msc ipa-name .IPA_NAME
OsmoHLR(config-mslookup-server)# mdns ?
bind Configure where the mDNS server listens for mslookup requests
domain-suffix mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don't collide with top-level domains administrated by IANA
OsmoHLR(config-mslookup-server)# mdns bind ?
[IP] multicast IPv4 address like 239.192.23.42 or IPv6 address like ff08::23:42
OsmoHLR(config-mslookup-server)# mdns bind 1.2.3.4 ?
[<1-65535>] mDNS UDP Port number
OsmoHLR(config-mslookup-server)# service?
service Configure addresses of local services, as sent in replies to remote mslookup requests.
OsmoHLR(config-mslookup-server)# service ?
NAME mslookup service name, e.g. sip.voice or smpp.sms
OsmoHLR(config-mslookup-server)# service foo ?
at at
OsmoHLR(config-mslookup-server)# service foo at ?
IP IPv4 address like 1.2.3.4 or IPv6 address like a:b:c:d::1
OsmoHLR(config-mslookup-server)# service foo at 1.2.3.4 ?
<1-65535> Service-specific port number
OsmoHLR(config-mslookup-server)# no ?
mdns Disable server for mDNS mslookup (do not answer remote requests)
service Remove one or more service address entries
OsmoHLR(config-mslookup-server)# no service ?
NAME mslookup service name, e.g. sip.voice or smpp.sms
OsmoHLR(config-mslookup-server)# no service foo ?
at at
<cr>
OsmoHLR(config-mslookup-server)# no service foo at ?
IP IPv4 address like 1.2.3.4 or IPv6 address like a:b:c:d::1
OsmoHLR(config-mslookup-server)# no service foo at 1.2.3.4 ?
<1-65535> Service-specific port number
OsmoHLR(config-mslookup-server)# msc?
msc Configure services for individual local MSCs
OsmoHLR(config-mslookup-server)# msc ?
ipa-name Identify locally connected MSC by IPA Unit Name
OsmoHLR(config-mslookup-server)# msc ipa-name ?
IPA_NAME IPA Unit Name of the local MSC to configure
OsmoHLR(config-mslookup-server)# msc ipa-name MSC-1
OsmoHLR(config-mslookup-server-msc)# ?
...
service Configure addresses of local services, as sent in replies to remote mslookup requests.
no Negate a command or set its defaults
OsmoHLR(config-mslookup-server-msc)# list
...
service NAME at IP <1-65535>
no service NAME
no service NAME at IP <1-65535>
OsmoHLR(config-mslookup-server-msc)# service?
service Configure addresses of local services, as sent in replies to remote mslookup requests.
OsmoHLR(config-mslookup-server-msc)# service ?
NAME mslookup service name, e.g. sip.voice or smpp.sms
OsmoHLR(config-mslookup-server-msc)# service foo ?
at at
OsmoHLR(config-mslookup-server-msc)# service foo at ?
IP IPv4 address like 1.2.3.4 or IPv6 address like a:b:c:d::1
OsmoHLR(config-mslookup-server-msc)# service foo at 1.2.3.4 ?
<1-65535> Service-specific port number
OsmoHLR(config-mslookup-server-msc)# no ?
service Remove one or more service address entries
OsmoHLR(config-mslookup-server-msc)# no service ?
NAME mslookup service name, e.g. sip.voice or smpp.sms
OsmoHLR(config-mslookup-server-msc)# no service foo ?
at at
<cr>
OsmoHLR(config-mslookup-server-msc)# no service foo at ?
IP IPv4 address like 1.2.3.4 or IPv6 address like a:b:c:d::1
OsmoHLR(config-mslookup-server-msc)# no service foo at 1.2.3.4 ?
<1-65535> Service-specific port number
OsmoHLR(config-mslookup-server-msc)# exit
OsmoHLR(config-mslookup-server)# exit
OsmoHLR(config-mslookup)# client
OsmoHLR(config-mslookup-client)# ?
...
timeout How long should the mslookup client wait for remote responses before evaluating received results
mdns Multicast DNS related configuration
no Negate a command or set its defaults
gateway-proxy Configure a fixed IP address to send all GSUP requests for unknown IMSIs to, without invoking a lookup for IMSI
OsmoHLR(config-mslookup-client)# list
...
timeout <1-100000>
mdns bind [IP] [<1-65535>]
mdns domain-suffix DOMAIN_SUFFIX
no mdns bind
gateway-proxy IP [<1-65535>]
no gateway-proxy
OsmoHLR(config-mslookup-client)# timeout?
timeout How long should the mslookup client wait for remote responses before evaluating received results
OsmoHLR(config-mslookup-client)# timeout ?
<1-100000> timeout in milliseconds
OsmoHLR(config-mslookup-client)# mdns?
mdns Multicast DNS related configuration
OsmoHLR(config-mslookup-client)# mdns bind?
bind Enable mDNS client, and configure multicast address to send mDNS mslookup requests to
OsmoHLR(config-mslookup-client)# mdns bind ?
[IP] multicast IPv4 address like 239.192.23.42 or IPv6 address like ff08::23:42
OsmoHLR(config-mslookup-client)# mdns bind 1.2.3.4 ?
[<1-65535>] mDNS UDP Port number
OsmoHLR(config-mslookup-client)# mdns domain-suffix?
domain-suffix mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don't collide with top-level domains administrated by IANA
OsmoHLR(config-mslookup-client)# mdns domain-suffix ?
DOMAIN_SUFFIX mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don't collide with top-level domains administrated by IANA
OsmoHLR(config-mslookup-client)# gateway-proxy?
gateway-proxy Configure a fixed IP address to send all GSUP requests for unknown IMSIs to, without invoking a lookup for IMSI
OsmoHLR(config-mslookup-client)# gateway-proxy ?
IP IP address of the remote HLR
OsmoHLR(config-mslookup-client)# gateway-proxy 1.2.3.4 ?
[<1-65535>] GSUP port number (omit for default 4222)
OsmoHLR(config-mslookup-client)# no?
no Negate a command or set its defaults
OsmoHLR(config-mslookup-client)# no ?
mdns Disable mDNS client, do not query remote services by mDNS
gateway-proxy Disable gateway proxy for GSUP with unknown IMSIs
OsmoHLR(config-mslookup-client)# gateway-proxy ?
IP IP address of the remote HLR
OsmoHLR(config-mslookup-client)# gateway-proxy 1.2.3.4 ?
[<1-65535>] GSUP port number (omit for default 4222)
OsmoHLR(config-mslookup-client)# do show mslookup?
mslookup Distributed GSM / mslookup related information
OsmoHLR(config-mslookup-client)# do show mslookup ?
services List configured service addresses as sent to remote mslookup requests
OsmoHLR(config-mslookup-client)# gateway-proxy 1.2.3.4
OsmoHLR(config-mslookup-client)# exit
OsmoHLR(config-mslookup)# mdns bind
OsmoHLR(config-mslookup)# server
OsmoHLR(config-mslookup-server)# service qwert at 123.45.67.89 qwert
% Unknown command.
OsmoHLR(config-mslookup-server)# service qwert at qwert 1234
% mslookup server: Invalid address for service qwert: qwert 1234
OsmoHLR(config-mslookup-server)# service foo.bar at 123.45.67.89 1011
OsmoHLR(config-mslookup-server)# service baz.bar at 121.31.41.5 1617
OsmoHLR(config-mslookup-server)# service baz.bar at a:b:c::d 1819
OsmoHLR(config-mslookup-server)# msc ipa-name msc-901-70-23
OsmoHLR(config-mslookup-server-msc)# service foo.bar at 76.54.32.10 1234
OsmoHLR(config-mslookup-server-msc)# service baz.bar at 12.11.10.98 7654
OsmoHLR(config-mslookup-server-msc)# service baz.bar at 999:999:999::999 9999
OsmoHLR(config-mslookup-server-msc)# service baz.bar at dd:cc:bb::a 3210
OsmoHLR(config-mslookup-server-msc)# exit
OsmoHLR(config-mslookup-server)# msc ipa-name msc-901-70-42
OsmoHLR(config-mslookup-server-msc)# service foo.bar at 1.1.1.1 1111
OsmoHLR(config-mslookup-server-msc)# service baz.bar at 2.2.2.2 2222
OsmoHLR(config-mslookup-server-msc)# service baz.bar at 2222:2222:2222::2 2222
OsmoHLR(config-mslookup-server-msc)# do show mslookup services
Local GSUP HLR address returned in mslookup responses for local IMSIs: 127.0.0.1:4222
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
service baz.bar at a:b:c::d 1819
msc ipa-name MSC-1
msc ipa-name msc-901-70-23
service foo.bar at 76.54.32.10 1234
service baz.bar at 12.11.10.98 7654
service baz.bar at dd:cc:bb::a 3210
msc ipa-name msc-901-70-42
service foo.bar at 1.1.1.1 1111
service baz.bar at 2.2.2.2 2222
service baz.bar at 2222:2222:2222::2 2222
OsmoHLR(config-mslookup-server-msc)# show running-config
...
mslookup
server
mdns bind 239.192.23.42 4266
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
service baz.bar at a:b:c::d 1819
msc ipa-name MSC-1
msc ipa-name msc-901-70-23
service foo.bar at 76.54.32.10 1234
service baz.bar at 12.11.10.98 7654
service baz.bar at dd:cc:bb::a 3210
msc ipa-name msc-901-70-42
service foo.bar at 1.1.1.1 1111
service baz.bar at 2.2.2.2 2222
service baz.bar at 2222:2222:2222::2 2222
client
gateway-proxy 1.2.3.4 4222
mdns bind 239.192.23.42 4266
...
OsmoHLR(config-mslookup-server-msc)# no service baz.bar
OsmoHLR(config-mslookup-server-msc)# no service asdf
% mslookup server: cannot remove service 'asdf'
OsmoHLR(config-mslookup-server-msc)# exit
OsmoHLR(config-mslookup-server)# msc ipa-name msc-901-70-23
OsmoHLR(config-mslookup-server-msc)# no service baz.bar at dd:cc:bb::a 3210
% mslookup server: cannot remove service 'baz.bar' to dd:cc:bb::a 3210
OsmoHLR(config-mslookup-server-msc)# no service asdf at asdf asdf
% Unknown command.
OsmoHLR(config-mslookup-server-msc)# no service asdf at asdf 3210
% mslookup server: Invalid address for 'no service' asdf: asdf 3210
OsmoHLR(config-mslookup-server-msc)# no service asdf at dd:cc:bb::a 3210
% mslookup server: cannot remove service 'asdf' to dd:cc:bb::a 3210
OsmoHLR(config-mslookup-server-msc)# exit
OsmoHLR(config-mslookup-server)# no service baz.bar at 2.2.2.2 2222
% mslookup server: cannot remove service 'baz.bar' to 2.2.2.2 2222
OsmoHLR(config-mslookup-server)# no service baz.bar at a:b:c::d 1819
% mslookup server: cannot remove service 'baz.bar' to a:b:c::d 1819
OsmoHLR(config-mslookup-server)# exit
OsmoHLR(config-mslookup)# client
OsmoHLR(config-mslookup-client)# no gateway-proxy
OsmoHLR(config-mslookup-client)# do show mslookup services
Local GSUP HLR address returned in mslookup responses for local IMSIs: 127.0.0.1:4222
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
msc ipa-name MSC-1
msc ipa-name msc-901-70-23
service foo.bar at 76.54.32.10 1234
service baz.bar at 12.11.10.98 7654
msc ipa-name msc-901-70-42
service foo.bar at 1.1.1.1 1111
OsmoHLR(config-mslookup-client)# show running-config
...
mslookup
server
mdns bind 239.192.23.42 4266
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
msc ipa-name MSC-1
msc ipa-name msc-901-70-23
service foo.bar at 76.54.32.10 1234
service baz.bar at 12.11.10.98 7654
msc ipa-name msc-901-70-42
service foo.bar at 1.1.1.1 1111
client
mdns bind 239.192.23.42 4266
...
OsmoHLR(config-mslookup-client)# exit
OsmoHLR(config-mslookup)# server
OsmoHLR(config-mslookup-server)# service gsup.hlr at 23.42.17.11 4223
OsmoHLR(config-mslookup-server)# do show mslookup services
Local GSUP HLR address returned in mslookup responses for local IMSIs: 23.42.17.11:4223
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
service gsup.hlr at 23.42.17.11 4223
msc ipa-name MSC-1
msc ipa-name msc-901-70-23
service foo.bar at 76.54.32.10 1234
service baz.bar at 12.11.10.98 7654
msc ipa-name msc-901-70-42
service foo.bar at 1.1.1.1 1111
OsmoHLR(config-mslookup-server)# show running-config
...
mslookup
server
mdns bind 239.192.23.42 4266
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
service gsup.hlr at 23.42.17.11 4223
msc ipa-name MSC-1
msc ipa-name msc-901-70-23
service foo.bar at 76.54.32.10 1234
service baz.bar at 12.11.10.98 7654
msc ipa-name msc-901-70-42
service foo.bar at 1.1.1.1 1111
client
mdns bind 239.192.23.42 4266
...
OsmoHLR(config-mslookup-server)# end
OsmoHLR# configure terminal
OsmoHLR(config)# hlr
OsmoHLR(config-hlr)# ps?
ps Configure the PS options
OsmoHLR(config-hlr)# ps
OsmoHLR(config-hlr-ps)# list
...
pdp-profiles default
no pdp-profiles default
...
OsmoHLR(config-hlr-ps)# no pdp-profiles default
OsmoHLR(config-hlr-ps)# pdp-profiles default
OsmoHLR(config-hlr-ps-pdp-profiles)# ?
...
profile Configure a PDP profile
...
OsmoHLR(config-hlr-ps-pdp-profiles)# profile 1
OsmoHLR(config-hlr-ps-pdp-profile)# ?
...
apn Configure the APN.
...
OsmoHLR(config-hlr-ps-pdp-profile)# apn internet
OsmoHLR(config-hlr-ps-pdp-profile)# exit
OsmoHLR(config-hlr-ps-pdp-profiles)# profile 2
OsmoHLR(config-hlr-ps-pdp-profile)# apn *
OsmoHLR(config-hlr-ps-pdp-profile)# show running-config
...
ps
pdp-profiles default
profile 1
apn internet
profile 2
apn *
...