Contains mappings between network destinations and SOCKSv5 servers.
The /etc/socks5c.conf file contains basic mappings between network destinations (hosts or networks) and SOCKSv5 servers to use when accessing those destinations. This is an ASCII file that contains records for server mappings. Text following a pound character ('#') is ignored until the end of line. Each record appears on a single line and is the following format:
<destination>[/<prefixlength>] <server>[:<port>]
You must separate fields with whitespace. Records are separated by new-line characters. The fields and modifiers in a record have the following values:
Item | Description |
---|---|
destination | Specifies a network destination; destination may be either a name fragment or a numeric address (with optional prefixlength). If destination is an address, it may be either IPv4 or IPv6. |
prefixlength | If specified, indicates the number of leftmost (network order) bits of an address to use when comparing to this record. Only valid if destination is an address. If not specified, all bits are used in comparisons. |
server | Specifies the SOCKSv5 server associated with destination. If server is "NONE" (must be all uppercase), this record indicates that target addresses matching destination should not use any SOCKSv5 server, but rather be contacted directly. |
port | If specified, indicates the port to use when contacting server.
If not specified, the default of 1080 is assumed. Note: Server address
in IPv6 format must be followed by a port number.
|
If a name fragment destination is present in /etc/socks5c.conf, all target addresses is SOCKSv5 operations will be converted into hostnames for name comparison (in addition to numeric comparisons with numeric records). The resulting hostname is considered to match if the last characters in the hostname match the specified name fragment.
When using this configuration information to determine the address of the appropriate SOCKSv5 server for a target destination, the "best" match is used. The "best" match is defined as:
Item | Description |
---|---|
destination is numeric | Most bits in comparison (i.e. largest prefixlength) |
destination is a name fragment | Most characters in name fragment. |
When both name fragment and numeric addresses are present, all name fragment entries are "better" than numeric address entries.
Two implicit records:
0.0.0.0/0 NONE #All IPv4 destinations; no associated server.
::/0 NONE #All IPv6 destinations; no associated server.
are assumed as defaults for all destinations not specified in /etc/socks5c.conf.
Access Control: This file should grant read (r) access to all users and grant write (w) access only to the root user.
#Sample socks5c.conf file
9.0.0.0/8 NONE #Direct communication with all hosts in the 9 network.
129.35.0.0/16 sox1.austin.ibm.com
ibm.com NONE #Direct communication will all hosts matching "ibm.com" (e.g. "aguila.austin.ibm.com")