next up previous contents
Next: Miscellaneous commands Up: Configuration file format Previous: Access control commands

Redirect commands

Redirect commands are of the form:

[on <address>] redirect <address> port <port> to 
   <address> <port> [acl] [delay <num>(s|us|ms)<+<num>(s|us|ms)>]

Where each address is either a host name or an IP number, the ports are port numbers, and the acl is an ACL expression of the same form as one following a global command (ie. allow or deny followed by an address specification).

A preceeding on <address> should be used for multi-homed hosts: clients identify which redirects pertain to them by comparing the redirect address with their host address, as obtained by getaddrbyname(gethostname()) and by examining the dest_address of the IP packet carrying data from server to client. Unfortunately, firewalls and other multi-homed hosts typically have different names on the internal and external networks, so one might easily specify a redirect for which the client connects, looks at the redirect address, discovers that it isn't an address for the default name of this host, and so drops it, despite having a secondary interface bound to the redirect address. You can avoid this problem by putting the default name of the client that should handle a redirect in the address field of an on <address> clause preceeding the redirect.

A delay clause indicates that packets should be delayed at the proxy to give an artifical high ping. The delay specified is additional to the inherent delay of the proxy (see §7). Either one or two components may be specified: if two components are specified, the first is the outgoing delay (from Quake client to Quake server), and the second is the incoming delay (from Quake server to Quake client). Hence, the delay clause below indicates that packets should be delayed by 100ms from client to server, and by 50 from server to client. Thus you can simulate the effects of asymmetric routing.

If only a single delay value is specified, it is divided by two, and the outgoing and incoming delay set to this value (since the pings measured by Quake II are round-trip times).

For example, a redirect of the form:

on 1.2.3.4 redirect 5.6.7.8 port 12000 to 9.10.11.12 port 14000 allow
 13.14.15.16/255.255.0.0 from 13000-18000 delay 100+50

Indicates that a client whose primary hostname is bound to the address 1.2.3.4 should accept packets destined for 5.6.7.8 (which is presumably bound to another interface), on port 12000, and proxy them to the Quake II server 9.10.11.12, port 14000, but only if the machine originating the packets matches the hostname/netmask pair 13.14.15.16/255.255.0.0, and the originating port is between 13000 and 18000 inclusive. All packets proxied will be given an induced delay of 150ms (100ms outgoing, 50ms back), in addition to the delay inherent in the proxy, which will typically result in a ping of about 200.

As with ACL commands, redirect commands are processed in the order given, and the first match is used. A redirect with an ACL which doesn't permit connection by a given Quake II client is treated as if it didn't exist, and the search continues.

If no redirect is found for a packet, the packet is silently dropped.


next up previous contents
Next: Miscellaneous commands Up: Configuration file format Previous: Access control commands
Richard Watts
1998-12-22