<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>

<title>antinat.xml(4): config file for antinat - Linux man page</title>
<link rel="stylesheet" type="text/css" href="http://static.die.net/style/white.css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<meta name="description" content="This file contains all the configuration information for antinat(1). The file is arranged in XML format and contains 4 sections: core configuration, ...">
</head>

<body bgcolor="#ffffff" text="#333333" link="#660000" vlink="#660000" alink="#000000">
<div id=bg><div id=content>

<!-- google_ad_section_start -->
<h1>antinat.xml(4) - Linux man page</h1>

<h2>Name</h2>
<p>antinat.xml - Configuration file for antinat
<h2>Description</h2>
<div id=adright>
<script type="text/javascript"><!--
google_ad_client = "pub-5823754184406795";
google_ad_slot = "5992934909";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<p>This file contains all the configuration information for <i><b><b><a href="/man/1/antinat">antinat</a></b>(1)</b></i><b>.</b> The file is arranged in XML format and contains 4 sections: core
configuration, authchoice rules, filter rules, and logging configuration. It is strongly advisable that these settings be tailored to your environment.
<p>Core configuration and logging configuration takes the form of a keyword with a single parameter, value, that contains any information needed for that
setting. For example, <b>&lt;port value='1080'/&gt;</b> listens on the default SOCKS port. All configuration information is encapsulated within an
<b>&lt;antinatconfig/&gt;</b> tag.
<h3>Core configuration</h3>
<p>Although defaults will be used where entries are not present, it is a good idea to specify most of the core configuration entries in order to be sure what
antinat will do as future releases may change default behaviour.
<dl compact>
<dt><b>allowlocalusers</b>
<dd>This entry allows the server to authenticate SOCKS users against the local users on the system. Without this option, users must be specified using the
&lt;user/&gt; tag (see below.) <b>IMPORTANT:</b> Because local user passwords are stored in encrypted form, this method of authentication can only be used
where passwords are sent over the network. Currently, therefore, only cleartext authentication can be used to authenticate to local users. In addition, because
antinat will need access to passwords in /etc/shadow, it must be run as root for this feature to work. On Win32, the user running the server must have 'Act as
part of the Operating System' user right. An example of this tag would be
<dt>&lt;allowlocalusers/&gt;
<dt><b>interface</b>
<dd>This entry specifies the IPv4 interface that antinat will listen for requests on. The default value is 0.0.0.0, which will listen on all available
interfaces. If you are operating in a typical environment where only internal users should be able to access the server, set this address to the internal IP
used by your server for maximum security. Connections blocked here also do not require filtration rules to be evaluated. An example of this entry would be
<dt>&lt;interface value='192.168.0.1'/&gt;
<dt><b>maxbindwait</b>
<dd>When an application requests the server to wait for an incoming connection, the server will timeout and close that request if it takes more than a certain
amount of time to receive any connection. This value, in seconds, tells the server how long to keep the listening socket open for before it should fail. The
default value is 60 seconds, which should be appropriate in most circumstances, although it could be made much smaller with higher-bandwidth connections. An
example would be
<dt>&lt;maxbindwait value='10'/&gt;
<dt><b>maxconnsperthread</b>
<dd>In order to reduce the number of threads Antinat uses, a seperate thread is used to forward data from a number of connections. After this value is reached,
a new thread is created. This value refers to concurrent connections; this number of active connections needs to be reached at the same time before a new
thread will be created. This value should be reasonably high unless operating on an SMP machine. On Win32, this feature is not implemented, and this value is
ignored. The default value is 100. An example would be
<dt>&lt;maxconnsperthread value='500'/&gt;
<dt><b>port</b>
<dd>This value tells the server what port to listen on. The default SOCKS port is 1080. Change it if you need to. Example:
<dt>&lt;port value='8080'/&gt;
<dt><b>throttle</b>
<dd>If connection fairness is an issue, each connection can be throttled to only allow through a certain amount of data per second. This value is the bytes per
second that a connection should be throttled to, or zero if no throttling is being used. Throttling is on a per-connection basis only and will not be of much
use if multiple connections are used to circumvent it. This value is the default value for all connections; it can be overriden by filters, which can assign
different throttle values depending on a range of criteria. Only use this option when necessary. Example:
<dt>&lt;throttle value='8192'/&gt;
<dt><b>user</b>
<dd>This entry is used to add a user to the list of users that antinat can authenticate against. You must add users in using this method if you wish to use
CHAP authentication. Each user is given a username and password. If the same user exists in this file as on the local system, and authentication is supported
against the local system, both will be tried in turn, starting with the local system. Example:
<dt>&lt;user user='testuser' password='testpass'/&gt; .SS Chaining configuration</dl>
<p>Chaining configuration is encapsulated within <b>&lt;chain/&gt;</b> tags. Each of these tags must have the <b>name</b> attribute defined to a value so that
the chain can be referenced later on. Chains contain a handful of settings, mostly optional.
<dl compact>
<dt><b>uri</b>
<dd>This is the only mandatory tag within a chain. It specifies the upstream server, in Antinat Client library notation. This follows:
<b>protocol://hostname[:port]</b> where protocol is one of <i>https,</i> socks4, or socks5; and the default port is 1080. Example:
<dt>&lt;uri value='socks5://socks.mycompany.com'/&gt;
<dt><b>authscheme</b>
<dd>This tag can be specified multiple times within each chain section, once for every authentication mechanism that will be supported on this chain. The
default is to support all the schemes that the client library knows about. In SOCKS5, the server ultimately choses the authentication scheme, so order in this
setting is irrelevant. Once one authscheme tag is encountered, only listed schemes will be accepted. Therefore, including a tag which is non-Anonymous will
require connections to be authenticated; including anonymous will require connections to never be authenticated. Valid values for this tag are anonymous,
cleartext and chap. Authentication credentials will be those supplied by the client, unless overridden by the user and password tags; see below. Example:
<dt>&lt;authscheme value='anonymous'/&gt;
<dt><b>password</b>
<dd>This tag will override the credentials supplied by the client with a specified password; these new credentials will be used to authenticate to the upstream
server. Example:
<dt>&lt;password value='foobar'/&gt;
<dt><b>user</b>
<dd>This tag will override the credentials supplied by the client with a specified username; these new credentials will be used to authenticate to the upstream
server. Example:
<dt>&lt;user value='max'/&gt;</dl>
<h3>Logging configuration</h3>
<p>Logging configuration is encapsulated within <b>&lt;log/&gt;</b> tags.
<dl compact>
<dt><b>connlog</b>
<dd>This entry specifies a location to save connection logging information. Connection logging records the date, time, source and destination of successful
connections. As with other logs in antinat, to have integrity preserved antinat must be shutdown cleanly with a SIGQUIT or SIGINT signal. The value parameter
is a file path where connection logging should be sent to. Example:
<dt>&lt;connlog value='/var/log/antinat/connections'/&gt;
<dt><b>addrmonthlog</b>
<dd>This summary log records the amount of data downloaded and uploaded by particular IP addresses, and outputs this information to a log once per month. More
frequent output can result, however, if the server is restarted or stopped. As with other logs, it is important to shut down antinat cleanly with SIGQUIT or
SIGINT, or data loss will result. Example:
<dt>&lt;addrmonthlog value='/var/log/antinat/addrmonth'/&gt;
<dt><b>addrdaylog</b>
<dd>This summary log records the amount of data downloaded and uploaded by particular IP addresses, and outputs this information to a log once per day. More
frequent output can result, however, if the server is restarted or stopped. As with other logs, it is important to shut down antinat cleanly with SIGQUIT or
SIGINT, or data loss will result. Example:
<dt>&lt;addrdaylog value='/var/log/antinat/addrday'/&gt;
<dt><b>addrhourlog</b>
<dd>This summary log records the amount of data downloaded and uploaded by particular IP addresses, and outputs this information to a log once per hour. More
frequent output can result, however, if the server is restarted or stopped. As with other logs, it is important to shut down antinat cleanly with SIGQUIT or
SIGINT, or data loss will result. Example:
<dt>&lt;addrhourlog value='/var/log/antinat/addrhour'/&gt;
<dt><b>addrminutelog</b>
<dd>This summary log records the amount of data downloaded and uploaded by particular IP addresses, and outputs this information to a log once per minute. More
frequent output can result, however, if the server is restarted or stopped. As with other logs, it is important to shut down antinat cleanly with SIGQUIT or
SIGINT, or data loss will result. Example:
<dt>&lt;addrminutelog value='/var/log/antinat/addrminute'/&gt;
<dt><b>usermonthlog</b>
<dd>This summary log records the amount of data downloaded and uploaded by particular users, and outputs this information to a log once per month. If a user
has not been authenticated, the user "Anonymous" is used. More frequent output can result, however, if the server is restarted or stopped. As with other logs,
it is important to shut down antinat cleanly with SIGQUIT or SIGINT, or data loss will result. Example:
<dt>&lt;usermonthlog value='/var/log/antinat/usermonth'/&gt;
<dt><b>userdaylog</b>
<dd>This summary log records the amount of data downloaded and uploaded by particular users, and outputs this information to a log once per day. If a user has
not been authenticated, the user "Anonymous" is used. More frequent output can result, however, if the server is restarted or stopped. As with other logs, it
is important to shut down antinat cleanly with SIGQUIT or SIGINT, or data loss will result. Example:
<dt>&lt;userdaylog value='/var/log/antinat/userday'/&gt;
<dt><b>userhourlog</b>
<dd>This summary log records the amount of data downloaded and uploaded by particular users, and outputs this information to a log once per hour. If a user has
not been authenticated, the user "Anonymous" is used. More frequent output can result, however, if the server is restarted or stopped. As with other logs, it
is important to shut down antinat cleanly with SIGQUIT or SIGINT, or data loss will result. Example:
<dt>&lt;userhourlog value='/var/log/antinat/userhour'/&gt;
<dt><b>userminutelog</b>
<dd>This summary log records the amount of data downloaded and uploaded by particular users, and outputs this information to a log once per minute. If a user
has not been authenticated, the user "Anonymous" is used. More frequent output can result, however, if the server is restarted or stopped. As with other logs,
it is important to shut down antinat cleanly with SIGQUIT or SIGINT, or data loss will result. Example:
<dt>&lt;userminutelog value='/var/log/antinat/userminute'/&gt;</dl>
<h3>Authentication Choice rules</h3>
<p>In SOCKS5, clients connect to the server and provide a list of authentication mechanisms which they can support, and servers choose an authentication
mechanism, then the authentication itself is carried out. Authentiation Choice rules are antinat's approach to how it will select an authentication mechanism.
Rules are traversed, in order, until a <b>&lt;select/&gt;</b> statement is reached that corresponds to a mechanism that the client supports. If there is no
mutually agreeable mechanism, the SOCKS5 connection will fail.
<p><b>&lt;authchoice/&gt;</b> tags can contain three attributes: source_addrtype, source_addr, and source_port. Each of these attributes, and the formats that
they take, are documented below in the "Filters" section. Nested within authchoice tags are <b>&lt;select/&gt;</b> tags, which contain one attribute:
<b>mechanism.</b> Currently, valid mechanisms are anonymous, cleartext, and chap. For example,
<dl compact>
<dt>&lt;authchoice source_addrtype='ipv4'&gt;&lt;authchoice source_addr='192.168.0.0/24'/&gt;&lt;select
mechanism='anonymous'/&gt;&lt;/authchoice&gt;&lt;/authchoice&gt;</dl>
<p>will allow IPv4 connections from within a 192.168.0.x network to use anonymous authentication; no other mechanisms are supported. If clients do not support
anonymous, connections will fail; and no SOCKS5 connection will be negotiated with that is not from 192.168.0.x.
<p>Note in the above example that source_addrtype must preceed source_addr; although IPv4 is currently the only address type that can be specified, different
address types will have different representations and it is necessary to know which type is being used for it to be parsed. The following example extends the
first by supporting CHAP authentication from any IPv4 connection, including outside of 192.168.0.x:
<dl compact>
<dt>&lt;authchoice source_addrtype='ipv4'&gt;&lt;authchoice source_addr='192.168.0.0/24'/&gt;&lt;select mechanism='anonymous'/&gt;&lt;/authchoice&gt;&lt;select
mechanism='chap'/&gt;&lt;/authchoice&gt;</dl>
<p>If clients support anonymous and are within 192.168.0.x, it will be used, and CHAP may be used if it is the only scheme a client supports. By contrast,
outside connections will only be allowed if authenticated with CHAP. If the outside client does not support CHAP, no connection will be allowed.
<h3>Filter rules</h3>
<p>Incoming connections are also filtered on a series of rules. Filters are applied once the full request has been received by the server but before any
connection is made. Filters are the only way to control SOCKS 4 connections, and are only applied if a SOCKS5 client has already passed the authentication
choice rules above. Filters support are parsed in the same way as Authentication Choice rules, except parsing will stop as soon as the first
<b>&lt;accept/&gt;</b> , <b>&lt;reject/&gt;</b> or <b>&lt;chain/&gt;</b> tag is reached. In order to use chaining, the name attribute must be set to the name
of the chain as it was declared in the Chains Section (above.)
<p>Each <b>&lt;filter/&gt;</b> tag can contain a number of attributes, each of which must be true in order to enter the filter and process any other filters
within. If any are false, rules are processed starting immediately after that filter tag. Valid attributes int filter tags are:
<dl compact>
<dt><b>authscheme</b>
<dd>This attribute is used to specify the authentication scheme that was used. Valid schemes are anonymous, cleartext and chap. For SOCKS 4, only anonymous
will ever occur; for SOCKS5, this value is a result of the earlier authentication choice section. Example:
<dt>&lt;filter dest_port='21' authscheme='cleartext'&gt;&lt;chain name='chaplink'/&gt;&lt;/filter&gt;
<dt><b>authsrc</b>
<dd>This attribute is used to specify where the user credentials came from that the user authenticated against. Valid sources are anonymous, config, and local.
This can be used where it is desirable to have local users operate with different authority to config-file users. Example:
<dt>&lt;filter dest_port='110' authsrc='local'/&gt;&lt;accept/&gt;&lt;/filter&gt;
<dt><b>dest_addrtype</b>
<dd>This attribute is used to specify the network protocol that is being requested to fulfil a connection. Valid protocols are ipv4 and ipv6. Note that only
ipv4 has an address filter for it, so allowing ipv6 allows all IPv6 addresses. It is invalid to nest this attribute: if an address type has already been
checked to be a value, it should not be rechecked because it will never change; and conflicting addrtypes would never be parsed. Example:
<dt>&lt;filter dest_addrtype='ipv6'&gt;&lt;reject/&gt;&lt;/filter&gt;
<dt><b>dest_addr</b>
<dd>This attribute is used to specify the address of a machine that a client is wanting to connect to. Currently, this can only be specified as an IPv4
address. It must be preceeded (somewhere in the heirarchy) by a dest_addrtype so that the address can be parsed correctly. In IPv4, a subnet mask can be
specified using the / notation, so that only a partial address match is carried out. Example:
<dt>&lt;filter dest_addrtype='ipv4'&gt;&lt;filter dest_addr='192.168.0.0/16'&gt;&lt;reject/&gt;&lt;/filter&gt;&lt;/filter&gt;
<dt><b>dest_port</b>
<dd>This attribute specifies the numeric destination port that the client wishes to connect to. This can be used to restrict access to only certain services,
or block to specific services. For example:
<dt>&lt;filter dest_port='139'&gt;&lt;reject/&gt;&lt;/filter&gt;
<dt><b>socksop</b>
<dd>SOCKS is capable of performing a range of tasks on behalf of a client. The most common is to set up a connection to a remote host. In addition, SOCKS can
listen for a remote host to contact the server, and forward this connection to an internal client (this is done with ftp.) SOCKS5 can also set up UDP forwards,
and can identify what server is being used remotely. Valid values for this attribute are: connect, bind, udp, and ident. Example:
<dt>&lt;filter socksop='udp'&gt;&lt;reject/&gt;&lt;/filter&gt;
<dt><b>source_addrtype</b>
<dd>This attribute is used to specify the network protocol that a connection originated from. Valid protocols are ipv4 and ipv6. Note that only ipv4 has an
address filter for it, so allowing ipv6 allows all IPv6 addresses. It is invalid to nest this attribute: if an address type has already been checked to be a
value, it should not be rechecked because it will never change; and conflicting addrtypes would never be parsed. Example:
<dt>&lt;filter source_addrtype='ipv6'&gt;&lt;reject/&gt;&lt;/filter&gt;
<dt><b>source_addr</b>
<dd>This attribute is used to specify the address of a machine that is requesting services from antinat. Currently, this can only be specified as an IPv4
address. It must be preceeded (somewhere in the heirarchy) by a source_addrtype so that the address can be parsed correctly. In IPv4, a subnet mask can be
specified using the / notation, so that only a partial address match is carried out. Example:
<dt>&lt;filter source_addrtype='ipv4'&gt;&lt;filter source_addr='131.170.0.0/16'&gt;&lt;accept/&gt;&lt;/filter&gt;&lt;/filter&gt;
<dt><b>source_port</b>
<dd>This attribute specifies the numeric source port that the client is connecting from. This is rarely useful and is provided primarily for symmetry. Clients
generally connect from ephemeral ports, so source ports are typically random. However, this could be used to restrict access to only certain services, or block
to specific services. For example:
<dt>&lt;filter source_port='21'&gt;&lt;reject/&gt;&lt;/filter&gt;
<dt><b>throttle</b>
<dd>This attribute specifies the throttle that connections within this filter block should be limited to. If no value is specified, the previous matching
filter throttle is applied; if there is no previous filter throttle, the global throttle (from core configuration) is applied; if there is no global throttle,
no throttle will be used. Throttling can also be disabled as part of a filter by setting the value to zero. A throttle refers to the bytes per second that a
connection should be limited to. Throttling is on a per-connection basis, and multiple connections could be used to circumvent it. For example:
<dt>&lt;filter user='bob' throttle='4096'&gt;&lt;accept/&gt;&lt;/filter&gt;
<dt><b>user</b>
<dd>This attribute specifies a particular username. It can be used to provide certain users with more access, or to restrict access for those who do not
require more. Where a connection has been made anonymously, the username will always be empty. Example:
<dt>&lt;filter user='root'&gt;&lt;reject/&gt;&lt;/filter&gt;
<dt><b>version</b>
<dd>This attribute can be used to check which version of SOCKS the client is connecting with. Valid values are 4 and 5. Example:
<dt>&lt;filter version='4'&gt;&lt;chain name='socks5link'/&gt;&lt;/filter&gt;</dl>
<h2>See Also</h2>
<p><i><b><a href="/man/1/antinat" rel="nofollow">antinat</a></b>(1)</i>
<h2>Author</h2>
<p>Malcolm Smith &lt;<a href="mailto:malxau@users.sourceforge.net">malxau@users.sourceforge.net</a>&gt;

