Reference Manual


setsr - interact with the source route selection mechanism.
setsr [ifn [ip mask main | alt] | delete]


When invoked with only the ifn argument, setsr prints the current Source Route settings for that interface. If no argument is specified, the settings for all Internet interfaces are printed.

Argument ifn can be an Internet interface number, or one of the special interface constants p (Primary interface), a (Auxiliary interface), w (Windows best interface) or ifn (Current interface).

Argument ip is the IP address of a computer to be permitted to use the specified interface. If several computers are to be allowed, a mask can be specified, thus allowing all computers on such a pseudo subnet to communicate via the interface.

The final argument allows an alternate gateway to be used on the specified interface (if such a gateway exists). NAT32 currently supports two gateways (the main gateway and an alt gateway) per Internet interface.

Argument delete removes the details for the specified interface from the current configuration.


% setsr 1 alt
IFN[1] IP: Mask: Subnet: Gateway:

In the above example, the command specifies that all Internet traffic from machines on the private subnet is to be forwarded via the alternate gateway on Interface 1. The new settings are then printed. They show that Internet traffic from any private machine will be forwarded via the gateway, which happens to be the alternate gateway for Interface 1 in this particular case. All Internet traffic from other private machines (and from the Windows TCP/IP stack itself) will be forwarded over Interface 1 via the main gateway, in this particular case.

If several Internet interfaces exist, a setsr command can be issued for each such interface. Note that the Source Routing mechanism overrides the Interface Selection mechanism if enabled.


The term Source Routing is widely used to denote an IP Routing option which allows a list of Nexthop Addresses (gateways) to be specified in the IP Header of a datagram. However, because that list is limited to a maximum of 9 entries (because the IP HLEN field is only a 4-bit quantity), and because of security implications (all packets could be forced to pass through an illicit gateway), Source Routing as described in RFC791 is usually disabled in most IP Routers.

In NAT32, the term Source Routing is used to denote route selection based on both the IP destination and the IP source address of a packet.

The NAT32 Source Routing mechanism can be used in two ways:

netcfg, OpenVPN, sethtx, setis