Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
f5215002
Commit
f5215002
authored
17 years ago
by
Mike Perry
Browse files
Options
Downloads
Patches
Plain Diff
Add README section to Linux Tor traffic prioritization script. svn:r14154
parent
a9d12ac8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/linux-tor-prio.sh
+47
-3
47 additions, 3 deletions
contrib/linux-tor-prio.sh
with
47 additions
and
3 deletions
contrib/linux-tor-prio.sh
+
47
−
3
View file @
f5215002
#!/bin/bash
# Written by Marco Bonetti & Mike Perry
# Based on instructions from Dan Singletary's ADSL B
andwidth
Management HOWTO
# Based on instructions from Dan Singletary's ADSL B
W
Management HOWTO
:
# http://www.faqs.org/docs/Linux-HOWTO/ADSL-Bandwidth-Management-HOWTO.html
# This script is Public Domain.
############################### README #################################
# This script provides prioritization of Tor traffic below other
# traffic on a Linux server. It has two modes of operation: UID based
# and IP based. The UID based method requires that Tor be launched from
# a specific user ID. The "User" and "Group" Tor config settings are
# insufficient, as they set the UID after the socket is created.
# Here is a three line C wrapper you can use to execute Tor and drop
# privs to UID 501 before it creates any sockets. Change the UID
# to the UID for your tor server user, and compile with
# 'gcc tor_wrap.c -o tor_wrap':
# #include <unistd.h>
# int main(int argc, char **argv) {
# if(setresuid(501, 501, 501) == -1) { perror("setresuid"); return 1; }
# execl("/bin/tor", "/bin/tor", "-f", "/etc/tor/torrc", NULL);
# perror("execl"); return 1;
# }
# The IP setting requires that a separate IP address be dedicated to Tor.
# Your Torrc should be set to bind to this IP for "OutboundBindAddress",
# "ListenAddress", and "Address".
# You should also tune the individual connection rate parameters below
# to your individual connection. In particular, you should leave *some*
# minimum amount of bandwidth for Tor, so that Tor users are not
# completely choked out when you use your server's bandwidth. 30% is
# probably a polite choice.
# To start the shaping, run it as:
# ./linux-tor-prio.sh
# To get status information (useful to verify packets are getting marked
# and prioritized), run:
# ./linux-tor-prio.sh status
# And to stop prioritization:
# ./linux-tor-prio.sh stop
########################################################################
# BEGIN USER TUNABLE PARAMETERS
DEV
=
eth0
...
...
@@ -27,7 +68,10 @@ RTT_LATENCY=40
RATE_UP
=
5000
# RATE_UP_TOR is the minimum speed your Tor connections will have.
# They will have at least this much bandwidth for upload
# They will have at least this much bandwidth for upload. In general,
# you probably shouldn't set this too low, or else Tor users who use
# your node will be completely choked out whenever your machine
# does any other network activity. That is not very fun.
RATE_UP_TOR
=
1500
# RATE_UP_TOR_CEIL is the maximum rate allowed for all Tor trafic
...
...
@@ -38,7 +82,7 @@ CHAIN=OUTPUT
#CHAIN=POSTROUTING
MTU
=
1500
AVG_PKT
=
900
AVG_PKT
=
900
# should be more like 600 for non-exit nodes
# END USER TUNABLE PARAMETERS
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment