Method for defining and applying a frequency plan in a communication system such as a medium or long range wireless system of the LPWAN type comprising a server and a plurality of gateways (120, 121, 122, 123) connected to said server, the plurality of gateways using frequency bands for making wireless communications with terminals (110, 111) in the communication system, characterised in the server performs the following steps: - obtaining a description of a mobility hierarchy in which mobility types are hierarchically defined; - obtaining a description of a mobility tree in which the mobility areas are hierarchically defined, each mobility area having a mobility type in conformity with the mobility hierarchy; - obtaining (503, 601) terrain measurements associated with each mobility area defined in the mobility tree; - determining, from the terrain measurements, for each mobility area, information on the percentage of time during which the terrain measurements show a received signal level RSSI lower than such and such a received signal level RSSI threshold from a predefined set of received signal level RSSI thresholds; in that the server runs through the mobility tree by iterating the following steps: - selecting the mobility area with the highest hierarchical degree not yet processed; - determining, for the mobility area selected, a mean probability P m for each frequency band, from said time-percentage information determined for each mobility area that is a leaf of the tree and is hierarchically attached to the mobility area selected; - allocating, for the mobility area detected, up to a quantity P of frequency bands having the best mean probabilities; in that the server performs the following steps for configuring the gateways vis-à-vis the frequency plan: - obtaining descriptions of mobility ranges in which groupings of mobility areas are made and in which, for each grouping, a list of gateways is associated with each grouping in order to indicate which gateways are intended to support said grouping; - configuring each gateway according to said descriptions of ranges and frequency bands allocated to the mobility areas constituting said groupings; in that, on reception from a terminal of a request for connection to the communication system, the server obtains a description of the terminal from a terminal identifier included in said request, the description including a list of mobility types to which said terminal has a right of access, and the server iterates the following steps for all the mobility types to which said terminal has a right of access: - identifying (903, 910) the mobility type with the highest hierarchical degree; - identifying which mobility areas correspond to said mobility type with the highest hierarchical degree identified; - selecting a mobility area from the mobility areas identified; - allocating to said terminal at least one frequency band allocated to the mobility area selected; and in that the server configures said terminal according to the frequency bands thus allocated to said terminal. - obtaining a description of a mobility hierarchy in which mobility types are hierarchically defined; - obtaining a description of a mobility tree in which the mobility areas are hierarchically defined, each mobility area having a mobility type in conformity with the mobility hierarchy; - obtaining (503, 601) terrain measurements associated with each mobility area defined in the mobility tree; - determining, from the terrain measurements, for each mobility area, information on the percentage of time during which the terrain measurements show a received signal level RSSI lower than such and such a received signal level RSSI threshold from a predefined set of received signal level RSSI thresholds; - selecting the mobility area with the highest hierarchical degree not yet processed; - determining, for the mobility area selected, a mean probability P m for each frequency band, from said time-percentage information determined for each mobility area that is a leaf of the tree and is hierarchically attached to the mobility area selected; - allocating, for the mobility area detected, up to a quantity P of frequency bands having the best mean probabilities; - obtaining descriptions of mobility ranges in which groupings of mobility areas are made and in which, for each grouping, a list of gateways is associated with each grouping in order to indicate which gateways are intended to support said grouping; - configuring each gateway according to said descriptions of ranges and frequency bands allocated to the mobility areas constituting said groupings; - identifying (903, 910) the mobility type with the highest hierarchical degree; - identifying which mobility areas correspond to said mobility type with the highest hierarchical degree identified; - selecting a mobility area from the mobility areas identified; - allocating to said terminal at least one frequency band allocated to the mobility area selected; and in that the server configures said terminal according to the frequency bands thus allocated to said terminal.