Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

Is it possible to limit BitTorrent Sync connections to a a specific network using the client software? Right now the closest I can come up with would be IP limitations imposed on each client using a firewall. This seems like it would work fine, except for if any client somehow ventures outside those firewall restrictions.

share|improve this question

1 Answer 1

If you are using Linux, iptables has a match called "owner" where you can apply certain rules based off the UID or GID of the process sending the data.

For instance:

  • Put the IP's or CIDR network addresses in a file (one entry per line)
  • Create a new user called btsync
  • Run the following:

    #/bin/bash
    
    RESTRICTED_IP_FILE="/some/file"
    
    sudo iptables -N btsync_filter
    sudo iptables -I OUTPUT -m owner --uid-owner btsync -j btsync_filter
    
    while read ip; do 
        [[ -n "$ip" ]] && sudo iptables -A btsync_filter -d $ip -j DROP
    done < $RESTRICTED_IP_FILE
    
    sudo -u btsync btsync
    

This will run btsync as the user btsync and all packets from that process that are going to a restricted IP will be dropped.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.