Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any config option to disable public network connection? #24

Closed
schemacs opened this issue Aug 12, 2015 · 2 comments
Closed

Is there any config option to disable public network connection? #24

schemacs opened this issue Aug 12, 2015 · 2 comments

Comments

@schemacs
Copy link

I want to do file sharing in the local private network, and don't want to even receive any piece of data from the public network, is there any config to do this?

@anacrolix
Copy link
Owner

You can use the IPBlocklist option in Config, http://godoc.org/github.com/anacrolix/torrent#Config. Set IP ranges that block everything you don't want. There are only a few private network ranges in IPv4, so it should only take a few ranges. Or you could just block all the ranges you're not interested in. Here's an example based on common ranges:

Public network:0.0.0.0-9.255.255.255
Public network:11.0.0.0-126.255.255.255
Public network:128.0.0.0-192.167.255.255
Public network:192.169.0.0-255.255.255.255

This would allow 10/8, 127/8, 192.168/16. You could create this using http://godoc.org/github.com/anacrolix/torrent/iplist#NewFromReader, see the tests for examples: https://github.com/anacrolix/torrent/blob/master/iplist/iplist_test.go#L14.

See https://en.wikipedia.org/wiki/Reserved_IP_addresses

There's also the Config.DisableIPv6 option, if you don't want to have to deal with IPv6.

@anacrolix
Copy link
Owner

Can I get your thoughts on this? A few people have mentioned the use of this project for private clouds. Perhaps a config option/pull-request/supplementary package is in order to facilitate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants