HowTo: Bind to a specific network interface

Ask for help and report issues with the Mac OS X version of Transmission
scott451
Posts: 3
Joined: Fri Jan 20, 2012 11:24 pm

Re: HowTo: Bind to a specific network interface

Post by scott451 »

hi,

i've been looking at this same question since i switched to openvpn. i've got things rolling by binding the ip address, but binding to an interface seems so much cleaner.

i hesitate to plunge into building transmission ; does anyone know if the patch from #2313 every made it into a nightly build ? thanks !


- scott
x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: HowTo: Bind to a specific network interface

Post by x190 »

No.

#2313 (comment:99) has got a prebuilt model you can download.
jonny_noog
Posts: 5
Joined: Wed Aug 20, 2014 11:23 am

Re: HowTo: Bind to a specific network interface

Post by jonny_noog »

Sorry to dig up an old thread, but reading through what's here and the related ticket, I was just wondering what the current situation is in relation to exclusively binding Transmission to a specific interface? Would I be correct in assuming this feature has not made it into the standard build of Transmission? If so, are there any plans for this to happen at any point?
x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: HowTo: Bind to a specific network interface

Post by x190 »

Would I be correct in assuming this feature has not made it into the standard build of Transmission?
Yes.
If so, are there any plans for this to happen at any point?
No.
jonny_noog
Posts: 5
Joined: Wed Aug 20, 2014 11:23 am

Re: HowTo: Bind to a specific network interface

Post by jonny_noog »

x190 wrote:
Would I be correct in assuming this feature has not made it into the standard build of Transmission?
Yes.
If so, are there any plans for this to happen at any point?
No.
You're a man of great lingual economy, sir. Thanks for the confirmation.
mbtm
Posts: 7
Joined: Mon Dec 28, 2015 2:42 pm

Re: HowTo: Bind to a specific network interface

Post by mbtm »

Anything new here? It looks like a few people have written patches, but I don't see anything indicating that these patches have been successfully incorporated into any recent builds.
hbwhite
Posts: 18
Joined: Tue Feb 27, 2018 10:55 pm

Re: HowTo: Bind to a specific network interface

Post by hbwhite »

[deleted]
Last edited by hbwhite on Tue Feb 09, 2021 7:13 pm, edited 2 times in total.
fuori
Posts: 2
Joined: Fri Jul 13, 2018 12:25 pm

Re: HowTo: Bind to a specific network interface

Post by fuori »

Hi guys,

I second hbwhite's Clutch, using it now on macOS 10.13.5 and it works like a charm!

Best,
Matt
Marc31
Posts: 47
Joined: Thu Dec 06, 2007 12:01 am

Re: HowTo: Bind to a specific network interface

Post by Marc31 »

Transmission Interface Binder works like a charm since 2015 (the while on macOS Mojave)
rrossorr
Posts: 2
Joined: Tue Feb 19, 2019 11:28 pm

Re: HowTo: Bind to a specific network interface

Post by rrossorr »

The URL to download "Transmission Interface Binder" is broken. I installed Clutch and works great.
davids
Posts: 5
Joined: Thu Feb 28, 2019 1:50 am

Re: HowTo: Bind to a specific network interface

Post by davids »

While Transmission Interface Builder works perfectly, I decided to try Clutch v1.1 because it is IPv6 smart, even though currently only using IPv4. I also like that the Clutch interface can be opened from macOS's status bar and it seems smarter then Transmission Interface Builder in that it doesn't appear to restart Transmission if the VPN has restarted but the IP address of ppp0 is still the same as the one Transmission is already bound too. However, there seems to be a bug in Clutch that causes Transmission to not download when i first reboot my Mac. I have a script on a timer that (re)connects a L2TP tunnel to the VPN if it's not already running that starts the VPN when the computer boots.

If I use Clutch to unbind Transmission from ppp0 and rebind, then Transmission starts downloading. But if I reboot the Mac while everything is working, when it restarts Transmission is again not working. It's odd because Clutch says that it's bound to ppp0 and has the correct IP address.
hbwhite
Posts: 18
Joined: Tue Feb 27, 2018 10:55 pm

Re: HowTo: Bind to a specific network interface

Post by hbwhite »

[deleted]
Last edited by hbwhite on Tue Feb 09, 2021 7:13 pm, edited 2 times in total.
hbwhite
Posts: 18
Joined: Tue Feb 27, 2018 10:55 pm

Re: HowTo: Bind to a specific network interface

Post by hbwhite »

[deleted]
Last edited by hbwhite on Tue Feb 09, 2021 7:13 pm, edited 2 times in total.
davids
Posts: 5
Joined: Thu Feb 28, 2019 1:50 am

Re: HowTo: Bind to a specific network interface

Post by davids »

hbwhite wrote:
If I use Clutch to unbind Transmission from ppp0 and rebind, then Transmission starts downloading. But if I reboot the Mac while everything is working, when it restarts Transmission is again not working. It's odd because Clutch says that it's bound to ppp0 and has the correct IP address.
Hi, I'll look into this tomorrow. After you reboot, does Transmission work if you close it and open it again, or does it only work if you unbind/rebind in Clutch?

Update: I'm guessing here, but I assume the local binding IP for your ppp0 interface is always the same, and therefore Clutch never needs to restart Transmission. Also, there may be a bug in Transmission where it fails if it tries to bind to your ppp0 interface before the interface is ready. If simply restarting Transmission fixes the problem, you may just need to add the commands to restart Transmission at the end of your script.

You are a special case because you're using a custom script, while I think most people are using normal VPN clients.
Call me cautious, but I prefer using macOS's internal VPN capability to having another app running as a service -- but not enough to stop me from running Clutch. :-) You are correct that the IP of my VPN connection does not change. Surprisingly, the IP address stays the same even if I connect to the VPN via a different IP address for the VPN server to which macOS makes the L2TP Over IPSec tunnel.

I just installed Clutch v1.2 and rebooted and Transmission still wasn't working. So I restarted Transmission as you suggested and you were correct that Transmission worked. I watched the Mac booting and it appeared the the order of things starting was (1) Clutch, (2) Transmission and then (3) the VPN. All three are started because they are "Login Items" for my user. Actually, the script below is started by Login Items and it sees that there's no connection to the Newshosting VPN and starts it. As far as I know, there is no way to control the order Login Items are started and all three start essentially simultaneously. The start up order I am seeing probably reflects that it takes less time to launch Clutch than Transmission and connecting to the VPN takes the most time. I could add a restart of Transmission to the script (below), but isn't there still a chance at startup that Transmission starts before Clutch has updated BindAddressIPv4? It would be more reliable if Clutch restarted Transmission if it detects that ppp0 hadn't existed but now does, even if the VPN's IP address hasn't changed. Would your app have a problem with this order and if so could this be an easy fix?

Thank you so much for working on this!

David

on idle
tell application "System Events"
tell current location of network preferences
set myConnection to the service "Newshosting"
if myConnection is not null then
if current configuration of myConnection is not connected then
connect myConnection
end if
end if
end tell
return 120
end tell
end idle
hbwhite
Posts: 18
Joined: Tue Feb 27, 2018 10:55 pm

Re: HowTo: Bind to a specific network interface

Post by hbwhite »

[deleted]
Last edited by hbwhite on Tue Feb 09, 2021 7:12 pm, edited 2 times in total.
Post Reply