dslreports logo
spacer

spacer
 
    All FAQs Site FAQ DSL FAQ Cable Tech About DSL Distance DSL Hurdles »»
spc

spacer




how-to block ads




50.4 Running Servers with Cisco

Suggested prerequisite reading
»Cisco Forum FAQ »NAT, PAT, Port Forward, Internet and Server Access: Introduction and Practices

For illustration purposes, I use:
* Cisco 806 router (2 Ethernet ports)
* ISP provided static IPs
* ISP provided DNS
* PPPoE (have to put username and password to connect to ISP)

Note:
1) When your ISP doesn't use PPPoE
If your ISP does not use PPPoE, this configuration can be easily modified to suit other type of ISP connections (i.e. Static, DHCP, PPPoA). Check out other part of this forum's FAQ for such situation.
Various PPPoE/PPPoA/DHCP/Static Sample Configuration with Cisco

2) For servers other than FTP
For illustration purposes, I run FTP server behind the router. This configuration can be modified to either have web server, mail server, or just any public servers that run on specific TCP or UDP port/ports. When you run web server, you can replace the TCP port 20 and 21 with TCP port 80 (the standard web port) and possibly also with TCP port 443 (the standard secure web port). As for mail server, replace with TCP port 25 (the standard mail port). For other servers (including print server and anything that need to be accessible from the Internet), confirm your software configuration of the TCP/UDP port it uses.

3) CLI-based sample configuration
As most of the sample configurations here in this Cisco Forum's FAQ, this FAQ also uses CLI commands to provide sample configuration and illustration. Should you be unfamiliar with CLI commands or the GUI does not work, please have yourself to review the following FAQ to guide you understanding CLI
»Cisco Forum FAQ »The most straight-forward way to configure Cisco router: Introduction to CLI

Background

Brief explanation is in order. In this sample configuration, Ethernet0 interface is for inside network (LAN interface). Ethernet1 is for outside (ISP or WAN physical interface). Dialer1 is for PPPoE (the "actual"/logical WAN interface). The 1.0.0.13 is ISP provided static IP address for the use of the server. This configuration example is for running FTP server, which uses the standard TCP port 20 and 21.

The LAN uses 10.10.10.0 network with 255.255.255.0 subnet for both servers and workstations. All servers within the LAN use static IP address. The router is configured as DHCP server to give out IP info (IP addresses, subnet mask, DNS) to workstations that are configured as DHCP client.

This sample configuration of setup your own servers behind Cisco router suggests multiple possible network design. In general, the suggested network design are either with or without port forwarding. When there is a port forwarding in place, it means there is NAT (Network Address Translation) and/or PAT (Port Address Translation) involved. When there is no port forwarding in place, it means there is no NAT/PAT involved.

Side Note:
For more info on NAT/PAT concept, check out the following FAQ
»Cisco Forum FAQ »NAT, PAT, Port Forward, Internet and Server Access: Introduction and Practices

When there is a port forwarding in place, usually all or most of the following setup are in place.
* Servers use private IP address (typically fall under 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16 subnets)
* Somewhere along the line between the servers and the Internet, there is a NAT/PAT in place.

In the first part of the sample configuration, the servers use the typical Private IP address and the Cisco router performs the NAT/PAT to bridge communication between the server and the Internet.

