NAT configuration examples

Network scheme for examples 1-2-3-4
Example 1. - Suggest an access from inside workstations to outside networks
Example 2. - Publish an outside server as an inside server
Example 3. - Publish an outside HTTP server as an inside HTTP server
Example 4. - Translation of DNS's requests
Network scheme for example 5
Example 5. - Suggest an access from outside networks to internal servers

NAT port (NAT)


Network scheme for examples 1-2-3-4 top


Example1


Example 1. Suggest an access from inside workstations to outside networks.
Record has added to NAT static table:

------------------------------------------------------------------------------
PR: SIDE: ADD: NET:                   ANET:                SIPP: DIPP: PAT:
               PROT:                  DPO:                 ADPO:
------------------------------------------------------------------------------
0   IN    SRC  192.168.1.0/24         10.0.0.1/32            *     *    YES
               *                      *
------------------------------------------------------------------------------

Example of IP packet translation:

 Source IP addressDestination IP address
Before translation:192.169.1.2:XXX10.0.0.3:ZZZ
After translation:10.0.0.1:YYY10.0.0.3:ZZZ

Comment. For a source address translation has used a record PR:0


Example 2. Suggest an access from inside workstations to outside networks and publish an outside server as an inside server.

In this example we suggest access to the outside server (in this example it is pc4.mynet.com) from inside network.

Records have added to NAT static table:
------------------------------------------------------------------------------
PR: SIDE: ADD: NET:                   ANET:                SIPP: DIPP: PAT:
               PROT:                  DPO:                 ADPO:
------------------------------------------------------------------------------
0   IN    SRC  192.168.1.0/24         10.0.0.1/32            *     *    YES
               *                      *
1   IN    DST  192.168.50.1/32        10.0.0.2/32            *     *    NO 
               *                      *
------------------------------------------------------------------------------

Example of IP packet translation:

 Source IP addressDestination IP address
 Source translation 
Before translation:192.169.1.2:XXX192.168.50.1:YYY
After translation:10.0.0.1:ZZZ192.168.50.1:YYY
 Destination translation 
Before translation:10.0.0.1:ZZZ192.168.50.1:YYY
After translation:10.0.0.1:ZZZ10.0.0.2:YYY

Comment. For a source address translation has used a record PR:0 and for a destination address translation has used a record PR:1


Example 3. Suggest an access from inside workstations to outside networks and publish an outside HTTP server as an inside HTTP server.

In this example we suggest access to the outside HTTP server (in this example it is pc4.mynet.com) from inside network. Now we can use the next URL (Uniform Resource Identifier) "http://192.168.50.1" in our Internet explorer for connect to WWW on pc4.mynet.com.
But we cannot use URL http://pc4.mynet.com yet. See example 4 for more information.

Records have added to NAT static table:

------------------------------------------------------------------------------
PR: SIDE: ADD: NET:                   ANET:                SIPP: DIPP: PAT:
               PROT:                  DPO:                 ADPO:
------------------------------------------------------------------------------
0   IN    SRC  192.168.1.0/24         10.0.0.1/32            *     *    YES
               *                      *
1   IN    DST  192.168.50.1/32        10.0.0.2/32            *     *    YES 
               TCP                    http(80)
------------------------------------------------------------------------------

Example of IP packet translation:

 Source IP addressDestination IP address
 Source translation 
Before translation:192.169.1.2:XXX192.168.50.1:80
After translation:10.0.0.1:YYY192.168.50.1:80
 Destination translation
Before translation:10.0.0.1:YYY192.168.50.1:80
After translation:10.0.0.1:YYY10.0.0.2:80

Comment. For a source address translation has used a record PR:0 and for a destination address translation has used a record PR:1


Example 4. Translation of DNS's requests.

In this example we publish an outside HTTP server (there is 10.0.0.2) as inside (pc4.mynet.com with IP address 192.168.1.2). For allow access to this server NAT must made translation of DNS request which will generate user's Intenet browser. (the Internet browser will make this request when you type URL (Uniform Resource Identifier) "http://pc4.mynet.com" and press "Enter")
For this we must add an additional record in NAT table for translation DNS name.

Records have added to NAT static table:

