From e3f0f21369224ab1e5ec2bb5963ef1a04c2e73f0 Mon Sep 17 00:00:00 2001 From: d3v1150m471c Date: Wed, 13 Jul 2011 23:51:17 -0500 Subject: peer2anonet: nc syntax error corrected on README file. --- contrib/peer2anonet/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 58d3b9a..f65a278 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -16,7 +16,7 @@ SYNOPSIS: 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 -- cgit v1.2.3 From 8c6ab5ff8a043883d1e4b36309f4c0c88b9a8cc8 Mon Sep 17 00:00:00 2001 From: d3v1150m471c Date: Thu, 14 Jul 2011 00:16:56 -0500 Subject: peer2anonet: updated the README file regarding peer clientports. --- contrib/peer2anonet/README | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index f65a278..7fb1e56 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -80,7 +80,15 @@ anon <--your peer's alias 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 YOUR local port for peering as: + + 2. + + Therefore, send them the remote port as above, and vice versa. + This helps later when networking to easily identify and debug + problems. If you need to change the ports, go to: + /services/$PEERNAME/run and change the values. CHANGES: -- cgit v1.2.3 From d77fe67241fbd06ff21961e763790fc2082ff5f5 Mon Sep 17 00:00:00 2001 From: d3v1150m471c Date: Thu, 14 Jul 2011 09:12:53 -0500 Subject: peer2anonet: simplified client local/remote ports using asn numbers. --- contrib/peer2anonet/README | 14 +++++++++----- contrib/peer2anonet/peer2anonet | 11 ++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 7fb1e56..ba01657 100644 --- a/contrib/peer2anonet/README +++ b/contrib/peer2anonet/README @@ -73,7 +73,6 @@ USAGE: 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 ============================ @@ -81,13 +80,15 @@ anon <--your peer's alias 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. PLEASE NOTE: - peer2anonet will set YOUR local port for peering as: + peer2anonet will set client ports for peering as: + #REMOTE: + 2. + + #LOCAL: 2. - Therefore, send them the remote port as above, and vice versa. - This helps later when networking to easily identify and debug - problems. If you need to change the ports, go to: + If you need to change the ports, go to: /services/$PEERNAME/run and change the values. @@ -140,6 +141,9 @@ CHANGES: 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. diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index b84d97e..31d0a4a 100644 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -21,14 +21,12 @@ mkdir -p /service 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 @@ echo ${TEST[$X]} | tr -d 'a-zA-Z0-9' | wc -c 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 @@ if [[ $(echo "$PUBKEY" | tr -d 'a-zA-Z0-9' | wc -c) -gt 1 ]]; then 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 @@ mkdir -p /services/"$PEERNAME" # 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 -- cgit v1.2.3