When there is no port forwarding in place, usually all or most of the following setup are in place.
* Servers use Public Internet-routeable IP address (typically don't fall under 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16 subnets)
* No NAT/PAT in place between the servers and the Internet

In the second part of the sample configuration, the servers use Public IP address directly. The Cisco router does not perform NAT/PAT at all to bridge communication between the server and the Internet since there is no reason to do such.

As best practice, it is suggested not to do NAT/PAT or port forwarding between the server and the Internet when there are multiple Public IP subnets to use or when there is a large Public IP subnet that you can subnet into smaller network. When there is only one Public IP address or small-size subnet, then in general there is no other choice but to deploy NAT/PAT or port forwarding between the server and the Internet.

Evaluating ISP services

* Residential Broadband Internet service
Most likely this kind of service is insufficient to support running Internet-accessible server since most broadband ISP block incoming ports necessary for server connectivity. Upgrading to business account is highly suggested.

* Business Broadband Internet service
This service is the least to support running Internet-accessible server, with having one static Public IP address as minimum requirement. Confirm with your ISP whether you are assigned one static Public IP address or one dynamic IP address.

* Business Dedicated Internet circuit
This service is the norm to support running Internet-accessible server. You have a dedicated fiber, DS-3, or T1/E1 circuit along with circuit ID. The ISP installs their equipment at your facility in a form of Smartjack, managed router, or managed DWDM box which you need to extend to your equipment.

Not sure which services you have? Consult your ISP for further info.

Network Design Considerations

* One Dynamic Public IP address
Dynamic Public IP address is insufficient to support running Internet-accessible server. The consideration is that server connectivity requires stable and persistence traffic flow, which only static Public IP address can provide.

* One Static Public IP address
With only one static Public IP address, most likely you will have to implement PAT since you need to share the IP address for both the Internet-accessible servers and LAN machines to browse the Internet. You could implement NAT when you have at least two ISP where one is dedicated to the Internet-accessible servers and another one to the LAN machines.

* A Block of Static Public IP addresses
Having multiple static Public IP addresses provides leeway which you can dedicate one IP address to Internet browsing while the rest to Internet-accessible servers. In a occasion where you receive two blocks of static Public IP addresses (one block is for WAN and another is for LAN), you can even assign the static Public IP addresses directly to the servers.

Not sure which services you have? Consult your ISP for further info.

First Network Design: There is NAT/PAT in place between the server and the Internet (with port forwarding)

In this first part of sample configuration, there will be two PAT in place between Public and Private IP addresses. One is dynamic PAT which uses single Public IP address for all local workstations. Another one is static PAT which uses single Public IP address for servers.

When using NAT/PAT, keep in mind that the Internet-accessible servers are seen from the Internet as their NAT/PAT-ed IP address (the Public IP address) and not the local IP address (not the Private IP address). The connection from the Internet users to the Public IP address will then be forwarded by the NAT/PAT device, which in this case is the router, according to the router's routing table. In other words, the router will (TCP/UDP) port forward connection from the Public IP address to the actual Private IP address after proper network's routing table is in place. This understanding is very important when you or someone need to test connectivity to the server and/or when you need to create filter (access list or ACL for short) to allow only certain incoming traffic from the Internet and block others.

Instruments used in this illustration are pretty much standard for running your own servers. Please note that IP addresses, username, and password are changed. However, you could always modify the configuration to suit your situation.

This sample configuration assumes that you have a block of IP addresses from ISP. There is a dedicated Public IP address for the router WAN interface (the Dialer1 interface) and another dedicated Public IP address for the server PAT IP address. In this sample configuration, typical users from 10.10.10.0/24 network are dynamically PAT-ed to the Dialer1 interface IP address when the users are going out to the Internet. When the 10.10.10.2 machine need to go out to the Internet or need to communicate with users on the Internet, then the 10.10.10.2 is statically PAT/NAT-ed to the 1.0.0.13 Public IP address.

If you only have single Public IP address for both router WAN interface and server PAT IP address instead of a block of IP addresses, there are several ways to configure the router.

One way is to use the same command as shown in sample configuration.


This one configuration way is suitable when you have static IP address from your ISP and you know exactly what the IP address is. In this case you have the 1.1.1.14 single static IP address for both the WAN interface and Public server IP address. Note that the command above shows the static PAT between Public IP address (the 1.1.1.14) and Private IP address (the 10.10.10.2).

When you are unsure which IP address you receive from the ISP, or when your Public IP address keep changing; then another way to configure the static PAT is following


With situation of dynamic IP address, at some point you still need to know the exact Public IP address you receive from your ISP for server connection testing and production time. To find out, you can issue show ip interface brief command on the router. You will then see the associated WAN interface Public IP address. Note that the command above shows the static PAT between the Dialer1 interface Public IP address (the one that shows on the show ip interface brief display) and Private IP address (the 10.10.10.2).

Between Static and Dynamic IP Address Assignment for LAN Machines

Typically, servers are having static IP addresses where regular workstations are having dynamic IP addresses. As mentioned, all LAN machines (including servers and workstations) are within 10.10.10.0/24 subnet. Let's say you dedicate 10.10.10.1 for router, 10.10.10.2 - 10.10.10.14 for servers, and the rest (10.10.10.15 - 10.10.10.254) for workstations.

This illustration assumes all workstations are receiving dynamic IP address (as DHCP client) from router which is acting as the LAN DHCP server; as indicated by the ip dhcp pool CLIENT command. Since router and servers are having static IP addresses, you exclude 10.10.10.1 - 10.10.10.14 from DHCP pool. This is where you need the ip dhcp excluded-address 10.10.10.1 10.10.10.14 command in place.

For routers that only have one Ethernet port

As mentioned, this sample configuration uses 2-Ethernet-port router. In cases that your router have one Ethernet port as LAN side and one DSL (ATM) port as WAN side, you could check out the following link:

Configuring Network Address Translation and Static Port Address Translation to Support an Internal Web Server

From the link, you can see how similar and how different the configurations are.

Tips

* You can use any computer, running any operating system with any generic FTP or other server software. There is no exclusiveness
* Make sure that the ports you plan to use are not used by other program.
* Also make sure that your ISP does not block the port you plan to use. Check out the following thread for illustration: http://www.dslreports.com/forum/r24059257-HELP-cant-connect-on-port-25-what-am-I-doing-wrong
* You can use generic port scanner software to find out if the port you plan to use is available
* Setup the FTP software to have the FTP server to use port 21 (standard port)
* FYI, port 21 only handle the connection and data is sent over port 20. With both ports PAT'd you will be able to use both PASV & PORT connections to your FTP server
* To verify the configuration, access the server from OUTSIDE network (i.e. from the Internet) and NOT from your own LAN. For this illustration, run an Internet browser (i.e. Internet Explorer, Netscape) and open

The Sample Configuration

Finally, here is the "show running-config" output.


Command Adjustment for Specific Needs

The above sample configuration shows how to provide FTP access to public. When you need to provide other access type such as Web or Mail, following is the command adjustment needed.

To run Public Web Server, following is the command

To run Public Mail Server, following is the command

To run both Public Web and Mail Server that resides on different LAN machines, following is the list of commands.


where 10.10.10.2 is the Mail Server and 10.10.10.3 is the Web Server.

To run both Public Web and Mail Server that resides on different LAN machines and each has its own Public IP address, following is the list of commands.


where 10.10.10.2 is the LAN Mail Server and 1.0.0.12 is the Public Mail Server. Similarly, 10.10.10.3 is the LAN Web Server and 1.0.0.13 is the Public Web Server.

If you like to dedicate 1.0.0.12 only for 10.10.10.2 machine and to dedicate 1.0.0.13 only for 10.10.10.3 machine, then you can do Static NAT instead as follows.


Some discussion

http://www.dslreports.com/forum/r23328282-Config-Need-help-with-internal-server-on-Cisco-2821-Router
http://www.dslreports.com/forum/r25820181-Need-Help-On-Allowing-Telnet-Access-to-an-Interface

With such Static NAT implementation, you should have inbound ACL on the router WAN interface or some Internet firewall to regulate which inbound Internet traffic that can access those dedicated Public IP addresses for better network security. Following is a sample.

http://www.dslreports.com/faq/14453

Second Network Design: There is no NAT/PAT in place between the server and the Internet (without port forwarding)

In this second part of sample configuration, there will be one PAT in place between Public and Private IP addresses. The one PAT is dynamic PAT which uses single Public IP address for all local workstations. The servers use Public IP address directly. No NAT/PAT is in place between workstation and servers, and no NAT/PAT is in place between the Internet and servers.

The network setup for this sample configuration is following


Since the servers use the Public IP address directly, the servers and the Internet Router are part of Outside network (1.0.0.8/29). The Internet Router Dialer1 interface receives 1.0.0.14 IP address through the ISP PPP negotiation. This 1.0.0.14 IP address is also the servers' default gateway.

To simplify the route design, dynamic routing protocol is used. In this sample configuration, RIP version 2 is used as the dynamic routing protocol between Internet Router and Inside Router.

With Outside network having the Public IP address of 1.0.0.8/29 directly assigned, there are two points that are established. One is that there is no need to do NAT/PAT for Outside network since Outside machines already use Internet-routable Public IP address.

The other established point is to avoid unnecessary DNS BIND to resolve Outside server name to both Public IP and Private IP addresses. Outside server DNS name resolves to always its associated Public IP address regardless of where the incoming traffic come from, either from the Internet or from the Inside network. More info on this issue can be found in the following FAQ.

http://www.dslreports.com/faq/13449

The Inside network (LAN) is 10.0.0.0/24. Traffic between Outside and Inside networks pass as their original IP addresses (as in general, best practice), therefore there is no need to NAT Inside network to access Outside and vice versa.

There is no NAT/PAT in place for Outside network to go out to the Internet as mentioned earlier. In other words, there is no port forwarding in place between Outside network and the Internet. Since there is no NAT/PAT between Outside network and Inside network, there is no port forwarding in place between Outside network and the Inside network either. This no-port-forwarding setup is due to the network design of using the actual/original IP addresses instead of using the NAT/PAT IP addresses, as described above.

There is however NAT/PAT in place for Inside network to go out to the Internet. All Inside network machines are PAT-ed to 1.0.0.9 IP address to go out to the Internet, which is the Inside Router Outside (Ethernet1 interface) IP address.

Internet Router


Inside Router


Having Servers on DMZ

Scenario 1: NAT/PAT for both DMZ and Inside networks

Let's say there is DMZ network of 10.10.10.0/24 where the Inside network is 10.0.0.0/24. Traffic between DMZ and Inside networks pass as their original IP addresses (as in general, best practice), therefore there is no need to NAT Inside network to access DMZ and vice versa. DMZ network is only allowed to access Inside DNS server (the 10.0.0.2 IP address) and no other Inside hosts while the DMZ network is allowed to access anything Outside (the Internet). Such access is regulated by the ACL 100.

Following is the sample configuration.


Scenario 2: NAT/PAT only for Inside network, no NAT/PAT for DMZ network

As earlier sample configurations, this part of sample configuration also uses 1.0.0.8/29 as the NAT/PAT IP subnet. However there is an addition IP subnet of 1.0.0.0/30. The 1.0.0.0/30 is used as the NAT/PAT IP subnet for Inside network. DMZ network does not use NAT/PAT at all, instead the DMZ network uses the 1.0.0.8/29 directly.

Similar to the previous no-port-forwarding sample configuration, there are two points that are established with DMZ network having the Public IP address of 1.0.0.8/29 directly assigned. One is that there is no need to do NAT/PAT for DMZ network since DMZ machines already use Internet-routable Public IP address.

The other established point is to avoid unnecessary DNS BIND to resolve DMZ server name to both Public IP and Private IP addresses. DMZ server DNS name resolves to always its associated Public IP address regardless of where the incoming traffic come from, either from the Internet or from the Inside network.

Now let's describe the network setup. The 1.0.0.8/29 IP subnet is assigned directly to all DMZ machines. A 1.0.0.14 is used as the DMZ network default gateway, which is also the router DMZ interface IP address. The Inside network is 10.0.0.0/24. Traffic between DMZ and Inside networks pass as their original IP addresses (as in general, best practice), therefore there is no need to NAT Inside network to access DMZ and vice versa. DMZ network is only allowed to access Inside DNS server (the 10.0.0.2 IP address) and no other Inside hosts while the DMZ network is allowed to access anything Outside (the Internet). Such access is regulated by the ACL 100.

There is no NAT/PAT in place for DMZ network to go out to the Internet as mentioned earlier. In other words, there is no port forwarding in place between DMZ network and the Internet. Since there is no NAT/PAT between DMZ network and Inside network, there is no port forwarding in place between DMZ network and the Inside network either. This no-port-forwarding setup is due to the network design of using the actual/original IP addresses instead of using the NAT/PAT IP addresses, as described above.

There is however NAT/PAT in place for Inside network to go out to the Internet. All Inside network machines are PAT-ed to 1.0.0.2 IP address to go out to the Internet, which is the router WAN interface IP address.

The DMZ network still hosts FTP server, which is directly assigned 1.0.0.13 IP address. For security, there is ACL 101 to permit only necessary incoming traffic from the Internet and block others.

Following is the sample configuration.


More Sample Configuration

http://www.dslreports.com/faq/15913
http://www.dslreports.com/faq/14242

Testing Connectivity

To test your design and configuration, basically you need to use Public IP address that is not within the same subnet as your ISP-assigned IP addresses. Here is some clarification.

In this example, the 1.0.0.8/29 subnet is the ISP-assigned IP addresses that you use for the servers. When you are testing the connectivity, your connection has to come from IP address that is not within the 1.0.0.8/29 subnet. Something like connection test from your neighbor, office, or even local coffee shop should do since those places have their own ISP-assigned IP address that are not the same as yours.

Note that this requirement in connection testing is not some debug or router incapability issue, but rather it is to comply with RFC 3022 as industry standard mentioned in the prerequisite reading (top of the page), to ensure the router is functioning reliably.

Some illustration.
http://www.dslreports.com/forum/r28420283-RDP-from-Internet-w-Cisco-Router-in-place.

Troubleshooting

FTP Server related
Active FTP vs. Passive FTP, a Definitive Explanation
http://www.dslreports.com/forum/r22912481-FTP-server-doesnt-work-on-port-21-works-on-other-ports

Watch Some Bugs

http://www.dslreports.com/forum/r29570463-Losing-Config

Some Discussions

http://www.dslreports.com/forum/r28334514-Config-Cannot-get-to-FTP-WWW-or-Exchange-behind-Cisco-Router
http://www.dslreports.com/forum/r26899181-Config-Config-Help-2801-Qwest-DSL
http://www.dslreports.com/forum/r26671777-Cisco-IOS-NAT-problem


by aryoba See Profile
last modified: 2014-10-01 14:11:14

Suggested prerequisite reading
»Cisco Forum FAQ »NAT, PAT, Port Forward, Internet and Server Access: Introduction and Practices

For illustration purposes, I use:
* One Cisco PIX Firewall 501 (2 Ethernet ports) and one Cisco PIX Firewall 515 (3 Ethernet ports) running PIX OS version 6.3(3) for sample configurations in OS version 6.3
* One Cisco ASA 5520 (5 Ethernet ports) running OS 7.2(3) for sample configuration in OS 7.0 or later
* ISP provided static IPs
* ISP provided DNS
* Static WAN IP addresses, provided by ISP

Note:
1) When your ISP doesn't use Static IP Address
If your ISP does not use Static IP Address, this configuration can be easily modified to suit other type of ISP connections (i.e. DHCP, PPPoE, PPPoA). Check out other part of this forum's FAQ for such situation.
Various PPPoE/PPPoA/DHCP/Static Sample Configuration with Cisco

