Realm Host V2 Ha Tunnel Best (2026)
[log] level = "info" output = "/var/log/realm.log" [network] no_delay = true keep_alive = 15
while true; do if check_endpoint $PRIMARY; then echo "Primary is healthy." # Route all traffic through primary's listening port iptables -t nat -D OUTPUT -p tcp --dport 1080 -j REDIRECT 2>/dev/null iptables -t nat -A OUTPUT -p tcp --dport 1080 -j REDIRECT --to-port 1080 else echo "Primary DOWN! Failing over to secondary." iptables -t nat -D OUTPUT -p tcp --dport 1080 -j REDIRECT 2>/dev/null iptables -t nat -A OUTPUT -p tcp --dport 1080 -j REDIRECT --to-port 1081 fi sleep 5 done realm host v2 ha tunnel
Start the service:
[log] level = "info" [network] no_delay = true [[endpoints]] listen = "127.0.0.1:1080" # Local SOCKS5 or HTTP proxy remote = "ha-node-01.example.com:8443" [log] level = "info" output = "/var/log/realm
systemctl enable realm systemctl start realm The client’s configuration is where the "HA Tunnel" magic happens. Realm Host V2 does not natively have a "HA" keyword, but you can achieve this using multiple remote entries and a companion script. do if check_endpoint $PRIMARY