Technical article 112041

Getting started with Network Address Translation (NAT) on OpenServer 5.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

Problem

Getting started with Network Address Translation on SCO OpenServer 5.

Solution

The IP Filter software was included in SCO OpenServer 5.0.6 which includes the ability to translate (NAT) IP address(es) from one address range to another IP address or range of IP addresses. For earlier releases of SCO OpenServer, you will need to install IP Filter which can be obtained from:

https://ftp.scoexpert.com/TLS/tls709.ltr
https://ftp.scoexpert.com/TLS/tls709.tar.Z

A detailed guide on using IP Filter and NAT can be obtained from:

http://www.obfuscation.org/ipf/

The basic syntax of the ipnat command for clearing out current map rules and loading a new map file is:

/etc/ipnat -CF -f <map file>

To view the currently loaded maps/filters and monitor active mappings, use:

/etc/ipnat -l

The following are some map file examples that can be used to provide certain common NAT functionality:

Note: You can have multiple rules set up and NAT will select the first one that applies.

Note: The second map field refers to the interface that we are translating the IP address(es) through (usually the public interface with the valid IP address).

1. Map any traffic coming from the 192.168.1 subnet to 20.20.20.1:

map ppp0 192.168.1.0/24 -> 20.20.20.1/32

2. Map any traffic coming from the 192.168.1 subnet to the dynamic IP assigned to your ppp0 interface:

map ppp0 192.168.1.0/24 -> 0/32

3. Map any traffic coming from 192.168.1 to the dynamic IP assigned to your ppp0 interface and change the source port numbers to something between 10000 and 60000:

map ppp0 192.168.1.0/24 -> 0/32 portmap tcp/udp 10000:60000

4. Map the single IP address 192.168.1.1 to 20.20.20.1:

bimap net0 192.168.1.1/32 -> 20.20.20.1/32

5. Map any traffic coming from the 192.168 subnet to the pool of IP address in the 20.20.20 subnet and change the source port numbers into something between 20000-60000:

map net0 192.168.0.0/16 -> 20.20.20.0/24 portmap tcp/udp 20000:60000

6. Map any tcp traffic from the 192.168 subnet to 20.20.20.1 and change the source port number to something between 10000 and 20000. For all other IP packets, allocate an IP address between 20.20.20.0 and 20.20.20.255:

map net0 192.168.0.0/16 -> 20.20.20.1/32 portmap tcp 10000:20000 map net0 192.168.0.0/16 -> 20.20.20.0/24

NOTES:    Your system must be set up to route packets between its interfaces.
          To verify that this has been done, run the following command:
# inconfig ipforwarding
which should return:

inconfig: symbol ipforwarding has current value 1, minimum 0, maximum 1

If the current value is 0, run the following to enable ipforwarding:

# inconfig ipforwarding 1

Note: Depending on your network configuration, you may also want to enable ICMP redirects (inconfig ipsendredirects 1).

If you configured the system to be a router (Gateway) through the SCOadmin Network Configuration Manager (netconfig), both ipforwarding and ipsendredirects will be enabled.

See also

Manual pages ipnat(ADMN), ipnat(SFF), ipmon(TC), ipf(ADMN),
inconfig(ADMN)
The official IP Filter Web site:
http://coombs.anu.edu.au/~avalon/ip-filter.html

From the Xinuos technical article database, record 112041. Reproduced with permission. The original is at www.sco.com/ta/112041, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.