2) For servers other than FTP
For illustration purposes, I run FTP server behind the router. This configuration can be modified to either have web server, mail server, or just any public servers that run on specific TCP or UDP port/ports. When you run web server, you can replace the TCP port 20 and 21 with TCP port 80 (the standard web port) and possibly also with TCP port 443 (the standard secure web port). As for mail server, replace with TCP port 25 (the standard mail port). For other servers (including print server and anything that need to be accessible from the Internet), confirm your software configuration of the TCP/UDP port it uses.

3) For ASA or PIX Firewall running OS version 7.0 or later
PIX OS version 6.3(3) commands are pretty much similar to the ASA or PIX OS version 7.0 or later. Should you need more sample configurations from different angle or sample configurations on ASA or PIX running OS version 7.0 or later, keep reading to get the preliminary concept overview then proceed to the next discussion.

4) CLI-based sample configuration
As most of the sample configurations here in this Cisco Forum's FAQ, this FAQ also uses CLI commands to provide sample configuration and illustration. Should you be unfamiliar with CLI commands or the ASDM does not work, please have yourself to review the following FAQ to guide you understanding CLI
»Cisco Forum FAQ »Straight-forward way to configure Cisco PIX Firewall/ASA: Introduction to CLI

Background

Brief explanation is in order. In this sample configuration, Ethernet0 interface is for outside network (ISP or WAN physical interface). Ethernet1 is for inside (LAN interface).

