[Copyright 2002,2003 Frank Durda IV, All Rights Reserved. Mirroring of any material on this site in any form is expressly prohibited. The official web site for this material is: http://nemesis.lonestar.org Contact this address for use clearances: clearance at nemesis.lonestar.org Comments and queries to this address: web_reference at nemesis.lonestar.org]
To protect your network from spammers and hackers, and to make your
network an undesirable place for spammers to operate from, certain
filter rules can be installed in the routers of your network. For the
non-spammer, these filters are typically invisible and do not detract from
what the customer can do on the Internet.
There are a few situations where customers with special requirements or personal desires will run into some of these filters. Because of this, the filters demonstrated below are separated by function so that the filters that won't cause any fuss can be implemented promptly and the others can be applied on as much of your network as your customers demands and your company's stated Terms of Service allow.
These recommendations will work for the Internet Provider that has one router or a thousand routers, situated in one or a thousand locations. Just apply the same filtering rules shown to each router that controls access to the devices, access points and servers described below no matter where they occur on the entire network.
To demonstrate how to control this abusive activity using your network, a Hypothetical Internet Providers Network is shown below. It shows a subset of network structural components that almost always exist in the typical Internet Providers network. Those components that do not exist in your environment do not prevent you from utilizing all of these filters. Simply ignore the components and filters that are not applicable.
One of the most important network configuration requirements is that all of the mail servers exist in netblocks separate from netblocks used by customer connections and equipment. For larger Internet Providers, this is likely already the case, but in smaller Internet Providers that exist within a single netblock allocation, the IP addresses assigned to customer modems, customer dedicated lines, and customer web servers may all be intertwined with those addresses used for the Internet Providers mail servers. When mail servers are grouped or isolated, it will be easier to configure the filters in your routers.
The filter rules that are described here assume that your network is (or can be) divided into five categories:
Netblock | Function of equipment in this Netblock |
---|---|
16.2.4.8/30 | A connectivity provider interface (our side is .10). |
192.0.1.128/30 | Another connectivity provider interface (our side is .130. |
10.0.0.0/24 | The Core Network and other non-mail company servers. |
10.0.1.0/24 | The Internet Providers Servers |
10.0.1.0/28 | The Internet Providers Mail Servers (first 16 addresses of above). |
10.0.3.0/24 | Ethernet Interfaces of modem equipment. |
10.0.4.0/21 | Customer Static/Fixed IP Dedicated/Leased Line equipment (DSL, T1, Cable modem). |
10.0.8.0/21 | IP Pools for modems, Customer Dynamic IP equipment (DHCP, PPPOA, PPPOE) including non-Static DSL or Cable modems. |
192.168.6.0/22 | More modems and similar customer-accessible equipment. |
The following drawing shows how these networks are connected to the core router or routers in this example network:
To To To Upstream A Upstream B Modems |10.2.4.9 |192.0.1.129 |10.0.0.6 | | | | | | |16.2.4.10 |192.0.1.130 |10.0.0.5 |HSSI0/0/0 |HSSI0/0/1 |HSSI0/1/0 +-----------------------------------------------+ | | | | | Core Router(s) | | | | | +-----------------------------------------------+ |FastE1/0/0 |FastE1/1/0 |10.0.1.254 |10.0.0.33 | | | | | |10.0.0.34 To To ISP Customer Eqpt Servers DSL, T1, Cable
The device names shown in this example network were selected arbitrarily.
Regardless of whether it is multiple interfaces to serve modem equipment or multiple interfaces for uplinks or connectivity peering, or multiple interfaces to serve some other listed category of equipment, the same access lists containing the filtering rules shown below would be applied to each router interface that serves that stated type of equipment.
The following Cisco IOS router commands are used in this hypothetical network to establish the various interfaces, define what they are for, and bind the various IP addresses and netblocks to the appropriate interfaces. These commands also reference all of the filters applied to the interfaces. (The filters functions are described in a moment.)
Commands shown are grouped together by function, not in the order that they would appear in the Cisco IOS "show run" or "show config" display.
interface HSSI0/0/0 description Link to Upstream Provider A ip address 16.2.4.10 255.255.255.252 ip access-group from-internet in interface HSSI0/0/1 description Link to Upstream Provider B ip address 192.0.1.130 255.255.255.252 interface HSSI0/1/0 description Link to modem farm ip address 10.0.0.5 255.255.255.252 ip access-group to-general-customer-equipment out ip access-group from-general-customer-equipment in ip route 10.0.3.0 255.255.255.0 10.0.0.6 ip route 10.0.8.0 255.255.248.0 10.0.0.6 ip route 192.168.6.0 255.255.252.0 10.0.0.6 interface FastEthernet 1/0/0 description Link to ISP Servers ip address 10.0.1.254 255.255.255.0 interface FastEthernet 1/1/0 description Link to T1/DSL routers ip address 10.0.0.33 255.255.255.224 ip access-group from-general-customer-equipment in ip route 10.0.4.0 255.255.248/0 10.0.0.34 access-list compiled
Although this filter should be applied to all dynamic customer connections (where their IP address usually changes each time they reconnect), it should also be applied in cases where the Terms of Service prohibits some or all customers from operating servers. The filter blocks the ports used most frequently for server activity, and it also protects ports that are frequently used to gain unauthorized control of computers that use the Windows operating system. At the same time, the filter does not impede the ability of the authorized customers using these IP addresses to access servers located within or outside the filtered netblocks, including the Internet Providers' own servers and servers located out on the Internet.
This filter requires no changes on the part of servers or customer equipment, although any customers who were attempting to operate servers in these blocks on standard ports will now not be able to do so.
Whether the filter should be applied to DSL, cable modem and other leased line customers depends on the Terms of Service that you have established for these customers. It may be that a smaller set of filter rules should be applied to such lines, allowing these customers to run certain types of servers (such as HTTP/HTTPS), but still preventing access to the other potentially vulnerable ports on customer computers.
ip access-list extended to-general-customer-equipment deny tcp any 10.0.8.0 0.0.7.255 eq smtp deny tcp any 192.168.6.0 0.0.3.255 eq smtp deny tcp any 10.0.8.0 0.0.7.255 eq www deny tcp any 192.168.6.0 0.0.3.255 eq www deny tcp any 10.0.8.0 0.0.7.255 eq pop2 deny tcp any 192.168.6.0 0.0.3.255 eq pop2 deny tcp any 10.0.8.0 0.0.7.255 eq pop3 deny tcp any 192.168.6.0 0.0.3.255 eq pop3 deny tcp any 10.0.8.0 0.0.7.255 eq 139 deny tcp any 192.168.6.0 0.0.3.255 eq 139 deny tcp any 10.0.8.0 0.0.7.255 eq 194 deny tcp any 192.168.6.0 0.0.3.255 eq 194 deny tcp any 10.0.8.0 0.0.7.255 eq 443 deny tcp any 192.168.6.0 0.0.3.255 eq 443 deny tcp any 10.0.8.0 0.0.7.255 eq 1080 deny tcp any 192.168.6.0 0.0.3.255 eq 1080 deny tcp any 10.0.8.0 0.0.7.255 eq 8000 deny tcp any 192.168.6.0 0.0.3.255 eq 8000 deny tcp any 10.0.8.0 0.0.7.255 eq 8080 deny tcp any 192.168.6.0 0.0.3.255 eq 8080 permit ip any any
Note: Because new security flaws are found almost daily in the Windows Operating System, additional ports may need to be blocked to protect customer computers that are running these insecure operating systems.
For Internet Providers that use virtual POP (also known as "rent-a-POP") services where the IP traffic flows directly to the Internet (instead of passing through the Internet Providers network first), the Internet Provider should require that the above filter (or its functional equivalent) be installed in front of the virtual POPs modems to provide similar protection. In some virtual POP arrangements, these filters can be activated by remote control via instructions returned in RADIUS authentication records. Check with your virtual POP provider for what options they offer.)
All equipment residing in netblocks that use this filter must be configured to send mail to a designated SMTP mail server within the network that the filter allows access to.
ip access-list extended from-general-customer-equipment permit tcp 10.0.8.0 0.0.7.255 10.0.1.0 0.0.0.15 eq smtp permit tcp 192.168.6.0 0.0.3.255 10.0.1.0 0.0.0.15 eq smtp deny tcp 10.0.8.0 0.0.7.255 any eq smtp deny tcp 192.168.6.0 0.0.3.255 any eq smtp permit ip any any
This is a critical point: The server or servers that receive mail from the outside should apply stricter checking on that mail than the checks that are applied to mail received from local customers.
The reason customer mail typically has to be checked less-aggressively is that most customer mail software fails to send mail via SMTP that complies with rules mandated by RFC 2821 and other standards, although applying such checks to mail received from non-customer locations blocks large amounts of spam. (More details on filtering mail in the mail servers based on RFC 2821 is covered in another section.)
For larger ISPs, deploying two sets of mail servers with one set accepting SMTP traffic from non-customer locations and denies any third-party relaying (the MX servers), and a set of servers (the customer-accessible SMTP servers) that accept SMTP traffic from your customers and allows relaying only after the sender has identified themselves greatly simplifies mail server configuration. (Some mail server software has enough flexibility for a single machine to perform both functions.)
ip access-list extended from-internet permit tcp any 10.0.1.0 0.0.0.15 eq smtp deny tcp any any eq smtp permit ip any any
Section 7: Internet Provider Anti-Spam Mail Server Configuration (HTML) [NEXT] (NOT YET AVAILABLE)
The Anti-Spam Index (HTML)
[Copyright 2002,2003 Frank Durda IV, All Rights Reserved. Mirroring of any material on this site in any form is expressly prohibited. The official web site for this material is: http://nemesis.lonestar.org Contact this address for use clearances: clearance at nemesis.lonestar.org Comments and queries to this address: web_reference at nemesis.lonestar.org]
Visit the nemesis.lonestar.org home page and index