Appendix A: Configuring Firewalls for a VPN Server Running Windows Server 2003

Applies To: Windows Server 2003 with SP1

The following are common configurations of firewalls with a VPN server:

  • The VPN server is attached to the Internet and the firewall is between the VPN server and the intranet.

  • The firewall is attached to the Internet and the VPN server is between the firewall and the intranet.

  • Two firewalls are used: one between the VPN server and the intranet and one between the VPN server and the Intranet.

VPN Server in Front of the Firewall

To secure the VPN server from sending or receiving any traffic on its Internet interface except VPN traffic, you need to configure PPTP or L2TP/IPSec input and output filters on the interface that corresponds to the connection to the Internet. Because IP routing is enabled on the Internet interface, if PPTP or L2TP/IPSec filters are not configured on the Internet interface, then any traffic received on the Internet interface is routed, which may forward unwanted Internet traffic to your intranet.

When the VPN server is in front of the firewall attached to the Internet, you need to add packet filters to the Internet interface that allow only VPN traffic to and from the IP address of the VPN server's Internet interface.

For inbound traffic, when the VPN server decrypts the tunneled data, it is forwarded to the firewall. The firewall in this configuration is acting as a filter for intranet traffic and can prevent specific resources from being accessed, scan data for viruses, perform intrusion detection, and other functions.

Because the only Internet traffic allowed on the intranet must pass through the VPN server, this approach also prevents the sharing of File Transfer Protocol (FTP) or Web intranet resources with non-VPN Internet users.

Figure 3 shows the VPN server in front of the firewall.

Art Image

Figure 3: The VPN server in front of the firewall

The firewall is configured for the appropriate rules for intranet traffic to and from VPN clients according to your network security policies.

For the Internet interface on the VPN server, configure the following input and output filters using the Routing and Remote Access snap-in. These filters are automatically configured when you run the Routing and Remote Access Server Setup Wizard and choose the Remote access (dial-up or VPN) option, select the correct interface, and select the Enable security on the selected interface by setting up packet filters option on the VPN Connection page (enabled by default).

Packet Filters for PPTP

Configure the following input filters with the filter action set to Drop all packets except those that meet the criteria below:

  • Destination IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and TCP destination port of 1723.

  • This filter allows PPTP tunnel management traffic to the VPN server.

  • Destination IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and IP Protocol ID of 47.

  • This filter allows PPTP tunneled data to the VPN server.

  • Destination IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and TCP [established] source port of 1723.

    This filter is required only when the VPN server is acting as a VPN client (a calling router) in a site-to-site (also known as router-to-router) VPN connection. TCP [established] traffic is accepted only when the VPN server initiated the TCP connection.

Configure the following output filters with the filter action set to Drop all packets except those that meet the criteria below:

  • Source IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and TCP source port of 1723.

  • This filter allows PPTP tunnel management traffic from the VPN server.

  • Source IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and IP Protocol ID of 47.

  • This filter allows PPTP tunneled data from the VPN server.

  • Source IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and TCP [established] destination port of 1723.

    This filter is required only when the VPN server is acting as a VPN client (a calling router) in a router-to-router VPN connection. TCP [established] traffic is sent only when the VPN server initiated the TCP connection.

Packet Filters for L2TP/IPSec

Configure the following input filters with the filter action set to Drop all packets except those that meet the criteria below:

  • Destination IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and UDP destination port of 500.

    This filter allows Internet Key Exchange (IKE) traffic to the VPN server.

  • Destination IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and UDP destination port of 4500.

    This filter allows IPSec NAT-T traffic to the VPN server.

  • Destination IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and UDP destination port of 1701.

    This filter allows L2TP traffic to the VPN server.

Configure the following output filters with the filter action set to Drop all packets except those that meet the criteria below:

  • Source IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and UDP source port of 500.

    This filter allows IKE traffic from the VPN server.

  • Source IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and UDP source port of 5500.

    This filter allows IPSec NAT-T traffic from the VPN server.

  • Source IP address of the VPN server's Internet interface, subnet mask of 255.255.255.255, and UDP source port of 1701.

    This filter allows L2TP traffic from the VPN server.

There are no filters required for IPSec Encapsulating Security Protocol (ESP) traffic for the IP protocol of 50. The Routing and Remote Access service filters are applied after the IPSec components remove the ESP header.

