http://www.imperialviolet.org/binary/make-private-tor-network.py
It follows the steps at
http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#OwnTorNetwork
but it's a lot quicker than doing it by hand for many nodes.
usage: make-private-tor-network.py [options]
options:
-h, --help show this help message and exit
-b BINARY, --tor-binary=BINARY
location of the tor binary
-n BASENAME, --base-name=BASENAME
base name of the directories and nicknames of the
nodes
--base-port=BASEPORT lower most port number to start assigning from
-d NUM_DIRSERVERS, --num-dirservers=NUM_DIRSERVERS
number of dirservers
-o NUM_NODES, --num-nodes=NUM_NODES
number of non-dirserver nodes
-e EXTRACONFIG, --extra-config=EXTRACONFIG
location of a file which is appended onto the
generated configs
-p BASEPATH, --path=BASEPATH
the path in which to create the directories
The output is a script to start the network which can either be put in
a file or pasted into the console:
% python make-private-tor-network.py -b ./tor -e extra-config -o 10 -d 2
./tor -f ./nodeD0/torrc & # or: 3000, dir: 3001, socks: 3002
./tor -f ./nodeD1/torrc & # or: 3003, dir: 3004, socks: 3005
./tor -f ./nodeN2/torrc & # or: 3006, dir: 3007, socks: 3008
./tor -f ./nodeN3/torrc & # or: 3009, dir: 3010, socks: 3011
./tor -f ./nodeN4/torrc & # or: 3012, dir: 3013, socks: 3014
./tor -f ./nodeN5/torrc & # or: 3015, dir: 3016, socks: 3017
./tor -f ./nodeN6/torrc & # or: 3018, dir: 3019, socks: 3020
./tor -f ./nodeN7/torrc & # or: 3021, dir: 3022, socks: 3023
./tor -f ./nodeN8/torrc & # or: 3024, dir: 3025, socks: 3026
./tor -f ./nodeN9/torrc & # or: 3027, dir: 3028, socks: 3029
./tor -f ./nodeN10/torrc & # or: 3030, dir: 3031, socks: 3032
./tor -f ./nodeN11/torrc & # or: 3033, dir: 3034, socks: 3035
AGL