------------------------------------------------------------------------------
PR: SIDE: ADD: NET:                   ANET:                SIPP: DIPP: PAT:
               PROT:                  DPO:                 ADPO:
------------------------------------------------------------------------------
0   IN    SRC  192.168.1.0/24         10.0.0.1/32            *     *    YES
               *                      *
1   IN    DST  192.168.50.1/32        10.0.0.2/32            *     *    YES 
               TCP                    http(80)
2   OUT   DST  10.0.0.2/32            192.168.50.1/32        *     *    NO 
------------------------------------------------------------------------------

Step 1. Translate DNS request.

 Source IP addressDestination IP addressBody's contents of DNS message.
 Source translation  
Before translation:192.169.1.2:XXXIP address of DNS :53REQ=pc4.mynet.com
After translation:10.0.0.1:YYYIP address of DNS :53REQ=pc4.mynet.com

Comment. For a source address translation has used a record PR:0

Step 2. Translate DNS answer.

 Source IP addressDestination IP addressBody's contents of DNS message.
 DNS massage translation  
Before translation:IP address of DNS :5310.0.0.1:XXXREQ=pc4.mynet.com ASW=10.0.0.2
After translation:IP address of DNS :5310.0.0.1:XXXREQ=pc4.mynet.com ANW=192.168.50.1

Comment. For a DNS answer address translation has used a record PR:2

Step 3. Translate packet with DNS answer.

 Source IP addressDestination IP addressBody's contents of DNS message.
 DNS massage translation  
Before translation:IP address of DNS :5310.0.0.1:XXXREQ=pc4.mynet.com ANW=192.168.50.1
After translation:IP address of DNS :53192.169.1.2:YYYREQ=pc4.mynet.com ANW=192.168.50.1

Comment. For a destination address translation has used a record from NAT dynamic table.

Step 4. Translate HTTP packets.

 Source IP addressDestination IP address
 Source translation 
Before translation:192.169.1.2:XXX192.168.50.1:80
After translation:10.0.0.1:YYY192.168.50.1:80
 Destination translation 
Before translation:10.0.0.1:YYY192.168.50.1:80
After translation:10.0.0.1:YYY10.0.0.2:80

Comment. For a source address translation has used a record PR:0 and for a destination address translation has used a record PR:1


Network scheme for example 5 top


Example2


Example 5. Suggest an access from outside networks to our internal servers.

Goal description. We have just one public IP address and on the internal LAN there are more computers on several IP addresses running the same service with different contents, e.g. a commercial web, a technical web, a restricted access web.

Three our servers have described in outside network (for example Internet) as :
10.0.0.1:80 - a main HTTP server of our company.
10.0.0.1:81 - a HTTP server for technical support.
10.0.0.1:82 - a HTTP server for developers.

Records have added to NAT static table:

------------------------------------------------------------------------------
PR: SIDE: ADD: NET:                   ANET:                SIPP: DIPP: PAT:
               PROT:                  DPO:                 ADPO:
------------------------------------------------------------------------------
0   OUT   DST  10.0.0.1/32            192.168.1.1/32         *     *    YES 
               TCP                    81                   80
1   OUT   DST  10.0.0.1/32            192.168.1.2/32         *     *    YES 
               TCP                    82                   80
2   OUT   DST  10.0.0.1/32            192.168.1.3/32         *     *    YES 
               TCP                    83                   80
------------------------------------------------------------------------------

 Source IP addressDestination IP address
 Destination translation 
Before translation:XXX.XXX.XXX.XXX:YYY10.0.0.1:80
After translation:XXX.XXX.XXX.XXX:YYY192.168.1.1:80
 Destination translation 
Before translation:XXX.XXX.XXX.XXX:YYY10.0.0.1:81
After translation:XXX.XXX.XXX.XXX:YYY192.168.1.2:80
 Destination translation 
Before translation:XXX.XXX.XXX.XXX:YYY10.0.0.1:82
After translation:XXX.XXX.XXX.XXX:YYY192.168.1.3:80

Comment. For the first destination address translation has used a record PR:0, for the second has used a record PR:1, for the third has used a record PR:2

printPrint this page