VPN Server Behind the Firewall

In a more common configuration, the firewall is connected to the Internet and the VPN server is an intranet resource that is connected to the perimeter network, also known as a screened subnet. The perimeter network is an IP network segment that contains resources that are available to Internet users, such as Web and FTP servers. The VPN server has an interface on both the perimeter network and the intranet. In this approach, the firewall must be configured with input and output filters on its Internet interface that allows the passing of tunnel maintenance traffic and tunneled data to the VPN server. Additional filters can allow the passing of traffic to Web, FTP, and other types of servers on the perimeter network. For an added layer of security, the VPN server can also be configured with PPTP or L2TP/IPSec packet filters on its perimeter network interface.

The firewall in this configuration is acting as a filter for Internet traffic and can confine the incoming and outgoing traffic to the specific resources on the perimeter network, perform intrusion attempt detection, prevent denial of service attacks, and other functions.

Because the firewall does not have the encryption keys for each VPN connection, it can only filter on the plaintext headers of the tunneled data. In other words, all tunneled data passes through the firewall. This is not a security concern, however, because the VPN connection requires an authentication process that prevents unauthorized access beyond the VPN server.

Figure 4 shows the VPN server behind the firewall on the perimeter network.

Art Image

Figure 4: The VPN server behind the firewall on the perimeter network

For both the Internet and network perimeter interfaces on the firewall, configure the following input and output filters using the firewall's configuration software.

Packet Filters for PPTP

Separate input and output packet filters can be configured on the Internet interface and the perimeter network interface.

Filters on the Internet Interface

Configure the following input packet filters on the Internet interface of the firewall to allow the following types of traffic:

  • Destination IP address of the VPN server's perimeter network interface and TCP destination port of 1723 (0x6BB).

    This filter allows PPTP tunnel management traffic to the VPN server.

  • Destination IP address of the VPN server's perimeter network interface and IP Protocol ID of 47 (0x2F).

    This filter allows PPTP tunneled data to the VPN server.

  • Destination IP address of the VPN server's perimeter network interface and TCP source port of 1723 (0x6BB).

    This filter is required only when the VPN server is acting as a VPN client (a calling router) in a router-to-router VPN connection. This filter should only be used in conjunction with PPTP packet filters described in "VPN Server in Front of the Firewall" and configured on the VPN server's network perimeter interface. By allowing all traffic to the VPN server from TCP port 1723, there exists the possibility of network attacks from sources on the Internet that use this port.

Configure the following output filters on the Internet interface of the firewall to allow the following types of traffic:

  • Source IP address of the VPN server's perimeter network interface and TCP source port of 1723 (0x6BB).

    This filter allows PPTP tunnel management traffic from the VPN server.

  • Source IP address of the VPN server's perimeter network interface and IP Protocol ID of 47 (0x2F).

    This filter allows PPTP tunneled data from the VPN server.

  • Source IP address of the VPN server's perimeter network interface and TCP destination port of 1723 (0x6BB).

    This filter is required only when the VPN server is acting as a VPN client (a calling router) in a router-to-router VPN connection. This filter should only be used in conjunction with PPTP packet filters described in "VPN Server in Front of the Firewall" and configured on the VPN server's network perimeter interface. By allowing all traffic from the VPN server to TCP port 1723, there exists the possibility of network attacks from sources on the Internet using this port.

Filters on the Perimeter Network Interface

Configure the following input filters on the perimeter network interface of the firewall to allow the following types of traffic:

  • Source IP address of the VPN server's perimeter network interface and TCP source port of 1723 (0x6BB).

    This filter allows PPTP tunnel management traffic from the VPN server.

  • Source IP address of the VPN server's perimeter network interface and IP Protocol ID of 47 (0x2F).

    This filter allows PPTP tunneled data from the VPN server.

  • Source IP address of the VPN server's perimeter network interface and TCP destination port of 1723 (0x6BB).

    This filter is required only when the VPN server is acting as a VPN client (a calling router) in a router-to-router VPN connection. This filter should only be used in conjunction with PPTP packet filters described in "VPN Server in Front of the Firewall" and configured on the VPN server's network perimeter interface. By allowing all traffic from the VPN server to TCP port 1723, there exists the possibility of network attacks from sources on the Internet using this port.