The ISP-provided IP Block is 1.1.1.9/24 - 1.1.1.14/24, where 1.1.1.9 is for the Internet traffic, 1.1.1.13 is for the server, and 1.1.1.14 is the PIX WAN interface IP address. The default gateway (the ISP) is 1.1.1.1/24.

This configuration example is for running FTP server, which uses the standard TCP port 20 and 21. You need to permit inbound traffic from the Internet to your LAN by issuing the access-list INBOUND permit tcp any host 1.1.1.13 range 20 21 command.

The LAN uses 10.10.10.0 network with 255.255.255.0 subnet for both servers and workstations. All servers within the LAN use static IP address. The PIX is configured as DHCP server to give out IP info (IP addresses, subnet mask, DNS) to workstations that are configured as DHCP client.

This sample configuration of setup your own servers behind Cisco router suggests multiple possible network design. In general, the suggested network design are either with or without port forwarding. When there is a port forwarding in place, it means there is NAT (Network Address Translation) and/or PAT (Port Address Translation) involved. When there is no port forwarding in place, it means there is no NAT/PAT involved.

Side Note:
For more info on NAT/PAT concept, check out the following FAQ
»Cisco Forum FAQ »NAT, PAT, Port Forward, Internet and Server Access: Introduction and Practices

When there is a port forwarding in place, usually all or most of the following setup are in place.
* Servers use private IP address (typically fall under 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16 subnets)
* Somewhere along the line between the servers and the Internet, there is a NAT/PAT in place.

In the first part of the sample configuration, the servers use the typical Private IP address and the Cisco router performs the NAT/PAT to bridge communication between the server and the Internet.

