This document describes IP profiles and filters and how to set them up. It also provides information on entering filter commands. It includes the following sections:
Introducing IP Filters
Entering IP Filtering Commands
Configuring IP Filters
IP Filter Commands
Introducing IP Filters
IP filters start by blocking all traffic. You then create a collection of filters to allow traffic based on your organization's security policy. You can allow access to specific internal network resources, and you can also allow internal clients to access services outside your corporate network.
Once you set up your filters, you can test and troubleshoot them using Event Logging System (ELS) messages. You can also set up filters to generate ELS messages.
Profile Overview
A profile implements a policy that controls access to your network. You can set up profiles to provide access to specific resources in a private network for a user or group of users. You can also set up profiles that let users inside your private network have access to public networks, while keeping your private network secure.
Once you set up a profile, you associate the profile with an interface. The interface consults the filters in its associated profiles on each incoming and outgoing packet.
Filter Overview
A profile contains a collection of filters. A filter includes pattern matchers that determine which packets the filter recognizes, as well as actions the filter takes when it recognizes a packet. A filter can pass, block, ignore the packet, or generate an ELS event.
Table 1 describes the pattern matching properties:
Entering IP Filtering Commands
IP Filtering Prompts
IP filtering commands are available at the IP Filters Config> prompt and the IP Filters> prompt. This section explains the differences between these two prompts.
At the IP Filters Config> prompt, changes that you make to the filter configuration are saved in the router's configuration memory. These changes do not take effect until you restart the router.
Display the IP Filters Config> prompt as follows:
*configAt the IP Filters> prompt, changes that you make to the filter configuration take effect immediately. Unless you explicitly save your changes using the save command, they are not saved when you restart the router. Display the IP Filters> prompt as follows:
Config>PROTOCOL ip
Internet protocol user configuration
IP config>FILTERS
IP Filters Config>
*monitor
+PROTOCOL ip
IP>FILTERS
IP Filters>
IP Filter Config>add filter Firewall.ClientIn this example, Firewall is the profile name, Client is the filter name.
IP Filters Config>add profile firewall
IP Filters Config>set interface 1 profile=firewallNote: Attaching empty profiles to an interface blocks all activity until you add filters that allow specific traffic.
IP Filters Config>scope firewall
IP Filters Config firewall>
IP Filters Config firewall>add filter webout dir=out source=128.185.0.2
IP Filters Config firewall>list filter weboutListing Filters
Name Dir Address Port Protocol Action
-----------------------------------------------------------------------
webout Out sa=128.185.0.2 Any Pass
IP Filters Config firewall>set filter webout sport=HTTP
IP Filters Config firewall>list filter weboutListing Filters
Name Dir Address Port Protocol Action
-----------------------------------------------------------------------
webout Out sa=128.185.0.2 sp=HTTP(80) TCP Pass
IP Filters Config firewall>unscope
IP Filters Config>
IP Filters Config>exit
IP config>exit
Config> CTRL P
*restartIf you set up the filters at the monitoring prompt, the filters take effect immediately. Use the save command to make the changes permanent.IP Filters>save
Press SPACE twice after you type a command to display the available options for each command. [C] means the command is available at the IP Filters Config> prompt. [M] means the command is available at the IP Filters> prompt.
Add Filter [C] [M]
Creates a new filter and lets you assign properties to the filter. You can change or add to these properties later using the set filter command. The add filter and set filter commands use the same options.
You can add one or more filters to a profile. See Entering Profile and Filter Names for instructions on entering profile and filter names.
Add filters by entering the profile name followed by the name of the new filter. Use periods to separate the profile and filter names. You can also use the scope command to add filters without retyping the profile name. Syntax: add filter profilename.filtername
Example:add filter External.clientSyntax: add filter profilename.filtername Example:
add filter tftp.outUse the following filter options with either the add filter command or the set filter command. You can enter the options in almost any order, with some exceptions. For example, you cannot specify the packet type until the software identifies the protocol. These requirements are noted where relevant.
add filter tftp.client action=block
| Entry | Description |
|---|---|
| filtername | Places the filter after this filter. |
| * | Places the filter at the end of the list. |
add profile external
scope external
add filter client1
add filter client2
add filter client3
add filter client4 after=client1
set filter client2 after=*
list filter
Listing Filters
Name Dir Address Port Protocol Action
---------------------------------------------------------------------------
client1 In Any Pass
client4 In Any Pass
client3 In Any Pass
client2 In Any Pass
add profile firewall
scope firewall
add filter client1
add filter client2
add filter client3
add filter client4 before=*
set filter client3 before=client2
list filter
Listing Filters
Name Dir Address Port Protocol Action
---------------------------------------------------------------------------
client4 In Any Pass
client1 In Any Pass
client3 In Any Pass
client2 In Any Pass
| Enter . . . | To . . . |
|---|---|
| destination= | Replace existing destination addresses. |
| destination+= | Add one or more destination addresses. |
| destination-= | Remove one or more destination addresses. |
Syntax: destination= ipaddress
ipaddress&mask
ipaddress-ipaddress
ipaddress-ipaddress&mask
list
add filter External_Client.out dest=128.185.22.0-
128.185.25.0&255.255.255.0
IP Filters Config>add filter allow.ping dir=both source=162.1.0.0&255.0.0.0 protocol=icmp ptype=echo replyWhen the software compares this filter to outgoing packets, it looks for a destination address of 162.1.0.0&255.0.0.0 and a packet type of echo request. Syntax: direction= in
| Entry | Description |
|---|---|
| in | Inbound traffic. |
| out | Outbound traffic. |
| both | Both inbound and outbound traffic. |
add filter Internal.Response direction=in
dport=http,dns
dport=http,20-21
| Enter . . . | To . . . |
|---|---|
| dport= | Replace existing destination ports. |
| dport+= | Add one or more destination ports. |
| dport-= | Remove one or more destination ports. |
Syntax: dport=name
number
number-number
list
transient
add filter internal.client dport=ftp,telnet,smtpExample:
add filter internal.client dport=ftp,23,25Example:
add filter internal.client protocol=tcp dport=20-21,23,25
add filter external.in elsevent=8
| %a | Source Address |
| %A | Destination Address |
| %p | Source Port |
| %P | Destination Port |
| %d | Direction |
| %r | Protocol |
| %t | Packet Type |
Be sure to put double quotation marks around the text. Syntax: elstext="text"
Example:add filter external.in elsevent=8 elstext= "packet from %a
going to %A blocked"When this filter recognizes a packet, it generates a message similar to this:
FLT.018 IPDF-8 packet from 128.185.22.2 going to 162.1.1.8 blocked
add filter External.Client tag=12
| Entry | Description |
|---|---|
| name | The name of a well-known protocol. |
| number | A protocol number. |
| any | Any protocol. |
add filter firewall.ftpclient protocol=tcp
IP Filters Config>add filter webaccess protocol=tcp ptype= ?To see ICMP packet types, enter the following:
Matches the packet type.
The choices/prefixes are (a complete list):
Any
DAT
ACK
ACK*
FIN
FIN+ACK
PSH+ACK
RST
SYN
SYN+ACKNote: The packet type ACK* recognizes an acknowledgment packet plus any other type of TCP packet.
IP Filters Config>add filter allow.ping protocol=icmp ptype= ?Syntax: ptype=packettype
Matches the packet type.
The choices/prefixes are (a complete list):
Any
Addr Mask Request
Addr Mask Reply
Dest Unreachable
Echo Request
Echo Reply
Parameter Problem
Ping
Redirect
Source Quench
Time Exceeded
Timestamp Request
Timestamp ReplyNote: Ping is a special packet type that recognizes both Echo Request and Echo Reply packets.
| Entry | Description |
|---|---|
| packettype | A specific packet type. |
| any | Any packet type. |
add filter internal.user protocol=icmp ptype=ping
| Enter . . . | To . . . |
|---|---|
| source= | Replace existing source addresses. |
| source+= | Add one or more source addresses. |
| source-= | Remove one or more source addresses. |
See the destination option for more information on how to enter addresses.
Syntax: source= ipaddress
ipaddress&mask
ipaddress-ipaddress
ipaddress-ipaddress&mask
list
add filter External_Client.in source=128.185.22.0-
128.185.25.0&255.255.255.0
| Enter . . . | To . . . |
|---|---|
| sport= | Replace existing source ports. |
| sport+= | Add one or more source ports. |
| sport-= | Remove one or more source ports. |
Syntax: sport= name
number
number-number
list
transient
add filter External.Client sport=FTP_Control
You can assign tag numbers from 0 (zero) to 64. If you set tag=0, the router does not tag packets that match this filter. Syntax: tag=number
Example:add filter External.Client tag=12
Syntax: add profile profilename
Example:add profile webaccess
delete filter Inbound.user1
delete profile Client_In
list attached
Listing Interface Information
Interface Attached Profiles
--------------------------------
1 firewall1
2 firewall2
list attached 2
Listing Interface Information
Interface Attached Profiles
--------------------------------
2 firewall2
list filter
Listing FiltersExample:
Name Dir Address Port Protocol Action
---------------------------------------------------------------------------
firewall.webaccess Both ida=1.1.1.1 idp=HTTP(80) TCP Pass
allow.ftp In da=10.50.1.8 sp=FTP_DATA(20) Pass
dp=FTP_CONTROL(21)
TCP
list filter firewall
Listing FiltersExample:
Name Dir Address Port Protocol Action
---------------------------------------------------------------------------
webaccess Both ida=1.1.1.1 idp=HTTP(80) TCP Pass
icout Out sp=transient TCP Pass
list filter firewall.webaccess
Listing Filters
Name Dir Address Port Protocol Action
---------------------------------------------------------------------------
webaccess Both isa=1.1.1.1 isp=HTTP(80) TCP Pass
list interface
Listing Interface InformationExample:
Interface Attached Profiles
--------------------------------
1 firewall1
2 firewall2
Listing Filters Attached to Interface 1
Name Dir Address Port Protocol Action
---------------------------------------------------------------------------
firewall1.webin In da=1.1.1.1 dp=HTTP(80) TCP Pass
firewall1.webout Out sa=1.1.1.1 sp=HTTP(80) TCP Pass
Listing Filters Attached to Interface 2
Name Dir Address Port Protocol Action
---------------------------------------------------------------------------
firewall2.icout Out sp=transient TCP Pass
firewall2.icresp In sa=destination sp=dport TCP Pass
da=source dp=sport
list interface 2
Listing Interface Information
Interface Attached Profiles
--------------------------------
2 firewall2
Listing Filters Attached to Interface 2
Name Dir Address Port Protocol Action
---------------------------------------------------------------------------
firewall2.icout Out sp=transient TCP Pass
firewall2.icresp In sa=destination sp=dport TCP Pass
da=source dp=sport
list profile
Listing Profiles
Firewall
NoSpoof
InternalClient
rename filter Firewall.Client_In Client_Out
rename profile Client_In Client_Out
revert
save
IP Filters Config>add filter firewall.tftpcUsing the example above, scope the profile firewall and enter commands that apply to that profile. Enter unscope to stop applying commands to the profile. Note that when a scope is active, its name appears in the command prompt.
IP Filters Config>set filter firewall.tftpc dir=in dest=10.2.50.8
IP Filters Config>set filter firewall.tftpc protocol=tcp dport=ftp
IP Filters Config>scope firewallSyntax: scope profilename Example:
IP Filters Config firewall>add filter tftpc
IP Filters Config firewall>set filter tftpc dir=in dest=10.2.50.8
IP Filters Config firewall>set filter tftpc protocol=tcp dport=ftp
IP Filters Config firewall>unscope
IP Filters Config>
scope firewall
IP Filters Config firewall>
set filter tftp.client dir=in protocol=udp sport=tftp
Syntax: set interface interface# profiles=profilenames
Example:set interface 2 profiles=a,b,c,d
This example attaches profiles a, b, c, and d to interface 2.
set interface 2 profiles+=a,x,c
This example adds profiles a, x, and c to the end of the list of profiles attached to this interface. It replaces old entries that are duplicates of the new entries. The previous list a,b,c,d now becomes list b,d,a,x,c.
set interface 2 profiles-=c,a
This example removes profiles c and a, and results in the list b,d,x.
IP Filter Config firewall>unscope
IP Filter Config>
exit