summaryrefslogtreecommitdiff
path: root/contrib/peer2anonet
diff options
context:
space:
mode:
authorpikaj00 <pikaj00@gmail.com>2011-11-04 18:24:42 -0400
committerpikaj00 <pikaj00@gmail.com>2011-11-04 18:24:42 -0400
commitcc9d86bfe813efd7a572ab9655358c99241802dc (patch)
treefc6895b7fcf27d2f5387918b6a9ffa4770626eba /contrib/peer2anonet
parent3b0fe24ce15f0c12f87bcb6d32e48bfdcaa03b64 (diff)
parent3f5b6a9ebe2caa16135a3655d2d9c4e87afa0fe3 (diff)
downloadresdb-cc9d86bfe813efd7a572ab9655358c99241802dc.tar.gz
resdb-cc9d86bfe813efd7a572ab9655358c99241802dc.zip
Merge branch 'master' of git://git1.srn.ano
Diffstat (limited to 'contrib/peer2anonet')
-rw-r--r--contrib/peer2anonet/peer2anonet29
1 files changed, 26 insertions, 3 deletions
diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet
index 64af216..4bbb164 100644
--- a/contrib/peer2anonet/peer2anonet
+++ b/contrib/peer2anonet/peer2anonet
@@ -136,7 +136,15 @@ mkdir -p /services/"$PEERNAME"
#########################################################################
# Create files to configure the new peering session:
echo "#!/bin/sh
+# uncomment if your peer has a dynamic IP
+#
#export REMOTE_FLOAT=1
+
+# uncomment for debugging. you'll need to use ./run to view output instead
+# of svc -u /service/<peer name>
+#
+#export DEBUG=1
+
export REMOTE_ADDRESS=$REMOTEIP
export REMOTE_PORT=$PEERPORT
export LOCAL_PORT=$ADDPORT
@@ -144,11 +152,25 @@ export PRIVATE_KEY=\"\$(cat seckey)\"
export PUBLIC_KEY=$PUBKEY
export TUN_MODE=1
export INTERFACE=ppp-$PEERNAME
+
+# uncomment if you want to nuke your default gateway and configure
+# routes only to peers through IcannNet. If any of your peers use
+# dynamic IP's or you use Tor or i2p then this is probably NOT a
+# good idea. You may need to modify the DEFAULT_ROUTE code below.
+# If you run into problems with this please email d3v11@d3v11.ano
+# so I can create a patch.
+#
+#DEFAULT_ROUTE=\`ip route show | grep default | cut -d' ' -f 3\`
+#route del default gw \$DEFAULT_ROUTE
+#route add \$REMOTE_ADDRESS gw \$DEFAULT_ROUTE
+
( sleep 5;
ip addr add $P2A_IP peer $PEERIP/32 dev \$INTERFACE scope link
ip addr add $P2A_ROUTE/32 dev \$INTERFACE scope global
ip link set dev \$INTERFACE up
- ping -c 1 -I $INTERFACE -r -w 5
+# comment the following ping line to remove pinghack. this is a
+# trick used to help bird connect.
+ ping -c 1 -I \$INTERFACE $PEERIP -r -w 5
) &
exec /usr/sbin/quicktun.nacltai" > /services/"$PEERNAME"/run
chmod +x /services/"$PEERNAME"/run
@@ -161,8 +183,9 @@ echo 'Secret Key Goes Here!' > "/services/$PEERNAME/seckey"
echo "peer2anonet: New peering session configured.
Please place your secret key in: /services/$PEERNAME/seckey
-To allow remote floating:
-uncomment REMOTE_FLOAT=1 in /services/$PEERNAME/run"
+Some additional options are available in /services/$PEERNAME/run
+Please read the comments in the file for details. You may need to
+restart the bird daemon. ie, svc -t /service/bird "