SOCKD.ROUTE(5)

NAME
sockd.route - Routing file for multi-homed SOCKS proxy server

SYNOPSIS
/etc/sockd.route

DESCRIPTION
The file /etc/sockd.route is used by a multi-homed SOCKS server sockd to determine which of its network interfaces it should use to reach a given destination host. A multi-homed host is a host with more than one network interfaces and with its IP_FORWARDING turned off. Only the multi-homed version of sockd can be run on such hosts. Hosts which have a single network interface or that have enabled IP_FORWARDING -- even with multiple network interfaces -- can run the single-homed version of sockd, which requires no use of /etc/sockd.route. A line in the file can be up to 1024 characters long. Lines starting with a `#' are comments. Non-comment lines must be of the form
if_addr    dst_addr  dst_mask
All three fields are required and are separated by spaces or tabs. Each filed is specified in the usual dotted form of IP addresses, e.g., 128.23.16.2. if_addr must be the IP address of one of the network interfaces on the SOCKS server host. The dst_addr dst_mask pair together specify the destination IP address or a range of destination IP addresses. Bits in dst_mask that are set to 0 indicate the bit positions to be ignored during comparison of IP addresses. So, specifying 255.255.255.255 in dst_mask demands an exact match with dst_addr, whereas 0.0.0.0 in dst_mask causes a matching with any given destination address regardless of what is specified for dst_addr. When a multi-homed sockd receives a network request, it first checks with /etc/sockd.conf to decide whether the request should be allowed or denied. For an allowable request, sockd then checks the given destination IP address against the dst_addr dst_mask pair in /etc/sockd.route, one line at a line. Once a match is found, the network interface of the corresponding if_addr field is used for connection to the destination host. Remaining lines in the file are skipped. Therefore the order of the lines in the file is of extreme importance. If no match is found throughout the file, a line indicating the error is produced using syslog with facility daemon and level err and sockd then terminates. The program test_sockd_conf checks /etc/sockd.conf as well as the regular configuration file /etc/sockd.conf. See test_sockd_conf(8).

EXAMPLES
Suppose you have a dual-homed host with interface 129.1.2.3 connecting to your internal Class B network 129.1, and interface 129.1.254.1 connecting to the outside world. If you only use the SOCKS server to provide connections to outside hosts, then the file /etc/sockd.route only needs one line:
129.1.254.1	0.0.0.0  0.0.0.0
If you also use the SOCKS server to provide connection to internal hosts as well, then two lines would suffice:
129.1.2.3	129.1.0.0  255.255.0.0
129.1.254.1	0.0.0.0  0.0.0.0
Note that these two lines must be in the order given above.

SEE ALSO
sockd(8), sockd.route(5), test_sockd_conf(8), socks.conf(5), socks_clients(1)