SOCKD.CONF(5) File Formats Manual SOCKD.CONF(5) NAME sockd.conf - Dante server configuration file syntax DESCRIPTION The configuration file for the Dante server controls both access controls and logging. It is divided into three parts; server settings, rules, and routes. Note that server settings must come before rules and routes. A line can be commented out using the standard comment character #. SERVER SETTINGS The server settings control the generic behaviour of the server. Each keyword is separated from its value by a ':' character. The following keywords are available: clientmethod A list of acceptable authentication methods for client-rules, listed in order of preference. These are authentication methods that are to be checked immediately after the SOCKS client has connected to Dante, and before any socks-negotiation has started. Supported values are pam.address, pam.any, none, and rfc931 . For all methods the authentication will be based on solely on the IP-address of the client, possibly in combination with a rfc931 ("ident") lookup towards the host the client is running on. Any credentials provided during this pass will also be available for use in later socks-rules, when the socks-request from the client is evaluated. The default value for this keyword is all methods that may be necessary for the later socks-based authentication methods, as specified as values to the global socksmethod keyword. Normally you should not need to set this keyword, as Dante will set it to the correct value by it self. compatibility With the sameport keyword, the server attempts to use the same port on the server's external side as the client used on the server's internal side. This is normally the default, but when this option is given it will be done with privileged ports also, meaning if a client connects to Dante from a privileged port, Dante will attempt to connect to the target destination from a privileged port too. There can be security issues involved with this, so normally this option should not be set. The draft-5.05 keyword will enable usage of parts of the socks v5-05 draft. The only feature from this draft that Dante supports is the "USECLIENTSPORT" extension. Note that there is a conflicting interpretation of this extension, so enabling it might prevent clients using the conflicting interpretation from working correctly. Only affects UDP. cpu The CPU settings for the various type of Dante processes. Note that the possibility for configuring these settings depend on the platform Dante is running on. Not all platforms may provide support for these type of CPU settings. There are four process types: mother, negotiate, request, and io. The currently supported options are: schedule.: /. Example: cpu.schedule.mother: SCHED_FIFO/20 The above requests that the kernel schedules the mother process(s) using a first- in, first-out policy, at priority 20. The default is to not request any specific scheduling. mask.: [cpu id 1 ...]/any. Example: cpu.mask.mother: any Example: cpu.mask.io: 0 1 The mask gives control over the CPU/cores on which the different process types will run. Specifying the default (all) allows the process type to run on any CPU id. Specifying one or more numeric CPU id limits the process to that set of CPUs. The cpu keywords (schedule and mask) should in most cases not be necessary. If they are to be used, the io processes are where most of the work is done and adjusting the priority or CPU usage is what is likely to have the most significant performance effect client performance and overhead from the server. The other processes are primarily used during connection/session establishment and changes to settings for the non-io process types will primarily affect these operations. The default is to not limit processes to any specific cpu. debug Print debug info to the logs. The value sets the debug level. errorlog This value can be set to receive only error-related logoutput. Note that this does not include client-specific errors, but only more serious "global" errors. The possible values are the same as for the logoutput keyword mentioned below. The intent is to have a special place that only serious errors are logged so that they can discovered quickly. The default is to not have any special place to log errors. external The address to be used for outgoing connections. The address given may be either an IP address or an interface name. Can be given multiple times for different addresses. external.log..error See internal.log..error. This option has an identical syntax and semantics, but applies to error related to the external interface side. external.protocol By default Dante will use the address families specified and available, and there is no need to set this keyword. In some cases the operator may however wish to specify an address in a form that may include more than one address family, yet not wish for Dante to use all the address families available for that address form. This will typically happen if the operator wishes to specify that Dante should use the addresses on a network interface card which has both IPv4 and IPv6 addresses configured, yet the operator wishes Dante to only use one of these two address families. The operator can then specify the address family he wants Dante too look for when expanding the interface name for IP-addresses to use. Valid values for this keyword are: ipv4 and ipv6, indicating that Dante should only use the IPv4 address family or only the IPv6 address family, respectively. The default is to use both families, if available. A corresponding keyword exists for the internal side (see internal.protocol). external.rotation If more than one external address is given, this governs which of the given addresses is selected as the source address for outgoing connections/packets. Note that regardless of which external rotation value is used, all external addresses that are to be used must be listed via the external keyword first. Valid values are none (the default), route, and same-same. none indicates the first address on the list of external addresses should be used. route indicates the kernels routing table should be consulted to find out what the source address for a given destination will be, and might require you to set user.privileged to root. Note that route might create problems for ftp-clients using active ftp if the Dante bind extension is enabled for the ftp-client. same-same indicates the source address for a given destination should be the same address as the Dante server accepted the clients connection on. internal The internal addresses. Connections will only be accepted on these addresses. The address given may be either an IP address or an interface name. internal.log..error Specifies that certain system call failures, listed as symbolic errno values, or certain dns failures, listed as symbolic libresolv failure-codes, should be logged, possibly an extra time, at the log-level log-level. Note that this only applies to errors on the internal interface side only. A corresponding keyword exists for the external side (see external.log). In addition to the standard errno and getaddrinfo(3) error symbols, the following special symbols are accepted: no-route Any error related to no route. dns-any Any error related to DNS/hostname-resolving. system-any Any system error. I.e., any errno value. internal.protocol See external.protocol. This option has an identical syntax and semantics, but applies to the internal interface, for addresses to listen to connections from clients on. libwrap.hosts_access If the server is compiled with libwrap support, determines whether the hosts_access() function should be used for access control. When enabled by setting this value to yes, the libwrap library determines if TCP connections or UDP packets should be immediately dropped or not, typically by consulting /etc/hosts.allow and /etc/hosts.deny. These checks are applied to all traffic, before the rule processing starts. The default value is no (disabled). logoutput This value controls where the server sends logoutput. It can be set to syslog[/facility], stdout, stderr, a filename, or a combination. The default is nowhere. Note that if errorlog is also set, there will be a overlap between what is logged there (errors only), and what will be logged here (errors, and everything else). socksmethod A list of acceptable authentication methods for socks-rules, listed in order of preference. It is thus important that you specify these in the desired order, normally with the more secure methods first. Supported values are bsdauth, gssapi, none, pam.any, pam.address, pam.username, rfc931, and username, If a method is not set in this list it will never be selected. The default is no methods, which means all socks-requests will be blocked. See the section on AUTHENTICATION METHODS for an explanation of the different methods and their meaning. srchost This keyword allows you to configure a few options that relate to the srchost, i.e., the host the Dante server accepts the connections from. With the nodnsmismatch keyword, the server will not accept connections from addresses having a mismatch between DNS IP address and hostname. Default is to accept them. With the nodnsunknown keyword, the server will not accept connections from addresses without a DNS record. Default is to accept them. With the checkreplyauth keyword, the server will check that the authentication on bind-replies and udp-replies matches that which is set in the rule and global socksmethod. Normally, authentication is not desired on replies, as they are replies sent to the socks-clients from non-socks clients, and thus only a limited set of authentication methods are possible. The methods possible for TCP are the the methods not involving the socks protocol in any way, and are listed in the clientmethod section previously mentioned. For UDP-replies, no methods can be used. Default is not to check the authentication on replies. timeout.connect The number of seconds the server will wait for a connect initiated on behalf of the socks-client to complete. The default is 30. Setting it to 0 will use the systems default. timeout.io The number of seconds an established connection can be idle. The default is 0, meaning forever. See also the "-n" option in the sockd(8) manpage. Individual timeouts can be set for TCP and UDP by suffixing io with ".", i.e. timeout.io.tcp or timeout.io.udp. Individual timeouts can also be set within rules, using the same syntax. The timeout set in the rule will then override the default timeouts for clients matching the rule. timeout.negotiate The number of seconds a client can spend negotiating with the Dante server for a socks session before Dante will close the connection to the client. The default is 30. Set it to 0 for forever, though that is strongly discouraged. timeout.tcp_fin_wait The timeout for the equivalent of TCP's FIN-WAIT-2. The default is 0, which means use the systems default (normally, no timeout). udp.connectdst Enables or disables whether the server should attempt connecting UDP sockets to the destination. Valid values are yes and no. The default is yes, which improves UDP performance, but may not be compatible with some UDP-based application protocols as it means the server can only receive packets from the destination address. The socket will only remain connected as long as the client only sends UDP packets to one destination address. If packets are sent to multiple destinations the socket will no longer remain connected and replies can be received from any destination. Userids On platforms providing a privilege-model supported by Dante, the Dante server does not use userid-switching via the seteuid(2) system call. On other platforms, it is prudent to set the userid to be used by the Dante server to appropriate values. The Dante server can use two different userids, or three if compiled with libwrap support. They are as follows: user.privileged Username which will be used for doing privileged operations. If you need special privileges to read the sockd.conf file or to write the sockd.pid file (you can create it manually before starting sockd), have anything in your configuration that requires binding privileged TCP/UDP ports (ports below 1024), or use some sort of password-based authentication, this probably needs to be set to root. If not, you can probably set it to the same value as user.unprivileged. user.unprivileged User which the server runs as most of the time. This should be an id with as little privileges as possible. It is recommended that a separate userid is created for this purpose. user.libwrap User used to execute libwrap commands. Normally this should be the same as user.unprivileged MODULES The following modules are supported by Dante. Modules are purchased separately from Inferno Nettverk A/S and may add extra functionality that is not needed by most users. See the Dante homepage for more information. bandwidth The bandwidth module gives control over how much bandwidth the Dante server uses on behalf of different clients or to different targets. redirect The redirect module gives you control over what addresses the server will use on behalf of the clients, as well as allowing you to redirect client requests to a different addresses. SOCKET OPTIONS The server has support for setting a large number of low-level socket options on both incoming and outgoing traffic. Most users will not need to set any of these options, but some might want to do it, to enable special network features, or to perform various experiments. Options can be set globally as defaults for all traffic, or be set in the access control rules to only affect clients and targets matching the given rule. The socket options that are available vary between platforms, so during configuration and building of the server the options that are available will be determined. Currently, the following options should be detected, when available, for the specified protocol levels: SOCKET so_bindany, so_broadcast, so_debug, so_dontroute, so_jumbo, so_keepalive, so_oobinline, so_priority, so_rcvbuf, so_rcvbufforce, so_rcvlowat, so_sndbuf, so_sndbufforce, so_sndlowat, so_useloopback TCP tcp_cork, tcp_cwnd, tcp_init_cwnd, tcp_keepcnt, tcp_keepidle, tcp_keepintvl, tcp_linger2, tcp_maxrt, tcp_maxseg, tcp_md5sig, tcp_nodelay, tcp_noopt, tcp_nopush, tcp_sack_enable, tcp_stdurg, tcp_syncnt, tcp_window_clamp UDP udp_cork IP ip_auth_level, ip_dontfrag, ip_esp_network_level, ip_esp_trans_level, ip_freebind, ip_ipcomp_level, ip_minttl, ip_mtu_discover, ip_portrange, ip_recvtos, ip_tos, ip_ttl The syntax for setting socket options is as follows: ..