<!-- google_ad_section_end -->
<div id=adbottom>
<script type="text/javascript"><!--
google_ad_client = "pub-5823754184406795";
google_ad_slot = "8789940313";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


</div>
<div id=menu>

<a href="http://www.die.net/"><img
src="http://static.die.net/style/logo.gif" alt="die.net" width=119 height=121 border=0></a>


<dl><dd>
<form id="cse-search-box-menu" action="http://www.google.com/cse">
<label><a rel="nofollow" href="http://www.die.net/search/">site search</a></label>
<input name="q" type="text" size="10" />
<span style="font-family:Arial, Helvetica, sans-serif; font-size:75%">Google Custom Search</span>
<input type="hidden" name="sa" value="Search" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="hidden" name="cx" value="partner-pub-5823754184406795:54htp1rtx5u" />
<input type="hidden" name="cof" value="FORID:9" />
</form>
<script type="text/javascript">
<!--
document.forms["cse-search-box-menu"].action = "http://www.die.net/search/";
// -->
</script>
</dd></dl>




<dl>
<dt>Library</dt>
<dd><a rel="nofollow" href="http://dictionary.die.net/">online dictionary</a></dd>
<dd><a rel="nofollow" href="http://linux.die.net/">linux docs</a></dd>
<dd><a rel="nofollow" href="http://linux.die.net/man/">linux man pages</a></dd>
<dd><a rel="nofollow" href="http://www.die.net/musings/page_load_time/">page load time</a></dd>
</dl>
<dl>
<dt>Toys</dt>
<dd><a rel="nofollow" href="http://www.die.net/earth/">world sunlight</a></dd>
<dd><a rel="nofollow" href="http://www.die.net/moon/">moon phase</a></dd>
<dd><a rel="nofollow" href="http://trace.die.net/">trace explorer</a></dd>
</dl>


<dl>
<dt><a href="/man/4/"><img src="http://static.die.net/style/back.gif" alt="Back"
width=20 height=22 border=0></a></dt>
</dl>

</div></div>
<script type="text/javascript">
<!--
if (top.location != self.location) top.location = self.location;
if (document.referrer.match(/(search|google\.|yahoo\.|live\.|msn\.|ask\.).*[?&][pq]=[^&]+/)) document.write('<scr'+'ipt src="http://static.die.net/style/highlight.js"><\/scr'+'ipt>');
// -->
</script>
</body>
</html>

