SlideShare a Scribd company logo
// OnUdpStart
// This script is executed when a, UDP port is opened.
// $listeningPort is the port you specified in "ports" list
// $redirectPort is assigned at runtime when the udp server is started. First
port start at 9501 and is incremented for each server
// $isForward : true if is just port forwarding. False if it's reverse tethering
// $isSocks5 : if reverse tethering, indicate if socks5 must be used.
// all theses variables are read only
//$LogI --------- Script : Udp port start : $listeningPort / $redirectPort
if $isForward then
return
fi
if $isAtRunTime then
return
fi
// reverse tethering
// send specific tcp port (53,...) to TETHER chain
if $isSocks5 = false then
// send udp connection directly to the tunnel (42010+)
$iptables -t nat -A TETHER -o $myInterface -p udp --dport $listeningPort -j
REDIRECT --to $redirectPort
else
// Socks5 mode : redirection is done on redsocks client port : 42001
// redsocks (42001) will communicate with Socks5Server (port 42003) that
return the UdpRelay (42004)
$iptables -t nat -A TETHER -o $myInterface -p udp --dport $listeningPort -j
REDIRECT --to 42001
fi

More Related Content

DOCX
Michael kontopoulos
PPTX
PPTX
C to perl binding
PPTX
PHP TUTORIAL
PDF
Raemon
PPTX
Functuon
PDF
PDF
LLVM Workshop Osaka Umeda, Japan
Michael kontopoulos
C to perl binding
PHP TUTORIAL
Raemon
Functuon
LLVM Workshop Osaka Umeda, Japan

What's hot (7)

PPTX
Cloud Erlang
PPT
Looping in C
PPTX
Licão 12 decision loops - statement iteration
ODP
What's new in Perl 5.10?
PPTX
C++ hello world
PDF
Alex Troush - IEx Cheat Sheet
PDF
3 rd animation
Cloud Erlang
Looping in C
Licão 12 decision loops - statement iteration
What's new in Perl 5.10?
C++ hello world
Alex Troush - IEx Cheat Sheet
3 rd animation
Ad

Viewers also liked (14)

PDF
Les entretiens de la Fabrique : Gaz de schiste, coût du travail, innovation
PPT
SRI orientation
PPTX
MΕΓΑΣ ΑΛΕΞΑΝΔΡΟΣ
DOCX
Resultados encuestas
PPTX
Summer time into learning early literacy story time-2328
DOCX
Livro dificuldades ortograficas 3
PDF
VIVEKANANDH Resume
DOC
Aprendiendo a leer
PPT
EXCEL Y GEOMETRIA ANALITICA
DOCX
2015年度調査1 2次調査完成版(修正)
PDF
HMW - WIRE WOUND RESISTORS CERAMIC ENCASED TYPE
PDF
3. Letra L.
PDF
Design Patterns
PDF
Sota ishii
Les entretiens de la Fabrique : Gaz de schiste, coût du travail, innovation
SRI orientation
MΕΓΑΣ ΑΛΕΞΑΝΔΡΟΣ
Resultados encuestas
Summer time into learning early literacy story time-2328
Livro dificuldades ortograficas 3
VIVEKANANDH Resume
Aprendiendo a leer
EXCEL Y GEOMETRIA ANALITICA
2015年度調査1 2次調査完成版(修正)
HMW - WIRE WOUND RESISTORS CERAMIC ENCASED TYPE
3. Letra L.
Design Patterns
Sota ishii
Ad

Udp scriptstart

  • 1. // OnUdpStart // This script is executed when a, UDP port is opened. // $listeningPort is the port you specified in "ports" list // $redirectPort is assigned at runtime when the udp server is started. First port start at 9501 and is incremented for each server // $isForward : true if is just port forwarding. False if it's reverse tethering // $isSocks5 : if reverse tethering, indicate if socks5 must be used. // all theses variables are read only //$LogI --------- Script : Udp port start : $listeningPort / $redirectPort if $isForward then return fi if $isAtRunTime then return fi // reverse tethering // send specific tcp port (53,...) to TETHER chain if $isSocks5 = false then // send udp connection directly to the tunnel (42010+) $iptables -t nat -A TETHER -o $myInterface -p udp --dport $listeningPort -j REDIRECT --to $redirectPort else // Socks5 mode : redirection is done on redsocks client port : 42001 // redsocks (42001) will communicate with Socks5Server (port 42003) that return the UdpRelay (42004) $iptables -t nat -A TETHER -o $myInterface -p udp --dport $listeningPort -j REDIRECT --to 42001 fi