When there is no port forwarding in place, usually all or most of the following setup are in place.
* Servers use Public Internet-routeable IP address (typically don't fall under 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16 subnets)
* No NAT/PAT in place between the servers and the Internet

In the second part of the sample configuration, the servers use Public IP address directly. The Cisco router does not perform NAT/PAT at all to bridge communication between the server and the Internet since there is no reason to do such.

As best practice, it is suggested not to do NAT/PAT or port forwarding between the server and the Internet when there are multiple Public IP subnets to use or when there is a large Public IP subnet that you can subnet into smaller network. When there is only one Public IP address or small-size subnet, then in general there is no other choice but to deploy NAT/PAT or port forwarding between the server and the Internet.

Evaluating ISP services

* Residential Broadband Internet service
Most likely this kind of service is insufficient to support running Internet-accessible server since most broadband ISP block incoming ports necessary for server connectivity. Upgrading to business account is highly suggested.

* Business Broadband Internet service
This service is the least to support running Internet-accessible server, with having one static Public IP address as minimum requirement. Confirm with your ISP whether you are assigned one static Public IP address or one dynamic IP address.

* Business Dedicated Internet circuit
This service is the norm to support running Internet-accessible server. You have a dedicated fiber, DS-3, or T1/E1 circuit along with circuit ID. The ISP installs their equipment at your facility in a form of Smartjack, managed router, or managed DWDM box which you need to extend to your equipment.

Not sure which services you have? Consult your ISP for further info.

Network Design Considerations

* One Dynamic Public IP address
Dynamic Public IP address is insufficient to support running Internet-accessible server. The consideration is that server connectivity requires stable and persistence traffic flow, which only static Public IP address can provide.

* One Static Public IP address
With only one static Public IP address, most likely you will have to implement PAT since you need to share the IP address for both the Internet-accessible servers and LAN machines to browse the Internet. You could implement NAT when you have at least two ISP where one is dedicated to the Internet-accessible servers and another one to the LAN machines.

* A Block of Static Public IP addresses
Having multiple static Public IP addresses provides leeway which you can dedicate one IP address to Internet browsing while the rest to Internet-accessible servers. In a occasion where you receive two blocks of static Public IP addresses (one block is for WAN and another is for LAN), you can even assign the static Public IP addresses directly to the servers.

Not sure which services you have? Consult your ISP for further info.

First Network Design: There is NAT/PAT in place between the server and the Internet (with port forwarding)

In this part of sample configuration, there will be two PAT in place between Public and Private IP addresses. One is dynamic PAT which uses single Public IP address for all local workstations. Another one is static PAT which uses single Public IP address for servers.

When using NAT/PAT, keep in mind that the Internet-accessible servers are seen from the Internet as their NAT/PAT-ed IP address (the Public IP address) and not the local IP address (not the Private IP address). The connection from the Internet users to the Public IP address will then be forwarded by the NAT/PAT device, which in this case is the ASA/PIX Firewall, according to the ASA/PIX Firewall's routing table. In other words, the ASA/PIX Firewall will (TCP/UDP) port forward connection from the Public IP address to the actual Private IP address after proper network's routing table is in place. This understanding is very important when you or someone need to test connectivity to the server and/or when you need to create filter (access list or ACL for short) to allow only certain incoming traffic from the Internet and block others.

Specifically for firewall devices such as PIX Firewall and ASA, creating such ACL to regulate incoming traffic initiated from the Internet to local LAN is required. On this sample configuration, this ACL is called INBOUND (access-list INBOUND).

Side Note:
For more info on NAT/PAT concept, check out the following FAQ
»Cisco Forum FAQ »NAT, PAT, Port Forward, Internet and Server Access: Introduction and Practices

Instruments used in this illustration are pretty much standard for running your own servers. Please note that IP addresses, username, and password are changed. However, you could always modify the configuration to suit your situation.

This sample configuration assumes that you have a block of IP addresses from ISP. There is a dedicated Public IP address for the PIX WAN interface (the Outside interface) and another dedicated Public IP address for the server PAT IP address. In this sample configuration, the network uses 1.1.1.13 IP address as the server Public IP address where the server inside Private IP address is 10.10.10.2. Any other machines use 1.1.1.9 Public IP address to go out to the Internet.

Note that the static PAT is indicated by the static command where the dynamic PAT is indicated by the pair of global and nat commands. You can change the IP address either on the static, global, or nat commands to suit your need or situation.

If you only have single Public IP address for both PIX/ASA Outside interface and server PAT IP address instead of a block of IP addresses, then you use the following commands instead.


With situation of dynamic IP address, at some point you still need to know the exact Public IP address you receive from your ISP for server connection testing and production time. To find out, you can issue show ip address command on the PIX. You will then see the associated outside interface Public IP address.

Note that the static commands above show the static PAT between outside (WAN) interface Public IP address (the one that shows on show ip address command) and Private IP address (the 10.10.10.2).

Between Static and Dynamic IP Address Assignment for LAN Machines

Typically, servers are having static IP addresses where regular workstations are having dynamic IP addresses. As mentioned, all LAN machines (including servers and workstations) are within 10.10.10.0/24 subnet. Let's say you dedicate 10.10.10.1 for the PIX, 10.10.10.2 - 10.10.10.14 for servers, and the rest (10.10.10.15 - 10.10.10.254) for workstations.

This illustration assumes all workstations are receiving dynamic IP address (as DHCP client) from the PIX which is acting as the LAN DHCP server; as indicated by the dhcpd address 10.10.10.15-10.10.10.254 inside command. Since the PIX and servers are having static IP addresses, you exclude 10.10.10.1 - 10.10.10.14 from DHCP pool. This is why the 1st DHCP IP address within the pool is 10.10.10.15 and the last one is 10.10.10.254

Tips

* You can use any computer, running any operating system with any generic FTP or other server software. There is no exclusiveness
* Make sure that the ports you plan to use are not used by other program.
* Also make sure that your ISP does not block the port you plan to use
* You can use generic port scanner software to find out if the port you plan to use is available
* Setup the FTP software to have the FTP server to use port 21 (standard port)
* FYI, port 21 only handle the connection and data is sent over port 20. With both ports PAT'd you will be able to use both PASV & PORT connections to your FTP server
* To verify the configuration, access the server from OUTSIDE network (i.e. from the Internet) and NOT from your own LAN. For this illustration, run an Internet browser (i.e. Internet Explorer, Netscape) and open

The Sample Configuration

Finally, here is the "show running-config" output.

In OS version 6.3

Note that the static command is where the port forwarding actually takes place between the Public and the Private IP address on specific TCP or UDP port. The ACL INBOUND is only a filter to permit certain incoming traffic initiated from Outside (the Internet).

Command Adjustment for Specific Needs

The above sample configuration shows how to provide FTP access to public. When you need to provide other access type such as Web or Mail, following is the command adjustment needed.

To run Public Web Server, following is the command list

To run Public Mail Server, following is the command list

To run both Public Mail and Web Server where each server resides on different LAN machines, following is the command list.

where 10.10.10.2 is the LAN Mail Server and 10.10.10.3 is the LAN Web Server.

To run both Public Mail and Web Server where each server resides on different LAN machines and each server has its own Public IP address, following is the command list.

where 10.10.10.2 is the LAN Mail Server and 1.1.1.12 is the WAN (Public) IP address. Similarly, 10.10.10.3 is the LAN Web Mail Server and 1.1.1.13 is the Public IP address.

If you like to dedicate specific Public IP address for specific LAN machines, then you can implement Static NAT instead as follows.

where you dedicate 1.1.1.12 only for 10.10.10.2 machine and dedicate 1.1.1.13 only for 10.10.10.3 machine.

Sample Configuration

In OS version 8.3 or later

Some discussions

http://www.dslreports.com/forum/r24026626-Config-Problems-with-Cisco-ASA-allowing-web-traffic-through

Having Servers on DMZ

Scenario 1: NAT/PAT for both DMZ and Inside networks

This time there is DMZ network of 10.10.10.0/24 where the Inside network is 10.0.0.0/24. Traffic between DMZ and Inside networks pass as their original IP addresses (as in general, best practice), therefore there is no need to NAT Inside network to access DMZ and vice versa. DMZ network is only allowed to access Inside DNS server (the 10.0.0.2 IP address) and no other Inside hosts while the DMZ network is allowed to access anything Outside (the Internet).

Note that the access-list DMZ only applies when connections are initiated from DMZ machines. Any connections initiated from other network such as Inside and Outside won't be affected by this access-list DMZ.

Following is the sample configuration.

Scenario 2: NAT/PAT only for Inside network, no NAT/PAT for DMZ network

Second Network Design: There is no NAT/PAT in place between the server and the Internet (without port forwarding)


So far the presented sample configurations use 1.1.1.9/24 - 1.1.1.14/24 as the NAT/PAT IP subnet. In this second part of sample configuration, there is an addition IP subnet of 1.0.0.0/30. Instead of using 1.1.1.9/24 - 1.1.1.14/24, this sample configuration uses 1.1.1.8/29. The 1.0.0.0/30 is used as the NAT/PAT IP subnet for Inside network. DMZ network does not use NAT/PAT at all, instead the DMZ network uses the 1.1.1.8/29 directly.

With DMZ network having the Public IP address of 1.1.1.8/29 directly assigned, there are two points that are established. One is that there is no need to do NAT/PAT for DMZ network since DMZ machines already use Internet-routable Public IP address.

The other established point is to avoid unnecessary DNS BIND to resolve DMZ server name to both Public IP and Private IP addresses. With DMZ network having the Public IP address of 1.1.1.8/29 directly assigned, DMZ server DNS name resolves to always its associated Public IP address regardless of where the incoming traffic come from, either from the Internet or from the Inside network. More info on this issue can be found in the following FAQ.

http://www.dslreports.com/faq/13449

Now let's describe the network setup. The 1.1.1.8/29 IP subnet is assigned directly to all DMZ machines. A 1.1.1.14 is used as the DMZ network default gateway, which is also the PIX Firewall DMZ interface IP address. The Inside network is 10.0.0.0/24. Traffic between DMZ and Inside networks pass as their original IP addresses (as in general, best practice), therefore there is no need to NAT Inside network to access DMZ and vice versa. DMZ network is only allowed to access Inside DNS server (the 10.0.0.2 IP address) and no other Inside hosts while the DMZ network is allowed to access anything Outside (the Internet). Such access is regulated by the ACL DMZ.

There is no NAT/PAT in place for DMZ network to go out to the Internet as mentioned earlier. In other words, there is no port forwarding in place DMZ network and the Internet. Since there is no NAT/PAT between DMZ network and Inside network, there is no port forwarding in place between DMZ network and the Inside network either. This no-port-forwarding setup is due to the network design of using the actual/original IP addresses instead of using the NAT/PAT IP addresses, as described above.

There is however NAT/PAT in place for Inside network to go out to the Internet. All Inside network machines are PAT-ed to 1.0.0.2 IP address to go out to the Internet, which is the PIX Firewall Outside interface IP address.

The DMZ network still hosts FTP server, which is directly assigned 1.1.1.13 IP address. For security, there is ACL INBOUND to permit only necessary incoming traffic from the Internet and block others.

Following is the sample configuration.

1. In OS version 6.3

2. In OS version 7.0 to 8.2

OS Version 8.3 or later

More Sample Configurations

As mentioned, PIX OS version 6.3(3) commands are pretty much similar to the ASA or PIX OS version 7.0 or later. Should you need more sample configurations from different angle or sample configurations on ASA or PIX running OS version 7.0 or later, you can check out the following links.

Run Mail Server on DMZ Network
PIX running OS 6.3 image
PIX/ASA running OS 7.0 image or newer

Run Mail Server on Inside Network
PIX running OS 6.3 image
PIX/ASA running OS 7.0 image or newer

Run Mail Server on Outside Network
PIX running OS 6.3 image
PIX/ASA running OS 7.0 image or newer

PIX Firewall - Router Combo
http://www.dslreports.com/faq/14241
http://www.dslreports.com/faq/14242

Some Discussions
http://www.dslreports.com/forum/r21351727-Config-cisco-5520

Testing Connectivity

To test your design and configuration, basically you need to use Public IP address that is not within the same subnet as your ISP-assigned IP addresses. Here is some clarification.

In this example, the 1.1.1.8/29 subnet is the ISP-assigned IP addresses that you use for the servers. When you are testing the connectivity, your connection has to come from IP address that is not within the 1.1.1.8/29 subnet. Something like connection test from your neighbor, office, or even local coffee shop should do since those places have their own ISP-assigned IP address that are not the same as yours.

Note that this requirement in connection testing is not some debug or firewall incapability issue, but rather it is to comply with RFC 3022 as industry standard mentioned in the prerequisite reading (top of the page), to ensure the firewall is functioning reliably.

Some illustration.
http://www.dslreports.com/forum/r28420283-RDP-from-Internet-w-Cisco-Router-in-place.

Note on Running Microsoft Exchange Mail service with ASA/PIX Firewall running OS version 7.0 or later

The OS version 7.0 introduces a new feature called ESMTP inspection that supercede the older OS SMTP inspection. This new feature was created to inspect ESMTP (Extended SMTP) traffic in addition to standard SMTP traffic. This new inspection is based on the industry standard RFC 1869 about the ESMTP protocol definition and mechanism.

Specifically for the OS version 7.x, only the following SMTP (and ESMTP) mail commands are allowed to pass through by default. All other commands are blocked by default, based on RFC 2821 Section 4.5.1: Minimum Implementation

AUTH, DATA, EHLO, ETRN, HELO, HELP, MAIL, NOOP, QUIT, RCPT, RSET, SAML, SEND, SOML, and VRFY

The reason of such default behavior is due to security and is based on RFC requirement of minimum implementation of ESMTP mail server mechanism.

Unfortunately Microsoft Exchange ESMTP implementation does not comply with the RFC 2821 for some reason. Therefore there might be issues when MS Exchange is used to host mail server behind ASA/PIX Firewall running OS version 7.x.

To mitigate the issue, some people chose just to remove SMTP inspection off the configuration completely. This decision is unwise since then the ASA/PIX Firewall will never provide proper security protection against SMTP traffic. The proper decision should be modifying the SMTP inspection default behavior to suit such specific need. When you need to modify default behavior of ASA/PIX Firewall in which ESMTP commands are permitted to pass, you can check out the following official Cisco documentation to do such.

Managing SMTP and Extended SMTP Inspection

Starting OS version 8.x however, somehow this MS Exchange-ESMTP inspection issue is resolved. Therefore you may want to skip running OS version 7.x and go straight to run OS version 8.x or 9.x should you need to run MS Exchange server behind an ASA/PIX Firewall.

Sample Configurations of Enabling and/or Modifying Default Inspection on some protocols

Check out the following official Cisco documentations.

ESMTP TLS Configuration
PIX/ASA 7.x: Enable FTP/TFTP Services Configuration Example
Disable Default Global Inspection and Enable Non-Default Application Inspection

Troubleshooting

FTP Server related
Active FTP vs. Passive FTP, a Definitive Explanation
http://www.dslreports.com/forum/r22912481-FTP-server-doesnt-work-on-port-21-works-on-other-ports

Discussions

http://www.dslreports.com/forum/r29493311-HELP-Just-when-I-thought-I-had-this-ASA-cracked.
http://www.dslreports.com/forum/r29157793-Config-Pix-515e-ACL-setup-help
http://www.dslreports.com/forum/r26278989-Config-PIX-515e-v8.0-routing-DMZ-ACL-assistance-opinions-nee
http://www.dslreports.com/forum/r26979154-HELP-NAT-vs-Route-vs-ACL-ASA5505
http://www.dslreports.com/forum/r28451548-ASA-5505-Can-I-use-outside-dynamic-IP-for-webserver-DMZ-


by aryoba See Profile
last modified: 2015-02-27 14:33:04

Suggested Prerequisite Reading
»Cisco Forum FAQ »NAT, PAT, Port Forward, Internet and Server Access: Introduction and Practices

Traditional Approach

Currently you have T1/E1 circuit for Internet access of both LAN users and servers. Due to bandwidth consumption, you decide to dedicate the T1/E1 circuit only for servers. For LAN users Internet access, you will bring in either DSL or Cable Internet. In addition, you like to have incoming IPSec VPN traffic into the LAN to go over the DSL or Cable Internet and not the T1/E1 circuit.

Following is the list of possible scenarios of network design.

1. Deploying one PIX 515 or ASA 5510 with DMZ

2. Deploying two 1841 routers

3. Deploying one 871 router, one ASA 5505, and one Catalyst 3560 Layer-3 switch

General Ideas and Considerations

For the illustration sake, let's consider the 1st scenario which employs the ASA 5510 with DMZ feature.

* The servers have default gateway pointing to the T1/E1 router
* The T1/E1 router has default gateway pointing to the T1/E1 ISP just like current setup
* There is a route at T1/E1 router pointing to the ASA DMZ interface to reach the LAN
* The ASA default gateway points to the the DSL/Cable Internet ISP
* There is a route at the ASA pointing to the T1/E1 router to reach the servers
* Incoming IPSec VPN traffic to the LAN go through the DSL/Cable Internet and terminates at ASA. In other words, the ASA acts as both Internet firewall and VPN Concentrator
* The servers' IP address can be either Public or Private IP addresses
* The LAN IP addresses are Private IP addresses
* No NAT in place for communication between the servers and the LAN
* There may be NAT in place for communication between the servers and the Internet, depending on network requirements
* There is no NAT in place for communication between the LAN and the incoming VPN traffic
* There is NAT in place for communication between the LAN and the Internet

The network design general ideas of all three above scenarios are pretty much similar. The first scenario is considered the simplest solution. You just have to make sure whoever manage the existing T1/E1 router is able to do any adjustment (i.e. adding route pointing to the ASA DMZ interface to reach LAN) due to the network design change. If for any reason the T1/E1 router management is unable or is unwilling to do any adjustment, then either second or third scenario should be feasible as well.

Note that in the first scenario, the ASA 5510 acts as both Internet firewall and VPN Concentrator. In the second scenario, the Second 1841 router acts as Internet firewall, Internet router, and VPN Concentrator. In the third scenario, the ASA 5505 acts as both Internet firewall and VPN Concentrator where the 3560 Layer-3 switch deals with routing between LAN, servers (DMZ), and the Internet.

Between Private and Public IP address Assignment for the servers

You have a choice of either assigning Public IP address directly to the servers, or assigning Private IP address to the servers. When the servers are assigned Private IP address, then the T1/E1 router does NAT for the servers when the servers need to communicate with the Internet. When the servers are assigned Public IP address directly, then no NAT should occur at the T1/E1 router for the servers when the servers need to communicate with the Internet.

There are times when assigning Public IP address directly to the servers are preferable. When there is a plan to have DNS A record for those servers for example, you may want the servers to have Public IP address assigned to them directly. This way you don't have to create DNS BIND for both the NAT-ed Public IP address and the Private IP address. You only need to create the BIND for just the Public IP address to serve both the Internet users and LAN users. When there is no need to have such DNS A record, then assigning Private IP address to the servers might be acceptable.

For more info, you can check out the following FAQ
»Cisco Forum FAQ »NAT, PAT, Port Forward, Internet and Server Access: Introduction and Practices

Sample Configuration

Following sample configuration reflects the network design first scenario.

Assumptions
* The servers are assigned Public IP address of 1.1.1.0/29 directly.
* There are two servers in place, one is web (supporting both HTTP and HTTPS/SSL) and another is mail
* Web server IP address is 1.1.1.3 and Mail server IP address is 1.1.1.4
* Default gateway of all servers is the 1.1.1.1 (T1/E1 router)
* No NAT in place at T1/E1 router for communication between the servers and the Internet
* LAN (Inside) is still be able to access the servers via the DMZ connection without problem
* Only the LAN can initiate connection to servers or anything within 1.1.1.0/29
* Servers or anything within 1.1.1.0/29 cannot initiate connection to LAN due to security concern
* In terms of LAN-DMZ communication, anything within 1.1.1.0/29 (including the servers) can only response to communication initiated from LAN
* In terms of DMZ-Internet communication, either the servers or the Internet can initiate communication to the other
* The existing T1/E1 router deploys CBAC to create Internet firewall. For more info, check out the following FAQ
»Cisco Forum FAQ »Sample IOS Firewall (CBAC) router configuration
»Cisco Forum FAQ »Sample Configuration of ACL-CBAC-IDS/IPS-IPSec VPN on router
* The ASA uses Microsoft Active Directory Domain Controller to authenticate incoming VPN connection to LAN machines. For more info, check out the following FAQ
»Cisco Forum FAQ »Configure PIX/ASA as both Internet Firewall and VPN Concentrator

Notes
* The above assumptions are considered typical network policy, practice, and deployment in a lot of organizations. You can always make adjustments to suit your specific requirements when needed.
* The router CBAC configuration can be simply replaced by more advanced Zone-Based Firewall configuration. Check out the following FAQ for more info
»Cisco Forum FAQ »Zone-Based Firewall Sample Configuration

Scenario 1

Existing T1/E1 router (i.e. 1721, 2620, similar or higher)


ASA 5510


VRF-lite Approach

The situation is similar with this approach. There is still a T1/E1 circuit you need to dedicate only for public server access and there is a separate DSL/Cable/Wireless connection for LAN. Following is the network design.

General Ideas and Considerations

* Each of the T1/E1 circuit and DSL/Cable/Wireless connection connects to different network or even different ISP
* There are two networks that the router manages, which are the Public server network and LAN
* The Public server network only uses the T1/E1 circuit to connect to the Internet. The Public server network can never use the DSL/Cable/Wireless connection to access the Internet.
* The LAN only uses the DSL/Cable/Wireless connection to browse the Internet. The LAN can never use the T1/E1 circuit to access the Internet.
* The LAN users must go through the Internet to access the Public server network. There is no direct connection internally within the router to connect the LAN and the Public server network.
* Both of Public server network and LAN uses Private subnet internally
* The router acts as NAT/PAT device for Private-Public IP Subnet translation
* The router run Zone-Based Firewall for security
* There are three public-accessible servers within the Public server network which are FTP, Mail, and Web
* Zone-Based Firewall inspects all outbound traffic (from Public server network or from LAN to the Internet) and their returning traffic
* Zone-Based Firewall also inspect all inbound traffic (from the Internet to the Public server network)

VRF-aware Zone-Based Firewall Sample Configuration

1. Router (i.e. 1841, 2621XM, etc.)


2. Switch (i.e. Catalyst 2950, 2960, etc.)


Some Discussions

http://www.dslreports.com/forum/r26816107-HELP-Question-about-Cisco-DMZ-setup


by aryoba See Profile
last modified: 2012-02-27 19:35:22