## Main Benefits and Features
-* Easy setup from LuCI web interface
- with **Interface Wizard** and **Wireless Station manager**
-* Display a QR code to
- transfer the wireless credentials to your mobile devices
+* Easy setup from LuCI web interface with **Interface Wizard** and **Wireless Station manager**
+* Display a QR code to transfer the wireless credentials to your mobile devices
* Fast uplink connections
* Supports routers with multiple radios in any order
-* Supports all kinds of uplinks, including hidden and enterprise uplinks.
- (WEP-based uplinks are no longer supported)
-* Continuously checks the existing uplink quality,
- e.g. for conditional uplink (dis)connections
+* Supports all kinds of uplinks, including hidden and enterprise uplinks (WEP-based uplinks are no longer supported).
+* Continuously checks the existing uplink quality, e.g. for conditional uplink (dis)connections
* Automatically add open uplinks to your wireless config, e.g. hotel captive portals
-* Captive portal detection with a
- 'heartbeat' function to keep the uplink connection up and running
-* Captive portal hook for auto-login configured via uci/LuCI.
- Use an external script for
- captive portal auto-logins (see example below)
-* VPN hook supports 'wireguard' or 'openvpn' client
- setups to handle VPN (re)connections automatically
-* Email hook via 'msmtp' sends notification e-mails
- after every successful uplink connect
-* Proactively scan and switch to a higher priority uplink,
- replacing an existing connection
+* Captive portal detection with a 'heartbeat' function to keep the uplink connection up and running
+* Captive portal hook for auto-login configured via uci/LuCI. Use an external script for captive portal auto-logins (see example below)
+* VPN hook supports 'wireguard' or 'openvpn' client setups to handle VPN (re)connections automatically
+* Email hook via 'msmtp' sends notification e-mails after every successful uplink connect
+* Proactively scan and switch to a higher priority uplink, replacing an existing connection
* Connection tracking logs start and end date of an uplink connection
+* Check router subnet vs. uplink subnet, to show conflicts with router LAN network
* Automatically disable the uplink after n minutes, e.g. for timed connections
* Automatically (re)enable the uplink after n minutes, e.g. after failed login attempts
* (Optional) Generate a random unicast MAC address for each uplink connection
| trm_enabled | 0, disabled | set to 1 to enable the travelmate service (this will be done by the Interface Wizard as well!) |
| trm_debug | 0, disabled | set to 1 to get the full debug output (logread -e "trm-") |
| trm_iface | -, not set | uplink- and procd trigger network interface, configured by the 'Interface Wizard' |
+| trm_laniface | -, lan | logical LAN network interface, default is 'lan' |
| trm_radio | -, not set | restrict travelmate to a single radio or change the overall scanning order ('radio1 radio0') |
| trm_scanmode | -, active | send active probe requests or passively listen for beacon frames with 'passive' |
| trm_captive | 1, enabled | check the internet availability and handle captive portal redirections |
| trm_netcheck | 0, disabled | treat missing internet availability as an error |
-| trm_proactive | 1, enabled | proactively scan and switch to a higher prioritized uplink, despite of an already existing connection |
+| trm_proactive | 0, disabled | proactively scan and switch to a higher prioritized uplink, despite of an already existing connection |
| trm_autoadd | 0, disabled | automatically add open uplinks like hotel captive portals to your wireless config |
| trm_randomize | 0, disabled | generate a random unicast MAC address for each uplink connection |
| trm_triggerdelay | 2 | additional trigger delay in seconds before travelmate processing begins |
| trm_maxwait | 30 | how long should travelmate wait for a successful wlan uplink connection |
| trm_timeout | 60 | overall retry timeout in seconds |
| trm_maxautoadd | 5 | limit the max. number of automatically added open uplinks. To disable this limitation set it to '0' |
-| trm_captiveurl | http://detectportal.firefox.com | pre-configured provider URLs that will be used for connectivity- and captive portal checks |
+| trm_captiveurl | http://detectportal.firefox.com | custom/pre-configured provider URLs that will be used for connectivity- and captive portal checks |
| trm_useragent | Mozilla/5.0 ... | pre-configured user agents that will be used for connectivity- and captive portal checks |
| trm_nice | 0, normal priority | change the priority of the travelmate background processing |
| trm_mail | 0, disabled | sends notification e-mails after every succesful uplink connect |
<pre><code>
root@2go:~# /etc/init.d/travelmate status
::: travelmate runtime information
- + travelmate_status : connected (net ok/51)
- + travelmate_version : 2.1.1
- + station_id : radio0/403 Forbidden/00:0C:46:24:50:00
- + station_mac : 94:83:C4:24:0E:4F
- + station_interfaces : trm_wwan, wg0
- + wpa_flags : sae: ✔, owe: ✔, eap: ✔, suiteb192: ✔
- + run_flags : captive: ✔, proactive: ✔, netcheck: ✘, autoadd: ✘, randomize: ✔
- + ext_hooks : ntp: â\9c\94, vpn: â\9c\94, mail: ✘
- + last_run : 2023.10.21-14:29:14
- + system : GL.iNet GL-A1300, OpenWrt SNAPSHOT r24187-bb8fd41f9a
+ + travelmate_status : connected (net ok/96)
+ + travelmate_version : 2.2.1-r1
+ + station_id : radio0/GlutenfreiVerbunden/-
+ + station_mac : 1E:24:62:C3:2E:4B
+ + station_interfaces : trm_wwan, -
+ + station_subnet : 10.168.20.0 (lan: 10.168.1.0)
+ + run_flags : scan: passive, captive: ✔, proactive: ✔, netcheck: ✘, autoadd: ✘, randomize: ✔
+ + ext_hooks : ntp: â\9c\94, vpn: â\9c\98, mail: ✘
+ + last_run : 2025.10.18-21:03:41
+ + system : Cudy TR3000 v1, mediatek/filogic, OpenWrt SNAPSHOT r31445-2a44808374
</code></pre>
To debug travelmate runtime problems, please always enable the 'trm\_debug' flag, restart Travelmate and check the system log afterwards (_logread -e "trm-"_)
trm_enabled="0"
trm_debug="0"
trm_iface=""
+trm_laniface=""
trm_captive="1"
trm_proactive="0"
trm_vpn="0"
config_load network
config_foreach f_getvpn "interface"
fi
- f_log "debug" "f_env ::: auto_sta: ${trm_opensta:-"-"}, sys_ver: ${trm_sysver}"
+ f_log "debug" "f_env ::: fetch: ${trm_fetchcmd}, sys_ver: ${trm_sysver}"
}
# trim helper function
"${trm_wificmd}" reload
for radio in ${trm_radiolist}; do
- while true; do
+ while :; do
if [ "${timeout}" -ge "${trm_maxwait}" ]; then
break 2
fi
fi
fi
fi
- f_log "debug" "f_ctrack ::: action: ${action:-"-"}, uplink_config: ${trm_uplinkcfg:-"-"}"
+ f_log "debug" "f_ctrack ::: uplink_config: ${trm_uplinkcfg:-"-"}, action: ${action:-"-"}"
}
# get openvpn information
fi
cnt="$((cnt + 1))"
done
- f_log "debug" "f_getcfg ::: status: ${status}, section: ${section}, uplink_config: ${trm_uplinkcfg:-"-"}"
+ f_log "debug" "f_getcfg ::: uplink_config: ${trm_uplinkcfg:-"-"}"
}
# get travelmate option value in 'uplink' sections
result="$(uci_get "travelmate" "${trm_uplinkcfg}" "${t_option}")"
printf "%s" "${result}"
fi
- f_log "debug" "f_getval ::: option: ${t_option:-"-"}, result: ${result:-"-"}, uplink_config: ${trm_uplinkcfg:-"-"}"
+ f_log "debug" "f_getval ::: uplink_config: ${trm_uplinkcfg:-"-"}, option: ${t_option:-"-"}, result: ${result:-"-"}"
}
# set 'wifi-device' sections
trm_stalist="$(f_trim "${trm_stalist} ${section}-${radio}")"
fi
fi
- f_log "debug" "f_setif ::: enabled: ${enabled}, section: ${section}, active_sta: ${trm_activesta:-"-"}, uplink_config: ${trm_uplinkcfg:-"-"}"
+ f_log "debug" "f_setif ::: uplink_config: ${trm_uplinkcfg:-"-"}, section: ${section}, enabled: ${enabled}, active_sta: ${trm_activesta:-"-"}"
+}
+
+# check router/uplink subnet
+#
+f_subnet() {
+ local lan lan_net wan wan_net
+
+ network_flush_cache
+ network_get_subnet wan "${trm_iface:-"trm_wwan"}"
+ [ -n "${wan}" ] && wan_net="$("${trm_ipcalccmd}" "${wan}" | "${trm_awkcmd}" 'BEGIN{FS="="}/NETWORK/{printf "%s",$2}')"
+ network_get_subnet lan "${trm_laniface:-"lan"}"
+ [ -n "${lan}" ] && lan_net="$("${trm_ipcalccmd}" "${lan}" | "${trm_awkcmd}" 'BEGIN{FS="="}/NETWORK/{printf "%s",$2}')"
+ if [ -n "${lan_net}" ] && [ -n "${wan_net}" ] && [ "${lan_net}" = "${wan_net}" ]; then
+ f_log "info" "uplink network '${wan_net}' conflicts with router LAN network, please adjust your network settings"
+ fi
+ printf "%s" "${wan_net:-"-"} (lan: ${lan_net:-"-"})"
+ f_log "debug" "f_subnet ::: lan_net: ${lan_net:-"-"}, wan_net: ${wan_net:-"-"}"
}
# add open uplinks
fi
fi
printf "%s" "${result}"
- f_log "debug" "f_net ::: fetch: ${trm_fetchcmd}, timeout: $((trm_maxwait / 6)), cp (json/html/js): ${json_cp:-"-"}/${html_cp:-"-"}/${js_cp:-"-"}, result: ${result}, error (rc/msg): ${json_ec}/${err_msg:-"-"}, url: ${trm_captiveurl}"
+ f_log "debug" "f_net ::: timeout: $((trm_maxwait / 6)), cp (json/html/js): ${json_cp:-"-"}/${html_cp:-"-"}/${js_cp:-"-"}, result: ${result}, error (rc/msg): ${json_ec}/${err_msg:-"-"}, url: ${trm_captiveurl}"
}
# check interface status
if [ "${trm_ifstatus}" = "true" ]; then
result="$(f_net)"
if [ "${trm_captive}" = "1" ]; then
- while true; do
+ while :; do
cp_domain="$(printf "%s" "${result}" | "${trm_awkcmd}" -F '['\''| ]' '/^net cp/{printf "%s",$4}')"
if [ -x "/etc/init.d/dnsmasq" ] && [ -f "/etc/config/dhcp" ] &&
[ -n "${cp_domain}" ] && ! uci_get "dhcp" "@dnsmasq[0]" "rebind_domain" | "${trm_grepcmd}" -q "${cp_domain}"; then
json_add_string "station_id" "${sta_radio:-"-"}/${sta_essid:-"-"}/${sta_bssid:-"-"}"
json_add_string "station_mac" "${sta_mac:-"-"}"
json_add_string "station_interfaces" "${sta_iface:-"-"}, ${vpn_iface:-"-"}"
+ json_add_string "station_subnet" "$(f_subnet)"
json_add_string "run_flags" "scan: ${trm_scanmode}, captive: $(f_char ${trm_captive}), proactive: $(f_char ${trm_proactive}), netcheck: $(f_char ${trm_netcheck}), autoadd: $(f_char ${trm_autoadd}), randomize: $(f_char ${trm_randomize})"
json_add_string "ext_hooks" "ntp: $(f_char ${ntp_done}), vpn: $(f_char ${vpn_done}), mail: $(f_char ${mail_done})"
json_add_string "last_run" "${last_date}"
trm_ipcmd="$(f_cmd ip)"
trm_iwcmd="$(f_cmd iw)"
trm_wpacmd="$(f_cmd wpa_supplicant)"
+trm_ipcalccmd="$(f_cmd ipcalc.sh)"
# get travelmate version
#
# control travelmate actions
#
-while true; do
+while :; do
if [ "${trm_action}" = "stop" ]; then
if [ -s "${trm_pidfile}" ]; then
f_log "info" "travelmate instance stopped ::: action: ${trm_action}, pid: $(cat ${trm_pidfile} 2>/dev/null)"
f_main
trm_action=""
fi
- while true; do
+ while :; do
sleep "${trm_timeout}" 0
rc="${?}"
if [ "${rc}" != "0" ]; then