Configure the following output packet filters on the perimeter network interface of the firewall to allow the following types of traffic:

  • Destination IP address of the VPN server's perimeter network interface and TCP destination port of 1723 (0x6BB).

    This filter allows PPTP tunnel management traffic to the VPN server.

  • Destination IP address of the VPN server's perimeter network interface and IP Protocol ID of 47 (0x2F).

    This filter allows PPTP tunneled data to the VPN server.

  • Destination IP address of the VPN server's perimeter network interface and TCP source port of 1723 (0x6BB).

    This filter is required only when the VPN server is acting as a VPN client (a calling router) in a router-to-router VPN connection. This filter should only be used in conjunction with PPTP packet filters described in "VPN Server in Front of the Firewall" and configured on the VPN server's network perimeter interface. By allowing all traffic to the VPN server from TCP port 1723, there exists the possibility of network attacks from sources on the Internet using this port.

Packet Filters for L2TP/IPSec

Separate input and output packet filters can be configured on the Internet interface and the perimeter network interface.

Filters on the Internet Interface

Configure the following input packet filters on the Internet interface of the firewall to allow the following types of traffic:

  • Destination IP address of the VPN server's perimeter network interface and UDP destination port of 500 (0x1F4).

    This filter allows IKE traffic to the VPN server.

  • Destination IP address of the VPN server's perimeter network interface and UDP destination port of 4500 (0x1194).

    This filter allows IPSec NAT-T traffic to the VPN server.

  • Destination IP address of the VPN server's perimeter network interface and IP Protocol ID of 50 (0x32).

    This filter allows IPSec ESP traffic to the VPN server.

Configure the following output packet filters on the Internet interface of the firewall to allow the following types of traffic:

  • Source IP address of the VPN server's perimeter network interface and UDP source port of 500 (0x1F4).

    This filter allows IKE traffic from the VPN server.

  • Source IP address of the VPN server's perimeter network interface and UDP source port of 4500 (0x1194).

    This filter allows IPSec NAT-T traffic from the VPN server.

  • Source IP address of the VPN server's perimeter network interface and IP Protocol ID of 50 (0x32).

    This filter allows IPSec ESP traffic from the VPN server.

There are no filters required for L2TP traffic at the UDP port of 1701. All L2TP traffic at the firewall, including tunnel maintenance and tunneled data, is encrypted as an IPSec ESP payload.

Filters on the Perimeter Network Interface

Configure the following input packet filters on the perimeter network interface of the firewall to allow the following types of traffic:

  • Source IP address of the VPN server's perimeter network interface and UDP source port of 500 (0x1F4).

    This filter allows IKE traffic from the VPN server.

  • Source IP address of the VPN server's perimeter network interface and UDP source port of 4500 (0x1194).

    This filter allows IPSec NAT-T traffic from the VPN server.

  • Source IP address of the VPN server's perimeter network interface and IP Protocol ID of 50 (0x32).

    This filter allows IPSec ESP traffic from the VPN server.

Configure the following output packet filters on the perimeter network interface of the firewall to allow the following types of traffic:

  • Destination IP address of the VPN server's perimeter network interface and UDP destination port of 500 (0x1F4).

    This filter allows IKE traffic to the VPN server.

  • Destination IP address of the VPN server's perimeter network interface and UDP destination port of 4500 (0x1194).

    This filter allows IPSec NAT-T traffic to the VPN server.

  • Destination IP address of the VPN server's perimeter network interface and IP Protocol ID of 50 (0x32).

    This filter allows IPSec ESP traffic to the VPN server.

There are no filters required for L2TP traffic at the UDP port of 1701. All L2TP traffic at the firewall, including tunnel maintenance and tunneled data, is encrypted as an IPSec ESP payload.

VPN Server Between Two Firewalls

Another configuration is when the VPN server computer in placed on the perimeter network between two firewalls. The Internet firewall, the firewall between the Internet and the VPN server, filters all Internet traffic from all Internet clients. The intranet firewall, the firewall between the VPN server and the intranet, filters intranet traffic from VPN clients.

Figure 5 shows the VPN server between two firewalls on the perimeter network.

Art Image

Figure 5: The VPN server between two firewalls on the perimeter network

In this configuration:

  • Configure your Internet firewall and VPN server with the packet filters as described in the "VPN Server Behind the Firewall" section.

  • Configure your intranet firewall for the appropriate rules for intranet traffic to and from VPN clients according to your network security policies.