You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
15 KiB

  1. <!-- markdownlint-disable -->
  2. # travelmate, a wlan connection manager for travel router
  3. ## Description
  4. If you’re planning an upcoming vacation or a business trip, taking your laptop, tablet or smartphone give you the ability to connect with friends or complete work on the go. But many hotels don’t have a secure wireless network setup or you’re limited on using a single device at once. Investing in a portable, mini travel router is a great way to connect all of your devices at once while having total control over your own personalized wireless network.
  5. A logical combination of AP+STA mode on one physical radio allows most of OpenWrt supported router devices to connect to a wireless hotspot/station (STA) and provide a wireless access point (AP) from that hotspot at the same time. Downside of this solution: whenever the STA interface looses the connection it will go into an active scan cycle which renders the radio unusable for AP mode operation, therefore the AP is taken down if the STA looses its association.
  6. To avoid these kind of deadlocks, travelmate will set all station interfaces to an "always off" mode and connects automatically to available/configured hotspots.
  7. ## Main Features
  8. * STA interfaces operating in an "always off" mode, to make sure that the AP is always accessible
  9. * easy setup within normal OpenWrt environment
  10. * strong LuCI-Support with builtin interface wizard and a wireless station manager
  11. * render the QR-Code of the selected Access Point in LuCI to comfortably transfer the WLAN credentials to your mobile devices
  12. * fast uplink connections
  13. * support all kinds of uplinks, incl. hidden and enterprise uplinks (WEP-based uplinks are no longer supported!)
  14. * continuously checks the existing uplink connection (quality), e.g. for conditional uplink (dis-) connections
  15. * automatically add open uplinks to your wireless config, e.g. hotel captive portals
  16. * captive portal detection with internet online check and a 'heartbeat' function to keep the uplink connection up & running
  17. * captive portal auto-login hook (configured via uci/LuCI), you are able to reference an external script for captive portal auto-logins (see example below)
  18. * includes a vpn hook with support for 'wireguard' or 'openvpn' client setups to handle VPN (re-) connections automatically
  19. * includes an email hook to 'msmtp' to send notification e-mails after every succesful uplink connect
  20. * proactively scan and switch to a higher prioritized uplink, despite of an already existing connection
  21. * connection tracking which keeps start and end date of an uplink connection
  22. * automatically disable the uplink after n minutes, e.g. for timed connections
  23. * automatically (re-)enable the uplink after n minutes, e.g. after failed login attempts
  24. * option to generate a random unicast MAC address for each uplink connection
  25. * ntp time sync before sending emails
  26. * support devices with multiple radios in any order
  27. * procd init and ntp-hotplug support
  28. * runtime information available via LuCI & via 'status' init command
  29. * status & debug logging to syslog
  30. ## Prerequisites
  31. * [OpenWrt](https://openwrt.org), only compatible with the forthcoming stable 20.x or the latest OpenWrt snapshot
  32. * 'dnsmasq' as dns backend
  33. * 'iwinfo' for wlan scanning
  34. * 'curl' for connection checking and all kinds of captive portal magic, e.g. cp detection and auto-logins
  35. * a 'wpad' variant to support various WPA encrypted networks (WEP-based uplinks are no longer supported!)
  36. * optional: 'qrencode' for AP QR code support
  37. * optional: 'wireguard' or 'openvpn' for vpn client connections
  38. * optional: 'msmtp' to send out travelmate related status messages via email
  39. ## Installation & Usage
  40. * **Please note:** before you start with travelmate ...
  41. * you should setup at least one Access Point, ideally on a separate radio,
  42. * if you're updating from a former 1.x release, please use the '--force-reinstall --force-maintainer' options in opkg,
  43. * and remove any existing travelmate related uplink stations in your wireless config manually
  44. * download [travelmate](https://downloads.openwrt.org/snapshots/packages/x86_64/packages)
  45. * download [luci-app-travelmate](https://downloads.openwrt.org/snapshots/packages/x86_64/luci)
  46. * install both packages (_opkg install travelmate_, _opkg install luci-app-travelmate_)
  47. * the LuCI application is located under the 'Services' menu
  48. * start the travelmate 'Interface Wizard' once
  49. * add multiple uplink stations as you like via the 'Wireless Stations' tab
  50. * happy traveling ...
  51. ## Travelmate config options
  52. * usually the pre-configured travelmate setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' section:
  53. | Option | Default | Description/Valid Values |
  54. | :----------------- | :--------------------------------- | :---------------------------------------------------------------------------------------------------- |
  55. | trm_enabled | 0, disabled | set to 1 to enable the travelmate service (this will be done by the Interface Wizard as well!) |
  56. | trm_debug | 0, disabled | set to 1 to get the full debug output (logread -e "trm-") |
  57. | trm_iface | -, not set | uplink- and procd trigger network interface, configured by the 'Interface Wizard' |
  58. | trm_radio | -, not set | restrict travelmate to a single radio or change the overall scanning order ('radio1 radio0') |
  59. | trm_captive | 1, enabled | check the internet availability and handle captive portal redirections |
  60. | trm_netcheck | 0, disabled | treat missing internet availability as an error |
  61. | trm_proactive | 1, enabled | proactively scan and switch to a higher prioritized uplink, despite of an already existing connection |
  62. | trm_autoadd | 0, disabled | automatically add open uplinks like hotel captive portals to your wireless config |
  63. | trm_randomize | 0, disabled | generate a random unicast MAC address for each uplink connection |
  64. | trm_triggerdelay | 2 | additional trigger delay in seconds before travelmate processing begins |
  65. | trm_maxretry | 3 | retry limit to connect to an uplink |
  66. | trm_minquality | 35 | minimum signal quality threshold as percent for conditional uplink (dis-) connections |
  67. | trm_maxwait | 30 | how long should travelmate wait for a successful wlan uplink connection |
  68. | trm_timeout | 60 | overall retry timeout in seconds |
  69. | trm_maxautoadd | 5 | limit the max. number of automatically added open uplinks. To disable this limitation set it to '0' |
  70. | trm_maxscan | 10 | limit nearby scan results to process only the strongest uplinks |
  71. | trm_captiveurl | http://detectportal.firefox.com | pre-configured provider URLs that will be used for connectivity- and captive portal checks |
  72. | trm_useragent | Mozilla/5.0 ... | pre-configured user agents that will be used for connectivity- and captive portal checks |
  73. | trm_nice | 0, normal priority | change the priority of the travelmate background processing |
  74. | trm_mail | 0, disabled | sends notification e-mails after every succesful uplink connect |
  75. | trm_mailreceiver | -, not set | e-mail receiver address for travelmate notifications |
  76. | trm_mailsender | no-reply@travelmate | e-mail sender address for travelmate notifications |
  77. | trm_mailtopic | travelmate connection to '<sta>' | topic for travelmate notification E-Mails |
  78. | trm_mailprofile | trm_notify | profile used by 'msmtp' for travelmate notification E-Mails |
  79. * per uplink exist an additional 'uplink' section in the travelmate config, with the following options:
  80. | Option | Default | Description/Valid Values |
  81. | :----------------- | :--------------------------------- | :---------------------------------------------------------------------------------------------------- |
  82. | enabled | 1, enabled | enable or disable the uplink, automatically set if the retry limit or the conn. expiry was reached |
  83. | device | -, not set | match the 'device' in the wireless config section |
  84. | ssid | -, not set | match the 'ssid' in the wireless config section |
  85. | bssid | -, not set | match the 'bssid' in the wireless config section |
  86. | con_start | -, not set | connection start (will be automatically set after a successful ntp sync) |
  87. | con_end | -, not set | connection end (will be automatically set after a successful ntp sync) |
  88. | con_start_expiry | 0, disabled | automatically disable the uplink after n minutes, e.g. for timed connections |
  89. | con_end_expiry | 0, disabled | automatically (re-)enable the uplink after n minutes, e.g. after failed login attempts |
  90. | script | -, not set | reference to an external auto login script for captive portals |
  91. | script_args | -, not set | optional runtime args for the auto login script |
  92. | macaddr | -, not set | use a specified MAC address for the uplink
  93. | vpn | 0, disabled | automatically handle VPN (re-) connections |
  94. | vpnservice | -, not set | reference the already configured 'wireguard' or 'openvpn' client instance as vpn provider |
  95. | vpniface | -, not set | the logical vpn interface, e.g. 'wg0' or 'tun0' |
  96. ## VPN client setup
  97. Please follow one of the following guides to get a working vpn client setup on your travel router:
  98. * [Wireguard client setup guide](https://openwrt.org/docs/guide-user/services/vpn/wireguard/client)
  99. * [OpenVPN client setup guide](https://openwrt.org/docs/guide-user/services/vpn/openvpn/client)
  100. Once your vpn client connection is running, you can reference to that setup in travelmate to handle VPN (re-) connections automatically.
  101. ## E-Mail setup
  102. To use E-Mail notifications you have to setup the package 'msmtp'.
  103. Modify the file '/etc/msmtprc', e.g. for gmail:
  104. <pre><code>
  105. [...]
  106. defaults
  107. auth on
  108. tls on
  109. tls_certcheck off
  110. timeout 5
  111. syslog LOG_MAIL
  112. [...]
  113. account trm_notify
  114. host smtp.gmail.com
  115. port 587
  116. from xxx@gmail.com
  117. user yyy
  118. password zzz
  119. </code></pre>
  120. Finally enable E-Mail support in travelmate and add a valid E-Mail receiver address.
  121. ## Captive Portal auto-logins
  122. For automated captive portal logins you can reference an external shell script per uplink. All login scripts should be executable and located in '/etc/travelmate' with the extension '.login'. The package ships multiple ready to run auto-login scripts:
  123. * 'wifionice.login' for ICE hotspots (DE)
  124. * 'db-bahn.login' for german DB railway hotspots via portal login API (still WIP, only tested at Hannover central station)
  125. * 'chs-hotel.login' for german chs hotels
  126. * 'h-hotels.login' for Telekom hotspots in h+hotels (DE)
  127. * 'julianahoeve.login' for Julianahoeve beach resort (NL)
  128. * 'telekom.login' for telekom hotspots (DE)
  129. * 'vodafone.login' for vodafone hotspots (DE)
  130. * 'generic-user-pass.login' a template to demonstrate the optional parameter handling in login scripts
  131. A typical and successful captive portal login looks like this:
  132. <pre><code>
  133. [...]
  134. Thu Sep 10 13:30:16 2020 user.info trm-2.0.0[26222]: captive portal domain 'www.wifionice.de' added to to dhcp rebind whitelist
  135. Thu Sep 10 13:30:19 2020 user.info trm-2.0.0[26222]: captive portal login '/etc/travelmate/wifionice.login ' for 'www.wifionice.de' has been executed with rc '0'
  136. Thu Sep 10 13:30:19 2020 user.info trm-2.0.0[26222]: connected to uplink 'radio1/WIFIonICE/-' with mac 'B2:9D:F5:96:86:A4' (1/3)
  137. [...]
  138. </code></pre>
  139. Hopefully more scripts for different captive portals will be provided by the community!
  140. ## Runtime information
  141. **receive travelmate runtime information:**
  142. <pre><code>
  143. root@2go_ar750s:~# /etc/init.d/travelmate status
  144. ::: travelmate runtime information
  145. + travelmate_status : connected (net ok/100)
  146. + travelmate_version : 2.0.0
  147. + station_id : radio1/WIFIonICE/-
  148. + station_mac : B2:9D:F5:96:86:A4
  149. + station_interface : trm_wwan
  150. + wpa_flags : sae: ✔, owe: ✔, eap: ✔, suiteb192: ✔
  151. + run_flags : captive: ✔, proactive: ✔, netcheck: ✘, autoadd: ✘, randomize: ✔
  152. + ext_hooks : ntp: ✔, vpn: ✘, mail: ✘
  153. + last_run : 2020.09.10-15:21:19
  154. + system : GL.iNet GL-AR750S (NOR/NAND), OpenWrt SNAPSHOT r14430-2dda301d40
  155. </code></pre>
  156. To debug travelmate runtime problems, please always enable the 'trm\_debug' flag, restart travelmate and check the system log afterwards (_logread -e "trm-"_)
  157. ## Support
  158. Please join the travelmate discussion in this [forum thread](https://forum.lede-project.org/t/travelmate-support-thread/5155) or contact me by [mail](mailto:dev@brenken.org)
  159. ## Removal
  160. * stop the travelmate daemon with _/etc/init.d/travelmate stop_
  161. * optional: remove the travelmate package (_opkg remove luci-app-travelmate_, _opkg remove travelmate_)
  162. Have fun!
  163. Dirk