Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:hw:007-patron:lte [2023/08/15 18:11] avsetula [Configuration File] |
en:hw:007-patron:lte [2023/10/04 12:40] (current) avsetula [Disabling/Enabling NAT for LTE modem:] |
||
---|---|---|---|
Line 88: | Line 88: | ||
==== Configuration File ==== | ==== Configuration File ==== | ||
- | The **lte.conf** configuration file is available in the **/etc/unipi/** directory. Editing the file is possible e.g. with MidnightCommander: <code>/etc/unipi/lte.conf</code> | + | The **lte.conf** configuration file is available in the **/etc/unipi/** directory. Editing the file is possible e.g. with MidnightCommander: <code>mc -e /etc/unipi/lte.conf</code> |
This file is divided into three sections, some settings ([[#autokeepon_feature|auto_keepon]], [[#autoswitch_feature|autoswitch]], [[#log_file|Log File]]) are described in detail in separate chapters. | This file is divided into three sections, some settings ([[#autokeepon_feature|auto_keepon]], [[#autoswitch_feature|autoswitch]], [[#log_file|Log File]]) are described in detail in separate chapters. | ||
Line 144: | Line 144: | ||
primary_iface: eth0 ; Primary WAN interface. The LTE connection is always a backup one. | primary_iface: eth0 ; Primary WAN interface. The LTE connection is always a backup one. | ||
fail_threshold: 3 ; Default: 3 | fail_threshold: 3 ; Default: 3 | ||
- | ip_eth: 8.8.8.8 ; Adress that the daemon pings to via ethernet interface (eth0) | + | ip_eth: 8.8.8.8 ; Adress that the daemon pings to via ethernet interface |
- | ip_lte: 8.8.8.8 ; Adress that the daemon pings to via lte interface (wwan0) | + | ip_lte: 8.8.8.8 ; Adress that the daemon pings to via lte interface |
period: 4 ; Ping period given in 10 sec timesteps; 0 - every 10 sec | period: 4 ; Ping period given in 10 sec timesteps; 0 - every 10 sec | ||
timeout: 2 ; Wait for pong in seconds | timeout: 2 ; Wait for pong in seconds | ||
Line 169: | Line 169: | ||
==== Autoswitch feature ==== | ==== Autoswitch feature ==== | ||
- | Pokud je funkce Autoswitch povolena (výchozí stav), Linuxová služba **unipi-lte** automaticky určuje výchozí síťovou bránu dle dostupnosti WAN na hlavním/záložním síťovém rozhraní. Výchozím stavu využívá jako hlavní síťový adaptér pevný Ethernet (eth0), zatímco LTE rozhraní plní roli záložního spojení. Ve směrovací tabulce Linuxu by mělo být vždy zadáno výchozí směrování pro obě rozhraní. Pokud pak nastane potřeba přepnutí mezi rozhraními, služba unipi-lte automaticky zvýší/sníží metriku LTE rozhraní. | + | When Autoswitch feature is enabled (default state), service **unipi-lte** automatically selects the default network gateway based on WAN availability on the primary/backup network interface. By default, the primary network interface is fixed Ethernet (eth0) and the LTE interface is the backup connection. The Linux routing table must always contain the default routing for both interfaces. If there is a need to switch between the primary and backup interfaces, the unipi-lte service will automatically increase/decrease the LTE interface metric. |
- | Aby bylo možné přepínat mezi hlavním a záložním rozhraním, je nutné, aby **hodnoty metrik všech síťových rozhraní byly nenulové kladné hodnoty**. | + | In order to switch between the primary and backup interfaces, it is necessary that **the metric values of all network interfaces are non-zero positive values**. |
- | * __IP adresa z DHCP serveru:__ není nutné nic nastavovat, jelikož (nenulovou) metriku zvolí DHCP klient. | + | * __IP address from the DHCP server:__ There is no need to set anything, as the (non-zero) metric is set by the DHCP client. |
- | * __Statická IP adresa:__ vždy je nutné nastavit nenulovou hodnotu metriky manuálně, jelikož statické směrování má výchozí hodnotu ''metric 0''. Metriku lze nastavit v konfiguračním souboru rozhraní v rámci **///etc/network/interfaces.d//** vložením konstanty, například ''metric 5''. \\ \\ Pro rozhraní **eth0** bude v takovém případě obsah souboru **///etc/network/interfaces.d/eth0//** s konfigurací statické IP vypadat zhruba takto: \\ <code> | + | * __Static IP address:__ You must always set a non-zero metric value manually, as the default static routing is set to ''metric 0''. Metric can be set in the network interface configuration file within **//etc/network/interfaces.d//** by inserting a constant, such as ''metric 5''. \\ For interface eth0, the contents of the file **//etc/network/interfaces.d/eth0//** with static IP configuration will look something like this: \\ <code> |
- | # Vzorová konfigurace statické IP pro jednotku v LAN síti | + | # Example of static IP configuration for a unit on a LAN |
auto eth0 | auto eth0 | ||
Line 182: | Line 182: | ||
netmask 255.255.255.0 | netmask 255.255.255.0 | ||
dns-nameservers 192.168.221.1 | dns-nameservers 192.168.221.1 | ||
- | metric 5 # Kladná nenulová konstanta | + | metric 5 # Non-zero positive value |
</code> | </code> | ||
- | Funkci **Autoswitch** lze vypnout v [[#ping|konfiguračním souboru v sekci PING]] služby unipi-lte. Zapnutí/vypnutí se provádí nastavením hodnot **True/False** | + | The **Autoswitch** feature can be disabled in the [[#ping|configuration file in the PING]] section of the unipi-lte service. Feature is turned on/off by setting the values **True/False**. |
Line 239: | Line 239: | ||
===== Advanced options ===== | ===== Advanced options ===== | ||
- | ==== Disabling NAT for LTE modem: ==== | + | ==== Disabling/Enabling NAT for LTE modem: ==== |
+ | By default, NAT is enabled. To turn it off/on, you need to send a specific AT command to the modem via the virtual serial line: | ||
- | - communication takes place over the virtual serial line **/dev/ttyLTE_AT1** (for example via minicom program):<code> | + | - communication is possible via the virtual serial line **/dev/ttyLTE_AT1** (e.g. by the minicom): <code>minicom -D /dev/ttyLTE_AT1</code> |
- | minicom -D /dev/ttyLTE_AT1 | + | - then you need to send the string (AT disable command):<code>AT+QCFG="nat",X</code> |
- | </code> | + | |
- | - then you need to send the string (AT shutdown command):<code> | + | <WRAP center round info 95%> |
- | AT+QCFG="nat",1 | + | To disable NAT it is necessary to set parameter **1** instead of **X**, or parameter **0** to enable it. |
- | </code> | + | </WRAP> |
+ | |||
+ | After sending the command and exiting the minicom program, it is **necessary to restart the modem** for the settings to take effect. Restart is possible e.g. by unplugging/plugging the power supply of the controller /*, or by restarting the **unipi-lte** service*/. | ||
+ | |||
+ | ---- | ||
**Note:** The string (AT command) must be entered in the exact format, including case sensitivity. A proven method is, for example, to copy the entire AT command string and then paste it into the terminal window running minicom. | **Note:** The string (AT command) must be entered in the exact format, including case sensitivity. A proven method is, for example, to copy the entire AT command string and then paste it into the terminal window running minicom. | ||
- | **Note on minicom:** Exit minicom by pressing key combination **CTRL+A**, followed by **Q**, this will bring up a dialog in which you still need to confirm the end of the program. | + | **Note on minicom:** To exit the minicom, press the CTRL+A key combination, followed by the Q key, which brings up a dialog where you still need to confirm the exit. |