-
Notifications
You must be signed in to change notification settings - Fork 79
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
Tutorial: setting up a Tor bridge for Iran #127
Comments
Maybe it is possible to create the main server outside and forward the traffic only with echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j DNAT --to-destination [foreignVPSip]:443
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source [domesticVPSip] (Note: the amount of incoming and outgoing traffic of the internal server should not be equal) |
Is it at all useful to run a bridge if you do not have a static IP? |
If cloudflared still suitable for DNS service so that evokes up update upon each ip change?
Oct 12, 2022 19:48:36 leoth-91 ***@***.***>:
… Is it at all useful to run a bridge if you do not have a static IP?
I’m running the container but it needs restarting whenever the IP changes (once per day), which I have automatized using cron
—
Reply to this email directly, view it on GitHub[#127 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AKGBAYCNSGADSPBSHPRBRX3WC2QRHANCNFSM6AAAAAAQXWRRYE].
You are receiving this because you are subscribed to this thread.[Tracking image][https://github.com/notifications/beacon/AKGBAYGYZKJOV4US2S5BNUTWC2QRHA5CNFSM6AAAAAAQXWRRYGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSMB2VUE.gif]Message ID: ***@***.***>
|
I'm not sure I understand the sentence but only thing that happens after an IP change is that the container is restarted. Downtime is then around a minute per day, the tor relay search indicates the bridge is running. |
If it's a bridge you use yourself, it's okay because you can change the address at the client yourself. If it's a bridge you want others to use, it's not very useful, because people's connection to the bridge will break whenever its IP address changes, and their saved bridge line will no longer work. |
During network shutdowns in Iran connections inside the country do still work. We can set up a bridge to be reachable from inisde Iran to be used to connect to Tor when there is a network shutdown. We need two servers:
Setting up a bridge in the server outside Iran (SO)
Install docker and docker compose:
https://docs.docker.com/compose/install/
Get the docker-compse.yml file
Edit bridge/.env with the following content:
Start the bridge:
Get it's bridge line:
Test the bridge copying into Tor Browser
Setting up a proxy in the server inside Iran (SI)
SSH
We can use ssh for this:
x.x.x.x is the IP address of SO
kcptun
kcptun is a network enhancement proxy that tunnel a stream based traffic over a UDP transport protocol.
Download the utility from https://github.com/xtaci/kcptun/releases first, then
run the following command on SO
run the following command on SI
x.x.x.x is the IP address of SO
7923 is the port kcptun listens on
Since kcptun consume more traffic than typical tcp based transport, this transport can reshape traffic, so that it is not obvious that this VPS serves as a forwarder's role. As a side effect the connection quality may be improved with parameter tuning.
Hand out the bridge
Now we can distribute the bridgeline replacing the IP address with the one of SI (y.y.y.y):
The text was updated successfully, but these errors were encountered: