IP or adapter binding

All your suggestions, requests and ideas for future development
Post Reply
User avatar
Wolfie
Posts: 114
Joined: 27 Oct 2015, 02:59

IP or adapter binding

Post by Wolfie »

Hopefully this is something easy to implement, but a command line option to bind to a specific IP address (or to a specific network adapter). I have two IP addresses, and when the traffic is routed through one, everything is great. But if routed through the other, it often has trouble connecting to resources like TheTVDb. So if I could pass an option that would force FileBot to latch onto a specific IP address, then I could assign it to the one that will almost always work (barring other circumstances that is).
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: IP or adapter binding

Post by rednoah »

I have absolutely no idea if that's even possible. Maybe there's Java System Properties for that? Maybe it's something that the OS can force for each process separately?
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 114
Joined: 27 Oct 2015, 02:59

Re: IP or adapter binding

Post by Wolfie »

Forcing it on a Windows OS requires a third party product, which in turn could lead to more problems. If it could somehow be built into FileBot, then anyone needing to make use of it wouldn't face the frustration of reporting an issue here, only to be told the issue is with the other program, and vice-versa, only to possibly find out that the issue wasn't software related at all, or that there was something else going on.

I know uTorrent can do it, but then again, that's a different beast altogether. If it can't be done (either at all, or not within a reasonable amount of effort), then oh well, was worth a try.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: IP or adapter binding

Post by rednoah »

I've had a look. Short answer, the default Java network stack that is used all over FileBot doesn't support selecting a specific network interface.

The easiest solution might be running a local proxy that allows you to configure the outgoing NIC. Its extra software, but proxy software is pretty straight-forward and I imagine that it would work quite well.
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 114
Joined: 27 Oct 2015, 02:59

Re: IP or adapter binding

Post by Wolfie »

If you ever decide to rewrite FB, be sure to use your own network functions, even if those just end up calling the default functions. :D lol
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: IP or adapter binding

Post by rednoah »

I never read up on how this stuff work. I wonder how Java or the OS decide which NIC to use for a given socket connect. Some docs say that the OS does what it wants and the application layer has not control, at least on Linux.

Is to possible to have different DNS for different NIC?
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 114
Joined: 27 Oct 2015, 02:59

Re: IP or adapter binding

Post by Wolfie »

Each NIC is treated individually when it comes to IP, subnets, DNS, etc., and settings on one don't have to mirror the settings of another.

uTorrent is able to control it, so the application does have some way of controlling it, just not sure how. Sounds like it isn't something easy to do so I'm not worried about it.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: IP or adapter binding

Post by rednoah »

If you can block domains on one NIC and not another NIC then I guess you could maybe force the OS which one to use depending on target domain. IDK. Pure conjecture.

Or maybe some iptables magic that force packets onto a specific NIC depending on the target host or process name (no idea if possible).
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 114
Joined: 27 Oct 2015, 02:59

Re: IP or adapter binding

Post by Wolfie »

Does FB use any specific ports (other than 80) for doing stuff? Blocking a domain via one connection I believe would only result in a failure to connect, not force the OS to try a different connection. On Windows, in the connection settings, one can control the default interface to use by changing the metric value. The lowest value (assuming no two have the same value) wins the connection. So if I have two connections, one with a metric of 50 and the other 100, then the 50 metric connection is the default one that gets used. If they are both the same, then I don't know how it's handled. It's one way of using a regular connection and a VPN, and then having certain applications (that have the option available) always use a specific connection, while everything else uses the other one. In this case, uTorrent on VPN, default on the regular connection. Ideally, everything on VPN, except for FileBot and maybe a couple of other apps that don't work well with the VPN connection.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: IP or adapter binding

Post by rednoah »

FileBot uses only HTTP(S) so it should only ever need ports 80 or 443.
:idea: Please read the FAQ and How to Request Help.
Post Reply