afclient(1) | General Commands Manual | afclient(1) |
NAME¶
afclient - active port forwarder clientSYNOPSIS¶
afclient [ options ] -n servername -p portnumDESCRIPTION¶
Afclient is a port forwarding program designed to be efficient and easy to use. It connects to afserver to listenport (default listenport is 50126) and after a successful authorization afclient redirects all the data to the specified destination host:port.EXAMPLES¶
afclient -n servername -p 22program connects to servername:50126 and redirects data to local port 22 (becomes a daemon)
the same as above, but verbose mode is enabled (program won't enter daemon mode)
program connects to servername:50126 in remote administration mode
OPTIONS¶
Basic optionsname of the host, where afserver is running (required)
manage port number - server must be listening on it (default: 50126)
the name of this host/remote host - the final destination of the packets (default: the name returned by hostname function)
the port we are forwarding connection to (required)
local machine name for connection with afserver (used to bind socket to different interfaces)
local port name for connection with afserver (used to bind socket to different addressees)
local machine name for connections with destination application (used to bind socket to different interfaces)
display version number
prints help screen
sends the id string to afserver
set the password used for client identification (default: no password)
ignore invalid server's public keys
the name of the file with RSA key (default: client.rsa)
the name of the file with certificate (default: no certificate used)
the name of the file with the configuration for the afclient
the name of the file with stored public keys (default: known_hosts)
format of the date printed in logs (see 'man strftime' for details) (default: %d.%m.%Y %H:%M:%S)
send keepalive packets every N seconds (default: not send keepalive packets)
enable auto-reconnection when afserver is not reachable on start (default: disabled)
enable auto-reconnection after normal afserver quit (default: disabled)
disable auto-reconnection after premature afserver quit (default: enabled)
try N times to reconnect (default: unlimited)
wait N seconds between reconnect tries (default: 5)
udp mode - client will use udp protocol to communicate with the hostname:portnum
reverse udp forwarding. Udp packets will be forwarded from hostname:portnum to the server name:manageport
remote administration mode. (using '-p PORT' will force afclient to use port rather than stdin-stdout)
log choosen information to file/socket
to be verbose - program won't enter the daemon mode (use several times for greater effect)
use ipv4 only
use ipv6 only
load a module for user's packets filtering
load a module for service's packets filtering
use https proxy instead of http proxy
the name of the machine with proxy server
the port used by proxy server (default: 8080)
the user (U) and password (P) used in proxy authorization
the Basic type of proxy authorization (default)
REMOTE ADMINISTRATION¶
Remote administration mode is enabled by '-r, --remoteadmin' option. Required options: '-n, --servername NAME'display help
lists available commands
quit connection
LOGCMD FORMAT¶
LOGCMD has the following synopsis: target,description,msgdescExample:
file,logfile,LOG_T_USER,LOG_T_CLIENT,LOG_I_INFO,LOG_I_NOTICE
MODULES¶
Afclient can use external modules for user's packets filtering ('-l, --load') and service's packets filtering ('-L, --Load'). Module file has to declare three functions:info() return values:
- info about module
Example:
char*
info(void)
{
return "Module tester v0.1";
}
allow() return values:
0 - allow to connect
!0 - drop the connection
Example:
int
allow(char* host, char* port)
{
return 0; /* allow to connect */
}
filter() return values:
0 - allow to transfer
1 - drop the packet
2 - drop the connection
3 - release the module
4 - drop the packet and release the module
5 - drop the connection and release the module
Example:
int
filter(char* host, unsigned char* message, int* length)
{
int i;
for (i = 1; i < *length; ++i) {
if (message[i-1] == 'M') {
if (message[i] == '1') {
return 1; /* ignored */
}
if (message[i] == '2') {
return 2; /* dropped */
}
if (message[i] == '3') {
return 3; /* release */
}
if (message[i] == '4') {
return 4; /* ignored + release */
}
if (message[i] == '5') {
return 5; /* dropped + release */
}
}
}
return 0; /* allow to transfer */
}
SEE ALSO¶
afclient.conf(5), afserver(1), afserver.conf(5)BUGS¶
Afclient is still under development. There are no known open bugs at the moment.REPORTING BUGS¶
Please report bugs to <jeremian [at] poczta.fm>AUTHOR¶
Jeremian <jeremian [at] poczta.fm>CONTRIBUTIONS¶
Alex Dyatlov <alex [at] gray-world.net>, Simon <scastro [at] entreelibre.com>, Ilia Perevezentsev <iliaper [at] mail.ru>, Marco Solari <marco.solari [at] koinesistemi.it>, and Joshua Judson Rosen <rozzin [at] geekspace.com>LICENSE¶
Active Port Forwarder is distributed under the terms of the GNU General Public License v2.0 and is copyright (C) 2003-2007 jeremian <jeremian [at] poczta.fm>. See the file COPYING for details.apf 0.8.4 | Jeremian |