Configuring DDoS Protection
DDoS protection is enabled by default for all supported protocol groups and packet types. Devices have default values for bandwidth, bandwidth scale, burst, burst scale, priority, and recover time. To see the default policer values for all supported protocol groups and packet types, run the show ddos-protection protocols CLI command before modifying any configurable DDoS protection values.
You can change the DDoS configuration parameters as follows:
For individual packet types supported within a protocol group, you can change bandwidth, burst, and priority policer values.
For the aggregate policer for a protocol group, you can change bandwidth and burst policer values.
When you set bandwidth, burst, and priority values for a protocol group or packet type policer, the same values apply at all policer levels. Change the scaling configuration options to tune those values at the Packet Forwarding Engine level.
On PTX10003 routers, you can change default bandwidth and burst values for aggregate or packet type policers, but not priority values.
You can disable DDoS protection as follows:
On most routing devices that have policers at the Routing Engine level, you can disable DDoS protection at the Routing Engine and for all line cards either globally or for individual packet types within a protocol group.
On PTX10003 routers, although these devices include policers at the Routing Engine level, you can disable DDoS protection only at the line card level either globally or for individual packet types within a protocol group.
On other PTX Series routers and QFX Series switches, policers are supported only at the line cards, so on these devices you can disable DDoS protection for all line cards either globally or for individual packet types within a protocol group.
DDoS logging is enabled by default, but you can disable it globally for all DDoS events or for individual packet types within a protocol group. You can also configure tracing operations for monitoring DDoS events.
MX Series routers with MPCs and T4000 routers with FPC5s support DDoS protection. The CLI accepts the configuration if other line cards are also installed on either of these types of routers, but the other line cards are not protected so the router is essentially not protected.
To change default-configured DDoS protection parameters:
- (Optional) Configure global DDoS protection settings or disable DDoS protection.
- (Optional) Configure DDoS protection settings for the aggregate policer or individual packet types for the desired protocol groups.
- (Optional) Configure tracing for DDoS protection operations.
Disabling DDoS Protection Policers and Logging Globally
DDoS policers are enabled by default for all supported protocol groups and packet types.
On MX Series routers, T4000 routers, and EX9200 switches, policers are established at the level of the individual line card and the Routing Engine. You can disable the line card policers globally for all MPCs or FPC5s. You can also disable the Routing Engine policer. When you disable either of these policers, the policers at that level for all protocol groups and packet types are disabled.
On PTX Series routers and QFX Series switches, policers are established at the level of individual line cards only. If you disable line-card policers globally, DDoS protection is disabled on the switch.
PTX10003 routers include policers at the Routing Engine level, but like other PTX Series routers, you can only disable line-card policers.
DDoS logging is also enabled by default. You can disable all DDoS event logging (including flow detection event logging) for all protocol groups and packet types across the router or switch.
The global configuration for disabling policers and logging overrides any local configuration for packet types.
To configure global DDoS settings:
- (Optional) To disable line card policers:[edit system ddos-protection global]user@host# set disable-fpc
- (Optional) (Not available on PTX Series Routers or QFX
Series switches) To disable Routing Engine policers:[edit system ddos-protection global]user@host# set disable-routing-engine
- (Optional) To disable event logging:[edit system ddos-protection global]user@host# set disable-logging
Configuring DDoS Protection Aggregate or Individual Packet Type Policers
DDoS policers are applied to control packet traffic and are enabled by default for all supported protocol groups and packet types. You can change default policer parameters to configure different values for the maximum allowed traffic rate, maximum burst size, traffic priority, and how much time must pass since the last violation before the traffic flow is considered to have recovered from the attack. You can also scale the bandwidth and burst values for individual line cards so that the policers at this level trigger at lower thresholds than the overall protocol or packet thresholds.
Protocol group and packet type support varies across platforms and Junos OS releases, as follows:
For most routing devices, see protocols (DDoS).
For PTX Series routers and QFX Series switches, see protocols (DDoS) (PTX Series and QFX Series).
You can configure aggregate policer values for any protocol group. The aggregate policer applies to the combination of all types of control packet traffic for that group. For some protocol groups, you can also configure policer values for individual packet types. When you configure aggregate policer values for certain protocol groups, you can optionally bypass that policer for one or more particular packet types in that group.
Although all policers have default parameter values, these values might not accurately reflect the control traffic pattern of your network. We recommend that you model your network to determine the best values for your situation. Before you configure policers for your network, you can quickly view the default values for all packet types from operational mode using the show ddos-protection protocols parameters brief command. You can also use the command to specify a single protocol group of interest. For example, to see default values for the dhcpv4 protocol group, use the show ddos-protection protocols dhcpv4 parameters brief command.
You can disable a packet type policer at either the Routing Engine level (if supported) or at the Packet Forwarding Engine level for a specified line card or for all line cards. You can also disable logging of all DDoS events for individual packet types within a protocol group.
To configure the desired aggregate or packet-type DDoS protection policer settings:
- Specify the protocol group.[edit system ddos-protection protocols]user@host# edit protocol-group
For example, to specify the DHCPv4 protocol group on MX series or PTX10003 routers:
[edit system ddos-protection protocols]user@host# edit dhcpv4or, on PTX Series or QFX Series devices, DDoS protection support has a combined DHCPv4 and DHCPv6 option that allows only aggregate policer configuration:
[edit system ddos-protection protocols]user@host# edit dhcpv4v6 - Specify a supported individual packet type or the aggregate option to encompass
all packet types in the protocol group.[edit system ddos-protection protocols protocol-group]user@host# set packet-type
or
[edit system ddos-protection protocols protocol-group]user@host# set aggregateFor example, to specify only DHCPv4 release packets on devices that support individual DHCPv4 packet types:
[edit system ddos-protection protocols dhcpv4]user@host# edit release - (Optional) Configure the maximum traffic rate the policer
allows for the packet type (or aggregate).[edit system ddos-protection protocols protocol-group (aggregate | packet-type)]user@host# set bandwidth packets-per-second
For example, to set a bandwidth of 600 packets per second for DHCPv4 release packets:
[edit system ddos-protection protocols dhcpv4 release]user@host# set bandwidth 600 - (Optional) Configure the maximum number of packets of
this packet type (or aggregate) that the policer allows in a burst
of traffic.[edit system ddos-protection protocols protocol-group (aggregate | packet-type)]user@host# set burst size
For example, to set a maximum of 5000 DHCPv4 release packets:
[edit system ddos-protection protocols dhcpv4 release]user@host# set burst 5000 - (Optional) Set the traffic priority.
Note You can’t change default priority values on PTX10003 routers.
[edit system ddos-protection protocols protocol-group (aggregate | packet-type)]user@host# set priority levelFor example, to specify a medium priority for DHCPv4 release packets:
[edit system ddos-protection protocols dhcpv4 release]user@host# set priority medium - (Optional) Configure how much time must pass since the
last violation before the traffic flow is considered to have recovered
from the attack.[edit system ddos-protection protocols protocol-group (aggregate | packet-type)]user@host# set recover-time seconds
For example, to specify that 600 seconds must have passed since the last violation of the DHCPv4 release packet policer:
[edit system ddos-protection protocols dhcpv4 release]user@host# set recover-time 600 - (Optional, supported on some devices) Bypass the aggregate
policer configuration. This is applicable only when an aggregate policer
and an individual policer is configured for the protocol group.[edit system ddos-protection protocols protocol-group packet-type]user@host# set bypass-aggregate
For example, to bypass the aggregate policer for DHCPv4 renew packets:
[edit system ddos-protection protocols dhcpv4 renew]user@host# set bypass-aggregate - (Optional) Disable line card policers for the packet type
(or aggregate) on all line cards.[edit system ddos-protection protocols protocol-group (aggregate | packet-type)]user@host# set disable-fpc
Note When you disable line card policers globally at the [edit system ddos-protection global] hierarchy level, the global setting overrides the per-packet type setting shown in this step. If you subsequently remove the global configuration, then the per-packet type configuration takes effect.
For example, to disable the line card policer for DHCPv4 bootp packets:
[edit system ddos-protection protocols dhcpv4 bootp]user@host# set disable-fpc - (Optional) Disable DDoS event logging for only one packet
type (or aggregate).[edit system ddos-protection protocols protocol-group (aggregate | packet-type)]user@host# set disable-logging
Note Events disabled for the packet are associated with policer violations; logging of flow detection culprit flow events is not affected by this statement.
Note When you disable DDoS event logging globally at the [edit system ddos-protection global] hierarchy level, the global setting overrides the per-packet type setting shown in this step. If you subsequently remove the global configuration, then the per-packet type configuration takes effect.
For example, to disable DDoS event logging on the line card policer for DHCPv4 discover packets:
[edit system ddos-protection protocols dhcpv4 discover]user@host# set disable-logging - (Optional, not available on PTX Series Routers
or QFX Series switches) Disable the Routing Engine policer
for only this packet type.[edit system ddos-protection protocols protocol-group packet-type]user@host# set disable-routing-engine
Note When you disable the Routing Engine policer globally at the [edit system ddos-protection global] hierarchy level, the global setting overrides the per-packet type setting shown in this step. If you subsequently remove the global configuration, then the per-packet type configuration takes effect.
For example, to disable the Routing Engine policer for DHCPv4 discover packets:
[edit system ddos-protection protocols dhcpv4 discover]user@host# set disable-routing-engine - (Optional) Configure packet-level settings for the packet
type (or aggregate) on a single line card. On switches with a single,
fixed line card (a single FPC considered to be in slot 0 and labeled fpc0), scaling the policer values affects the entire switch.[edit system ddos-protection protocols protocol-group (aggregate | packet-type)]user@host# edit fpc slot-number
For example, to access DHCPv4 discover packet settings on the line card in slot 3:
[edit system ddos-protection protocols dhcpv4 discover]user@host# edit fpc 3 - (Optional) Scale the policer bandwidth for the packet
type (or aggregate) on the line card.[edit system ddos-protection protocols protocol-group (aggregate | packet-type) fpc slot-number]user@host# set bandwidth-scale percentage
For example, to scale the bandwidth to 80 percent of the all-line-card setting configured for DHCPv4 discover packets on the line card in slot 3:
[edit system ddos-protection protocols dhcpv4 discover fpc 3]user@host# edit bandwidth-scale 80 - (Optional) Scale the policer burst size for the packet
type (or aggregate) on the line card.[edit system ddos-protection protocols protocol-group (aggregate | packet-type) fpc slot-number]user@host# set burst-scale percentage
For example, to scale the maximum bandwidth to 75 percent of the all-line-card setting configured for DHCPv4 discover packets on the line card in slot 3:
[edit system ddos-protection protocols dhcpv4 discover fpc 3]user@host# edit burst-scale 75 - (Optional) Disable the line card policer for the packet
type (or aggregate) on a particular line card.[edit system ddos-protection protocols protocol-group (aggregate | packet-type) fpc slot-number]user@host# set disable-fpc
For example, to disable the line card policer for DHCPv4 discover packets on the line card in slot 3:
[edit system ddos-protection protocols dhcpv4 discover fpc 3]user@host# edit disable-fpc
See also
Verifying and Managing DDoS Protection
Purpose
View or clear information about DDoS configurations, states, and statistics.
Action
To display the DDoS policer configuration, violation state, and statistics for all packet types in all protocol groups:
user@host> show ddos-protection protocolsRun this command before you make any configuration changes to see the default policer values.
To display the DDoS policer configuration, violation state, and statistics for a particular packet type in a particular protocol group:
user@host> show ddos-protection protocols protocol-group packet-typeTo display only the number of DDoS policer violations for all protocol groups:
user@host> show ddos-protection protocols violationsTo display a table of the DDoS configuration for all packet types in all protocol groups:
user@host> show ddos-protection protocols parameters briefTo display a complete list of packet statistics and DDoS violation statistics for all packet types in all protocol groups:
user@host> show ddos-protection protocols statistics detailTo display global DDoS violation statistics:
user@host> show ddos-protection statisticsTo display the DDoS version number:
user@host> show ddos-protection versionTo clear DDoS statistics for all packet types in all protocol groups:
user@host> clear ddos-protection protocols statisticsTo clear DDoS statistics for all packet types in a particular protocol group:
user@host> clear ddos-protection protocols protocol-group statisticsTo clear DDoS statistics for a particular packet type in a particular protocol group:
user@host> clear ddos-protection protocols protocol-group packet-type statisticsTo clear DDoS violation states for all packet types in all protocol groups:
user@host> clear ddos-protection protocols statesTo clear DDoS violation states for all packet types in a particular protocol group:
user@host> clear ddos-protection protocols protocol-group statesTo clear DDoS violation states for a particular packet type in a particular protocol group:
user@host> clear ddos-protection protocols protocol-group packet-type states