Fallback to localhost for safety reasons. # The IP address reported to the tracker. Method.insert = get_public_ip_address, simple|private, \ # Get public IP address without the need of having dynamic DNS service, also works from behind NAT, through tunnel Schedule2 = print_bind_address, 0, 0, "print = (cat, \"Bind IP: Current interface IPv4addr: \", (network.bind_address))" Print = (cat, "Bind IP: Current interface IPv4addr: ", (network.bind_address)) #print = (cat, "Bind IP: Get def interface IPv4addr: ", (get_interface_ipv4_address,())) # The IP address the listening socket and outgoing connections is bound to. Method.insert = get_interface_ipv4_address, simple|private, \ Print = (cat, "Iface : Default network interface : ", ()) Ifconfig 2>/dev/null | grep -q $bindif 2>/dev/null \ || bindif=`route | grep '^default' | grep -o '*$'` \ "execute.capture_nothrow=sh,-c,\"$cat=\\\"bindif=`getcfg rtorrent bind_interface_name -f /etc/config/nf` \ # To do this we have to figure out an name of interface with IPv4 address to bind to: # Lets bind correct IP address for the listening socket and outgoing connections. If you can explain how you capture ip/adapter, how the settings page works and what you call when the settings page is submitted/saved i can take a look into the logic? Also let me know where the watchdog script is and how it is called and I can help with this feature. Maybe checkboxes that will allow you to choose which adapters are allowed to be bound to, and possibly order? You will still need to test for IP changes but this way it's a bit more explanatory.
In settings, maybe you don't show IP address' but instead use Interface names. This should be able to be done without restarting the app, it will also keep the dropdown in settings having all the correct IP's. If the tunnel ip has changed log new IP and rebind to new internal ip.Ħ. If the tunnel is down or missing stop rtorrent and send alert message.ĥ. While watchdog is checking for daemon, check to see the the internal tunnel IP still exists.Ĥ. Once rtorrent is started or dropdown is changed via settings log IP address & adapter name.ģ. This way there is no leakage if the vpn is either off or the internal IP is changed which forces the bound adapter to default back to "default".Ģ. Have a blacklist of internal IP/Adapters which will never be bound including default route. The external VPN IP changes but so does the internal, this is a very big problem because the internal IP changes the bound address is no good. Also i would like to make it so the daemon has a blacklist which will never allow binding to certain ips/adapters. If so correct the IP file, and also restart daemon with new private IP of new tunnel. While checking the service, determine if the local tun ip has changed. What I propose to do is within the watchdog, determine and save local public IP and current private IP on the tunnel along with the adapter. When the settings are saved I believe it relaunches the daemon with the correct gateway. I am not sure but I believe the text file is used to populate the dropdown in settings.
As of now I see that in the startup sh script it pulls the interfaces and writes to a test file. I will do the work myself but I am not 100% sure of where to look. I would like to know if there is anything currently built-in to help with this behavior or if this behavior can be changed? Furthermore if not can you please give me a brief description of the order of events and what script changes the gateway and where the watchdog script is located. Which as far as i can tell will rebind to the default adapter. This requires a restart on the rtorrent app which will re-populate the dropdown box in settings.
Once the VPN reconnects which can happen a couple times per day the new local network/IP is different. The local network changes on every PIA reconnect via QVPN.