Mercurial > hg > anonet-resdb
changeset 557:f87ef378a4b7 draft
Merge commit 'd77fe67241fbd06ff21961e763790fc2082ff5f5'
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Thu, 14 Jul 2011 20:11:41 +0000 |
parents | 4dc5e973698f (current diff) 09cf0812d89d (diff) |
children | 715d71f7a556 |
files | |
diffstat | 2 files changed, 19 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/peer2anonet/README Thu Jul 14 20:02:25 2011 +0000 +++ b/contrib/peer2anonet/README Thu Jul 14 20:11:41 2011 +0000 @@ -16,7 +16,7 @@ nc -l 1337 | peer2anonet # Send a netcat pipe: - nc 1337 192.168.1.0 < autoconfig.txt + nc 192.168.1.0 1337 < autoconfig.txt DESCRIPTION: peer2anonet is an autoconfiguration utility to easily establish a @@ -73,14 +73,23 @@ anon <--your peer's alias 11.22.33.44 <--your peer's remote ip 3.5.7.9 <--your peer's anonet ip -3571 <--your peer's client port 3570 <--your peer's asn 3c6e0b8a9c15224a8228b9a98ca1531d <--your peer's public key ================== Not Actual Line on File ============================ At your discretion, you may exclude the public key from the bottom of an autoconfig file and post installation of your new - peer service, peer2anonet will prompt for it. + peer service, peer2anonet will prompt for it. PLEASE NOTE: + peer2anonet will set client ports for peering as: + + #REMOTE: + 2<last four of your asn>. + + #LOCAL: + 2<last four of your peer's asn>. + + If you need to change the ports, go to: + /services/$PEERNAME/run and change the values. CHANGES: @@ -132,6 +141,9 @@ data pertaining to his/her system in order for you to configure a new peering session, or vice versa. + Thu Jul 14 09:09:07 CDT 2011 - d3v1150m471c + * client local/remote ports simplified using peers' asn's. + see above for details.
--- a/contrib/peer2anonet/peer2anonet Thu Jul 14 20:02:25 2011 +0000 +++ b/contrib/peer2anonet/peer2anonet Thu Jul 14 20:11:41 2011 +0000 @@ -21,14 +21,12 @@ read -p "Enter your peer's name/interface: " PEERNAME read -p "Enter your peer's remote ip: " REMOTEIP read -p "Enter your peer's anonet ip: " PEERIP -read -p "Enter your peer's remote port: " PEERPORT read -p "Enter your peer's asn: " PEERASN read -p "Enter your peer's public key: " PUBKEY ######################################################################### # Do some security checks on variables: TEST[0]=$PEERNAME; TEST[1]=$REMOTEIP; TEST[2]=$PEERIP - TEST[3]=$PEERPORT; TEST[4]=$PEERASN for((X=0;X<=2;X++)); do if [[ $(echo ${TEST[$X]} | tr -d 'a-zA-Z0-9._-' | wc -c) -gt 1 ]]; then @@ -39,9 +37,8 @@ fi done -for((X=4;X<=5;X++)); do -if [[ $(echo ${TEST[$X]} | tr -d '0-9' | wc -c) -gt 1 ]]; then - echo "peer2anonet: fatal error: unacceptable data: ${TEST[$X]} +if [[ $(echo "$PEERASN" | tr -d '0-9' | wc -c) -gt 1 ]]; then + echo "peer2anonet: fatal error: unacceptable data: "$PEERASN" " exit 1 fi @@ -54,7 +51,7 @@ fi ADDPORT="2$(($PEERASN % 10000))" - +REM_PORT="2$(($P2A_ASN % 10000))" ######################################################################### # We need to check if base files need to be imported to services for bird: NEW_PROTOCOL=" @@ -135,7 +132,7 @@ # Create files to configure the new peering session: echo "#!/bin/sh export REMOTE_ADDRESS=$REMOTEIP -export REMOTE_PORT=$PEERPORT +export REMOTE_PORT=$REM_PORT export LOCAL_PORT=$ADDPORT export PRIVATE_KEY=\"\$(cat seckey)\" export PUBLIC_KEY=$PUBKEY