Configure Hardware Filters on SwitchBlade x908,
x900-12XT/S, and x900-24 Series Switches
Introduction
The SwitchBlade x908, x900-12XT/S, and x900-24 series switches support a powerful
hardware based packet-filtering facility.
These switches can filter on a range of Layer 2, Layer 3, and Layer 4 packet attributes, and
perform a variety of different actions on the packets that match the filters.
Because the filters are hardware-based, they put no load on the CPU of the switch, and do
not affect the throughput of the switch. It is possible to configure over 1000 different filters,
and still have complete wire speed throughput on the switch.
On the AlliedWare Plus OS, hardware-based packet filtering is carried out by using hardware ACLs (Access Control Lists). The following configuration methods are available:
1. To make a simple filter based on IP address, MAC address, TCP/UDP port, or ICMP type,
you simply create one or more ACLs and apply them to a port.
You can build up a filter hierarchy by applying multiple ACLs to a port (e.g. make one ACL
to allow traffic from a source IP address to a destination address, then a second ACL to
drop all (other) traffic from that source IP address).
This How To Note calls ACLs that are applied to ports interface ACLs.
2. To make a filter based on a range of other packet settings, you use QoS match commands
in one or more QoS class-maps, mostly in combination with ACLs. Then you use QoS to
apply the class-maps to a policy-map and port.
This note describes both approaches. Then it gives a series of examples, and ends by
discussing how many filters you can make.
Blocking TCP sessions in one direction .................................................................................... 17
How many filters can you create? ...................................................................................................... 18
1. The filter rules table ................................................................................................................. 18
2. The profile (mask) ..................................................................................................................... 19
Are there enough bytes for your set of filters? .............................................................. 20
Some protocols also use filters, so use some of the length ........................................ 21
Which products and software version does this Note apply to?
zProducts: SwitchBlade x908, x900-12XT/S, and x900-24 series switches
zSoftware versions: 5.2.1-0.1 and above
Hardware filters are also available on Layer 3 switches running the AlliedWare OS. For
AlliedWare OS configurations, see the AlliedWare OS How To Notes:
zHow To Use the Hardware Filters on the AT-8948 and AT-9900 Series Switches
zHow To Configure Filtering Actions on QoS Flow Groups and Traffic Classes
These Notes are available from www.alliedtelesis.com/resources/literature/howto.aspx.
Page 2 | AlliedWare Plus™ OS How To Note
Creating hardware ACLs
Creating hardware ACLs
Hardware ACLs contain both the match criteria and the action to take on matching traffic.
There are two types of hardware ACL: IP address and MAC address. These are indexed by
their ID number. IP hardware ACLs have a number in the range 3000 to 3699 and MAC
hardware ACLs have a number in the range 4000 to 4699.
The following table shows the available ACL ranges as displayed by the ? help, and highlights
the hardware ACLs.
Number rangeDescription
1-99IP standard access list
100-199IP extended access list
1300-1999IP standard access list (expanded range)
2000-2699IP extended access list (expanded range)
3000-3699Hardware IP access list
4000-4699Hardware MAC access list
extendedNamed IP extended access list
standardNamed IP standard access list
The ACLs give you the following choice of actions to take on matching traffic (see “The
effects of the action keywords in ACLs” on page 6 for details).
Action parameterDescription
copy-to-cpuSpecify packets to copy to the CPU
copy-to-mirrorSpecify packets to copy to the mirror port
denySpecify packets to reject
permitSpecify packets to permit
send-to-cpuSpecify packets to send to the CPU
Creating IP hardware ACLs
IP hardware ACLs filter packets from the following IP protocols:
zIP
zICMP
zTCP
zUDP
This section describes how to create ACLs to filter packets from each of these protocols.
Page 3 | AlliedWare Plus™ OS How To Note
Creating hardware ACLs
IP packetsYou can filter IP packets on the basis of their source and/or destination IP addresses. The
command syntax is:
awplus(config)#access-list <3000-3699> <action> ip <source-ip-address>
<destination-ip-address>
The source and destination IP addresses can be any of the following:
za subnet. To specify this, enter the address and mask. You can specify the mask in slash
notation or with a wildcard (reverse) mask:
awplus(config)#access-list 3000 permit ip 192.168.0.0/16 ...
awplus(config)#access-list 3000 permit ip 192.168.0.0 0.0.255.255 ...
za single host. To specify this, enter the keyword host and then the address:
awplus(config)#access-list 3000 permit ip host 192.168.0.1 ...
zall source IPs or all destination IPs. To specify this, enter the keyword any:
awplus(config)#access-list 3000 permit ip any ...
ICMP packetsYou can filter ICMP messages on the basis of:
zsource IP address and/or destination IP address (using the same syntax as when filtering IP
packets)
zICMP message type, by specifying a type number. Popular types to filter include Echo Reply
(0), Echo Request (8), Redirect (5), Destination Unreachable (3), Traceroute (30), and
Time Exceeded (11)
To determine which ports to filter, use the following keywords:
KeywordSelectsExample
no keywordAll portsFor example, to match packets that use any TCP source or
destination port:
access-list 3000 permit tcp any any
eqA single portSpecify a single port number. For example, to match packets
from any IP address that use TCP source port 5100:
access-list 3000 permit tcp any eq 5100 any
Note that the TCP port parameter is optional. In this
example, the keyword any indicates that the ACL matches
on any source and destination IP address. The absence of a
port at the end of the command indicates that it matches on
any destination port.
gtAll ports higher than the
specified port number
ltAll ports lower than the
specified port number
neAll ports except the specified
port
rangeA contiguous range of portsSpecify the lowest and highest numbers in the range,
Specify a single port number. For example, to match packets
that use a source TCP port of 5100 or higher:
access-list 3000 permit tcp any gt 5099 any
Specify a single port number. For example, to match packets
that use a source TCP port of 5100 or lower:
access-list 3000 permit tcp any lt 5101 any
Specify a single port number. For example, to match packets
that use any source TCP port except port 5100:
access-list 3000 permit tcp any ne 5100 any
separated by a space. For example, to match packets that use
TCP source ports 5100 to 5200 inclusive:
access-list 3000 permit tcp any range 5100 5200 any
Page 5 | AlliedWare Plus™ OS How To Note
The effects of the action keywords in ACLs
Creating MAC address hardware ACLs
MAC address hardware ACLs filter packets on the basis of their source or destination MAC
address.
zall MAC addresses. To specify this, enter the keyword any:
awplus(config)#access-list 4000 permit any ...
The effects of the action keywords in ACLs
Let us consider the effect of each the possible action keywords.
ActionWhat it doesWhen do you need this action?
denyDrops the traffic.Use this when the filtering policy is to disallow certain
traffic flows.
permitForwards the traffic normally.Use this when you want to:
z discard a wide range of traffic, but still forward some
small subset of traffic within that range.
z use the ACL in a QoS class-map to select traffic for the
switch to apply QoS settings to (like queue shaping).
copy-to-cpuForwards the traffic normally, and
also sends a copy of each packet to
the CPU.
send-to-cpuDrops the traffic, but also sends a
copy of each packet to the CPU.
copy-to-mirrorForwards the traffic normally, and
also sends a copy of each packet to
the mirror port.
Use this when you want software monitoring of a certain
packet flow. If you want to log, or count, or output debug
pertaining to a certain stream, then create an ACL that
matches the packets in the stream, and specify the copyto-cpu action.
Use this when you want software monitoring of a certain
packet flow that is being dropped. If you want to log,
count, or output debug pertaining to a certain disallowed
stream, then create an ACL that matches the packets in
the stream, and specify the send-to-cpu action.
Use this when you want to mirror only a certain stream,
instead of mirroring all traffic on a port.
Page 6 | AlliedWare Plus™ OS How To Note
Making filters by applying hardware ACLs to ports
Making filters by applying hardware ACLs to ports
You can create a filter by simply applying one or more ACLs to a port, as long as you can
select the matching traffic through hardware ACL keywords, as described above.
ACLs can be applied to switch ports and static channel groups. To apply an ACL to a dynamic
(LACP) channel group, apply the ACL to all ports that can be in the channel group.
The hardware filters act on incoming traffic, so apply them to the ingress ports.
Attaching
ACLs
Viewing port
information
To apply ACLs to ports, enter interface mode for the port or ports you want to attach the
ACL to, and then use one of the following commands:
For IP hardware ACLs:
ip access-group <ip-acl-number>
For MAC hardware ACLs:
mac access-group <mac-acl-number>
If you have multiple ACLs on a port, attach them to the port in the order in which you want
the switch to check them—see “The logic of the operation of the hardware filters” on
page 13. You can alternate IP and MAC ACLs, like in the following example:
awplus(config-if)#ip access-group 3200
awplus(config-if)#ip access-group 3100
awplus(config-if)#mac access-group 4300
awplus(config-if)#ip access-group 3150
awplus(config-if)#mac access-group 4350
To see a list of the ACLs that are directly attached to a port, use the following command:
awplus#show interface <range> access-group
Changing
ACL order
It is not possible to change the order of ACLs once you have attached them to a port.
Instead, remove ACLs from the port by entering interface mode for the port and using the
commands:
no ip access-group <ip-acl-number>
no mac access-group <mac-acl-number>
Then re-enter them in the desired order.
Page 7 | AlliedWare Plus™ OS How To Note
Loading...
+ 14 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.