SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
Routing Policy and Firewall Filters
© 2010 Juniper Networks, Inc. All rights reserved. | www.juniper.net
What Is Routing Policy?
Routing policy controls the flow of routing information
to and from the routing table
•Use policy to accept, reject, or modify attributes for routes:
• Received through dynamic routing protocols
• Sent to dynamic routing protocols
• Installed in the forwarding table
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 2
• Installed in the forwarding table
NeighborsNeighborsNeighborsNeighbors
ProtocolProtocolProtocolProtocol
RoutingRoutingRoutingRouting
TableTableTableTable
ForwardingForwardingForwardingForwarding
TableTableTableTable
NeighborsNeighborsNeighborsNeighbors
ProtocolProtocolProtocolProtocol
ImportImportImportImport
RoutesRoutesRoutesRoutes RoutesRoutesRoutesRoutes
PFEPFEPFEPFE
ExportExportExportExport
ExportExportExportExport
Import policies control the route
importation into the routing table.
Export policies control the route
exportation from the routing table.
Default Routing Policies
ProtocolProtocolProtocolProtocol Import PolicyImport PolicyImport PolicyImport Policy Export PolicyExport PolicyExport PolicyExport Policy
BGP Accept all BGP routes and import
into inet.0
Accept all active BGP routes
OSPF Accept all OSPF routes and import
into inet.0
Reject everything (protocol
floods by default)
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 3
into inet.0 floods by default)
IS-IS Accept all IS-IS routes and import
into inet.0
Reject everything (protocol
floods by default)
RIP Accept all RIP routes from
explicitly configured neighbors and
import into inet.0
Reject everything
Building Blocks of Routing Policy
term firstterm
match
no match
thenfrom
my-policy
A routing policy consists of zero
or more terms; the software
evaluates terms sequentially
until it reaches a terminating
action or end of policy
User-defined policy
and term names
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 4
no match
no match
term secondterm
from then
term thirdterm
from then
match
match
from statements describe
match conditions
then statements describe
the actions to take if a match
with the from statement
occurs
Note: Ordering matters! If you must reorder terms within a policy, consider using the insert CLI command.
Common Match Criteria
Common match criteria for routing policy:
•Prefix (route-filter or prefix-list)
•Protocol (OSPF, static, BGP, and so forth)
•Routing protocol attributes:
• OSPF area ID, AS path, and community
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 5
•Next hop
term firstterm
match
thenfrom
Note: If you omit the from statement, all routes match and will take the specified action
from statements describe
match conditions
Prefix Lists
Prefix lists contain a list of prefixes:
•Configured under [edit policy-options] hierarchy
•Can be referenced in firewall filters and routing policy terms
[edit policy-options]
user@host# show
prefix-list rfc1918 {
10.0.0.0/8;
172.16.0.0/12;
prefix-list matches the prefix exactly
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 6
172.16.0.0/12;
192.168.0.0/16;
}
policy-statement policy-1 {
from {
prefix-list rfc1918;
}
then reject;
}
policy-statement policy-2 {
from {
prefix-list-filter rfc1918 orlonger reject;
}
}
prefix-list-filter allows match types
and actions. Supported match types include
exact, longer, and orlonger and are
covered on subsequent slides.
Route Filters
Route filters match individual routes within a policy:
•You can specify multiple route filters within a single term
•Not reusable—term-specific
[edit policy-options]
user@host# show
policy-statement policy-1 {
term reject-rfc1918-prefixes {
from {
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 7
from {
route-filter 172.16.0.0/12 orlonger;
route-filter 192.168.0.0/16 orlonger;
route-filter 10.0.0.0/8 orlonger;
}
then reject;
}
}
Note: Various match types are supported. We
discuss the match types on subsequent slides.
Match Types (1 of 3)
exact:
•Match the specified prefix and mask exactly
orlonger:
from route-filter 192.168.0.0/16 exact;
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 8
orlonger:
•Match the specified prefix and mask exactly and all routes
that are subsets of the prefix and that have longer masks
from route-filter 192.168.0.0/16 orlonger;
Match Types (2 of 3)
longer:
•Match routes that are subsets of the prefix and that have
longer masks;
•Do not match the specified prefix and mask
from route-filter 192.168.0.0/16 longer;
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 9
upto:
•Match specified prefix and mask exactly and any routes that
are subsets of the specified prefix and that have a mask no
longer than the second value specified
from route-filter 192.168.0.0/16 upto /24;
Match Types (3 of 3)
prefix-length-range:
•Match routes that are subsets of the specified prefix and
that have a mask between the two values (inclusive match)
through:
from route-filter 192.168.0.0/16 prefix-length-range /20-/24;
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 10
through:
•Match first and second specified prefixes and masks exactly
and all prefixes directly between the two prefixes
from route-filter 192.168.0.0/16 through 192.168.16.0/20;
Match Type Summary
Given a starting prefix of 192.168/16, what matches
with each option?
…
192.168/16192.168/16192.168/16192.168/16
…
192.168/16192.168/16192.168/16192.168/16
…
192.168/16192.168/16192.168/16192.168/16
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 11
exact
…
orlonger (down to /32)
… …
longer (down to /32)
through
…
…
192.168/16192.168/16192.168/16192.168/16
…
…
192.168/16192.168/16192.168/16192.168/16
/x
/y
prefix-length-range /x-/y
…
…
192.168/16192.168/16192.168/16192.168/16
upto
Common Actions
Common actions in routing policy:
•Terminating actions:
• accept
• reject
•Flow control:
• next term
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 12
• next term
• next policy
•Modifying attributes:
• community (add, delete, and set)
• preference
term firstterm
match
thenfrom
then statements describe
the actions to take if a match with
the from statement occurs
Implementing Routing Policy (1 of 2)
Definition of routing policy is always under the
[edit policy-options] hierarchy:
[edit policy-options]
user@host# show
policy-statement my-policy {
term accept-local-route {
from {
protocol local;
interface ge-0/0/0;
term firstterm
thenfrom
my-policy
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 13
interface ge-0/0/0;
}
then accept;
}
term accept-some-static-routes {
from {
protocol static;
route-filter 172.18.1.0/24 exact;
route-filter 172.18.2.0/24 exact;
}
then accept;
}
term accept-rip-routes {
from protocol rip;
then accept;
}
}
match
no match
no match
then
term secondterm
from then
term thirdterm
from then
from
match
match
Implementing Routing Policy (2 of 2)
You can apply routing policies as import or export
policies at different levels (protocol dependent)
[edit protocols ospf]
user@host# show
export my-policy;
area 0.0.0.0 {
interface ge-0/0/1.0;
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 14
interface ge-0/0/1.0;
interface ge-0/0/2.0;
interface ge-0/0/3.0 {
passive;
}
interface lo0.0;
}
Routing Policy Flow
You can chain routing policies together
•Evaluation proceeds left to right until the software reaches a
terminating action of accept or reject
•The software supports flow-control actions such as next
policy
RouteRouteRouteRoute
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 15
AcceptAcceptAcceptAccept
or rejector rejector rejector reject
AcceptAcceptAcceptAccept
or rejector rejector rejector reject
AcceptAcceptAcceptAccept
or rejector rejector rejector reject
Policy 1Policy 1Policy 1Policy 1
AcceptAcceptAcceptAccept
or rejector rejector rejector reject
AcceptAcceptAcceptAccept
or rejector rejector rejector reject
AcceptAcceptAcceptAccept
or rejector rejector rejector reject
Policy 2Policy 2Policy 2Policy 2
AcceptAcceptAcceptAccept
or rejector rejector rejector reject
PolicyPolicyPolicyPolicy nnnn
AcceptAcceptAcceptAccept
RejectRejectRejectReject
Term CTerm CTerm CTerm C Term CTerm CTerm CTerm C
DefaultDefaultDefaultDefault
policypolicypolicypolicy
Term ATerm ATerm ATerm A
Term BTerm BTerm BTerm B
Term ATerm ATerm ATerm A
Term BTerm BTerm BTerm B
Term ATerm ATerm ATerm A
Case Study: Objective and Topology
Advertise the default static route defined on R1 into
OSPF using routing policy:
.1.2
OSPFOSPFOSPFOSPF
Area 0Area 0Area 0Area 0
R1R1R1R1
R2R2R2R2
R4R4R4R4 InternetInternetInternetInternet
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 16
user@R1> show route protocol static
inet.0: 16 destinations, 16 routes (16 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:00:44
> to 172.30.25.1 via ge-0/0/1.0
.1.2
172.30.25.0/30172.30.25.0/30172.30.25.0/30172.30.25.0/30
R3R3R3R3
Case Study: Defining the Policy
Sample routing policy configuration used to advertise
R1’s default static route into OSPF:
[edit policy-options]
user@R1# show
policy-statement default-static {
term accept-default-static {
User-defined policy and term names
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 17
term accept-default-static {
from {
protocol static;
route-filter 0.0.0.0/0 exact;
}
then accept;
}
}
Match criteria
Action
Case Study: Applying the Policy
Sample application of routing policy used to advertise
R1’s default static route into OSPF:
[edit protocols ospf]
user@R1# show
export default-static;
area 0.0.0.0 { R1R1R1R1
R2R2R2R2
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 18
area 0.0.0.0 {
interface ge-0/0/2.0;
interface ge-0/0/3.0;
interface lo0.0;
}
Export default static route
from route table to OSPF
OSPFOSPFOSPFOSPF
Area 0Area 0Area 0Area 0
R1R1R1R1
R4R4R4R4
R3R3R3R3
Note: Once you define routing policy and apply
it, R1 floods an external LSA for the default static
route to all OSPF routers in Area 0.
Case Study: Monitoring the Results
Sample verification step to ensure the routing policy
works as expected (capture is taken from R4):
user@R4> show route protocol ospf exact 0/0
inet.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 19
0.0.0.0/0 *[OSPF/150] 00:03:33, metric 0, tag 0
> to 172.19.3.1 via ge-0/0/2.0
to 172.19.4.1 via ge-0/0/3.0
.1.2
172.30.25.0/30172.30.25.0/30172.30.25.0/30172.30.25.0/30
OSPFOSPFOSPFOSPF
Area 0Area 0Area 0Area 0
R1R1R1R1
R2R2R2R2
R4R4R4R4
R3R3R3R3
InternetInternetInternetInternet
R4 installs external default
OSPF route flooded by R1
What Is a Firewall Filter?
Firewall filters control the traffic entering and leaving
a networking device in a stateless fashion:
•Processes every packet independently
•Used to filter and monitor network traffic
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 20
Building Blocks of Firewall Filters
no match
term firstterm
match
thenfrom
my-filter
Firewall filters consist of one or
more terms; the software
evaluates terms sequentially until
it reaches a terminating action
User-defined filter
and term names
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 21
no match
no match
term secondterm
term Default
match
then statements describe the
actions to take if a match with
the from statement occurs
discard
Default action for packets
not explicitly allowed
Note: Ordering matters! If you must reorder terms within a filter, consider using the insert CLI command.
from statements describe
match conditions
thenfrom
Common Match Criteria
Can match based on most header fields:
Match conditions categories include:
•Numeric range
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 22
•Numeric range
•Address
•Bit field
term firstterm
match
thenfromfrom statements describe
match conditions
Firewall Filter Actions
Common actions in firewall filters:
•Terminating actions:
• accept
• discard
• Reject
•Flow control:
term firstterm
match
thenfrom
then statements describe the
actions to take if a match with the
from statement occurs
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 23
•Flow control:
• next term
•Action modifiers:
• count, log, and syslog
• forwarding-class and loss-priority
• Policer
The software discards all traffic not explicitly allowed!
Implementing Firewall Filters (1 of 2)
Define firewall filters based on protocol family under
the [edit firewall] hierarchy level:
[edit firewall family inet]
user@host# show
filter filter-in {
term block-some-packets {
from {
source-address {
The software applies
family inet filters
only to interfaces
running IPv4 term firstterm
thenfrom
my-policy
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 24
source-address {
10.10.10.0/24;
}
}
then {
count spoof-in;
discard;
}
}
term accept-others {
then accept;
}
}
…
If discard is not present
then packets are accepted
match
no match
no match
then
term secondterm
from then
term thirdterm
from then
from
match
match
Implementing Firewall Filters (2 of 2)
Apply firewall filters as input or output on an interface
•Protocol family on interface and filter must match:
The software applies firewall
[edit interfaces ge-0/0/1]
user@host# show
unit 0 {
family inet {
filter {
input filter-in;
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 25
The software applies firewall
filters using input and
output statements
input filter-in;
output filter-out;
}
address 172.30.25.2/30;
}
}
InputInputInputInput
InputInputInputInputOutputOutputOutputOutput
OutputOutputOutputOutput
Input firewall filters control
traffic entering an interface
Output firewall filters control
traffic leaving an interface
Tip: To avoid late night drives back to the office, use commit confirmed when activating filters!
Test Your Knowledge (1 of 2)
Apply a filter on R1’s ge-0/0/1.0 interface to allow
HTTP traffic to 172.27.102.100
•Should the filter be applied as an input or output filter?
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 26
.1.2
172.30.25.0/30172.30.25.0/30172.30.25.0/30172.30.25.0/30
172.27.102.0/24172.27.102.0/24172.27.102.0/24172.27.102.0/24
R1R1R1R1
ge-0/0/1.0.100.100.100.100 .1.1.1.1
MYNETMYNETMYNETMYNET
InternetInternetInternetInternet
filter web-server {
term allow-web-traffic {
from {
destination-address {
172.27.102.100/32;
}
protocol tcp;
Test Your Knowledge (2 of 2)
Which inbound traffic does the router permit?
Applied as an input filter
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 27
protocol tcp;
port http;
}
then accept;
}
term deny-other-web-traffic {
from {
protocol tcp;
port http;
}
then {
discard;
}
}
}
.2
172.27.102.0/24172.27.102.0/24172.27.102.0/24172.27.102.0/24
R1R1R1R1 ge-0/0/1.0.100.100.100.100 .1.1.1.1
MYNETMYNETMYNETMYNET
Filtering Local Traffic (1 of 2)
Apply filters to lo0 interface to filter local traffic
•Filter must account for routing and management protocols
Routing EngineRouting EngineRouting EngineRouting Engine
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 28
Frames/Packets InFrames/Packets InFrames/Packets InFrames/Packets In
Packet Forwarding EnginePacket Forwarding EnginePacket Forwarding EnginePacket Forwarding Engine
Control PlaneControl PlaneControl PlaneControl Plane
Forwarding PlaneForwarding PlaneForwarding PlaneForwarding Plane
CPUCPUCPUCPU
lo0
filter limit-ssh-access {
term ssh-accept {
from {
source-prefix-list {
trusted;
}
protocol tcp;
destination-port ssh;
}
then accept;
lo0 {
unit 0 {
family inet {
filter {
input limit-ssh-access;
}
address 10.255.71.48/32;
}
}
}
Filtering Local Traffic (2 of 2)
DefinitionDefinitionDefinitionDefinition ApplicationApplicationApplicationApplication
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 29
then accept;
}
term ssh-reject {
from {
protocol tcp;
destination-port ssh;
}
then {
discard;
}
}
term else-accept {
then accept;
}
}
}
Which problems might occur if you
omit the else-accept term?
Think About ItThink About ItThink About ItThink About It
Affects incoming traffic
destined to the routing engine!
Policing
Policing (rate-limiting) enables you to limit the amount
of traffic that passes into or out of an interface:
•Works with firewall filters to thwart DoS attacks
• Common actions include discard and setting loss-priority level
•Uses average bandwidth and maximum burst size
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 30
Bit BucketBit BucketBit BucketBit Bucket
[edit firewall]
user@host# show
policer p1 {
if-exceeding {
bandwidth-limit 400k;
burst-size-limit 100k;
}
then discard;
}
family inet {
filter rate-limit-subnet {
term match-subnet {
Configuration Example
bandwidth-limit
* In bits per second
* 30,520 bps to 4.29 Gbps
burst-size-limit
* In bytes
* Minimum should = 10
You must apply filter!
Policer defined
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 31
term match-subnet {
from {
source-address {
192.100.1.0/24;
}
}
then {
policer p1;
}
}
term else-accept {
then accept;
}
}
}
Note: Filter must account for routing
and management protocols
* Minimum should = 10
times MTU (low speed) or
bandwidth times 3–5
milliseconds (high speed)
Policer referenced
Routing Policy and Firewall Filters

Más contenido relacionado

La actualidad más candente

Vxlan control plane and routing
Vxlan control plane and routingVxlan control plane and routing
Vxlan control plane and routingWilfredzeng
 
Junos routing overview from Juniper
Junos routing overview from JuniperJunos routing overview from Juniper
Junos routing overview from JuniperNam Nguyen
 
Differences of the Cisco Operating Systems
Differences of the Cisco Operating SystemsDifferences of the Cisco Operating Systems
Differences of the Cisco Operating Systems美兰 曾
 
Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Canada
 
Brkmpl 2333
Brkmpl 2333Brkmpl 2333
Brkmpl 2333ronsito
 
Cisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
Cisco Live! :: Introduction to IOS XR for Enterprises and Service ProvidersCisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
Cisco Live! :: Introduction to IOS XR for Enterprises and Service ProvidersBruno Teixeira
 
Using GTP on Linux with libgtpnl
Using GTP on Linux with libgtpnlUsing GTP on Linux with libgtpnl
Using GTP on Linux with libgtpnlKentaro Ebisawa
 
Gpon Fundamentals
Gpon FundamentalsGpon Fundamentals
Gpon Fundamentalsmansoor_gr8
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThomas Graf
 
39018631 lte-overview
39018631 lte-overview39018631 lte-overview
39018631 lte-overviewcefer mecid
 
CCNAv5 - S3: Chapter 7 EIGRP
CCNAv5 - S3: Chapter 7 EIGRPCCNAv5 - S3: Chapter 7 EIGRP
CCNAv5 - S3: Chapter 7 EIGRPVuz Dở Hơi
 
CCNP Switching Chapter 1
CCNP Switching Chapter 1CCNP Switching Chapter 1
CCNP Switching Chapter 1Chaing Ravuth
 
Transitioning IPv4 to IPv6
Transitioning IPv4 to IPv6Transitioning IPv4 to IPv6
Transitioning IPv4 to IPv6Jhoni Guerrero
 

La actualidad más candente (20)

CCNA Lab Guide
CCNA Lab GuideCCNA Lab Guide
CCNA Lab Guide
 
Vxlan control plane and routing
Vxlan control plane and routingVxlan control plane and routing
Vxlan control plane and routing
 
CCIE Lab - IGP Routing
CCIE Lab -  IGP Routing  CCIE Lab -  IGP Routing
CCIE Lab - IGP Routing
 
Junos routing overview from Juniper
Junos routing overview from JuniperJunos routing overview from Juniper
Junos routing overview from Juniper
 
Differences of the Cisco Operating Systems
Differences of the Cisco Operating SystemsDifferences of the Cisco Operating Systems
Differences of the Cisco Operating Systems
 
Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Study: State of Web Security
Cisco Study: State of Web Security
 
Brkmpl 2333
Brkmpl 2333Brkmpl 2333
Brkmpl 2333
 
Cisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
Cisco Live! :: Introduction to IOS XR for Enterprises and Service ProvidersCisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
Cisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
 
Using GTP on Linux with libgtpnl
Using GTP on Linux with libgtpnlUsing GTP on Linux with libgtpnl
Using GTP on Linux with libgtpnl
 
Gpon Fundamentals
Gpon FundamentalsGpon Fundamentals
Gpon Fundamentals
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
 
Ospf.ppt
Ospf.pptOspf.ppt
Ospf.ppt
 
39018631 lte-overview
39018631 lte-overview39018631 lte-overview
39018631 lte-overview
 
Layer 3 redundancy hsrp
Layer 3 redundancy   hsrpLayer 3 redundancy   hsrp
Layer 3 redundancy hsrp
 
CCNAv5 - S3: Chapter 7 EIGRP
CCNAv5 - S3: Chapter 7 EIGRPCCNAv5 - S3: Chapter 7 EIGRP
CCNAv5 - S3: Chapter 7 EIGRP
 
Carrier Ethernet
Carrier EthernetCarrier Ethernet
Carrier Ethernet
 
Session 1
Session 1Session 1
Session 1
 
Fools your enemy with MikroTik
Fools your enemy with MikroTikFools your enemy with MikroTik
Fools your enemy with MikroTik
 
CCNP Switching Chapter 1
CCNP Switching Chapter 1CCNP Switching Chapter 1
CCNP Switching Chapter 1
 
Transitioning IPv4 to IPv6
Transitioning IPv4 to IPv6Transitioning IPv4 to IPv6
Transitioning IPv4 to IPv6
 

Similar a Routing Policy and Firewall Filters

Routing Polices And Firewall Filter
Routing Polices And Firewall FilterRouting Polices And Firewall Filter
Routing Polices And Firewall FilterKashif Latif
 
2008118090324 hk
2008118090324 hk2008118090324 hk
2008118090324 hkVivek Singh
 
NANOG 80: Measuring RPKI Effectiveness
NANOG 80: Measuring RPKI EffectivenessNANOG 80: Measuring RPKI Effectiveness
NANOG 80: Measuring RPKI EffectivenessAPNIC
 
BGP Route Leaks at Ripe74
BGP Route Leaks at Ripe74BGP Route Leaks at Ripe74
BGP Route Leaks at Ripe74Qrator Labs
 
WebRTC Standards & Implementation Q&A - WebRTC Constrains
WebRTC Standards & Implementation Q&A - WebRTC ConstrainsWebRTC Standards & Implementation Q&A - WebRTC Constrains
WebRTC Standards & Implementation Q&A - WebRTC ConstrainsAmir Zmora
 
Webinar: Incorporating New Throttling Features into Your Business
Webinar: Incorporating New Throttling Features into Your BusinessWebinar: Incorporating New Throttling Features into Your Business
Webinar: Incorporating New Throttling Features into Your BusinessWSO2
 
Motorola MotoTRBO Firmware 2.3A Release Notes (June 2014)
Motorola MotoTRBO Firmware 2.3A Release Notes (June 2014)Motorola MotoTRBO Firmware 2.3A Release Notes (June 2014)
Motorola MotoTRBO Firmware 2.3A Release Notes (June 2014)TwoWayDigitalRadio.com
 
Fully Realizing the Microservices Vision with Service Mesh (DEV312-S) - AWS r...
Fully Realizing the Microservices Vision with Service Mesh (DEV312-S) - AWS r...Fully Realizing the Microservices Vision with Service Mesh (DEV312-S) - AWS r...
Fully Realizing the Microservices Vision with Service Mesh (DEV312-S) - AWS r...Amazon Web Services
 
Network Policy Abstractions in OpenStack Neutron
Network Policy Abstractions in OpenStack NeutronNetwork Policy Abstractions in OpenStack Neutron
Network Policy Abstractions in OpenStack NeutronSumit Naiksatam
 
Lesson.7: Configuring IP Routing B
Lesson.7: Configuring IP Routing BLesson.7: Configuring IP Routing B
Lesson.7: Configuring IP Routing BMahmmoud Mahdi
 
Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Ram Vennam
 

Similar a Routing Policy and Firewall Filters (20)

Routing Polices And Firewall Filter
Routing Polices And Firewall FilterRouting Polices And Firewall Filter
Routing Polices And Firewall Filter
 
2008118090324 hk
2008118090324 hk2008118090324 hk
2008118090324 hk
 
Route Leak Prevension with BGP Community
Route Leak Prevension with BGP CommunityRoute Leak Prevension with BGP Community
Route Leak Prevension with BGP Community
 
NANOG 80: Measuring RPKI Effectiveness
NANOG 80: Measuring RPKI EffectivenessNANOG 80: Measuring RPKI Effectiveness
NANOG 80: Measuring RPKI Effectiveness
 
BGP Route Leaks at Ripe74
BGP Route Leaks at Ripe74BGP Route Leaks at Ripe74
BGP Route Leaks at Ripe74
 
WebRTC Standards & Implementation Q&A - WebRTC Constrains
WebRTC Standards & Implementation Q&A - WebRTC ConstrainsWebRTC Standards & Implementation Q&A - WebRTC Constrains
WebRTC Standards & Implementation Q&A - WebRTC Constrains
 
6978047_2.ppt
6978047_2.ppt6978047_2.ppt
6978047_2.ppt
 
CCCNP ROUTE v6_ch05
CCCNP ROUTE  v6_ch05CCCNP ROUTE  v6_ch05
CCCNP ROUTE v6_ch05
 
ENCOR_Chapter_6.pptx
ENCOR_Chapter_6.pptxENCOR_Chapter_6.pptx
ENCOR_Chapter_6.pptx
 
Webinar: Incorporating New Throttling Features into Your Business
Webinar: Incorporating New Throttling Features into Your BusinessWebinar: Incorporating New Throttling Features into Your Business
Webinar: Incorporating New Throttling Features into Your Business
 
Motorola MotoTRBO Firmware 2.3A Release Notes (June 2014)
Motorola MotoTRBO Firmware 2.3A Release Notes (June 2014)Motorola MotoTRBO Firmware 2.3A Release Notes (June 2014)
Motorola MotoTRBO Firmware 2.3A Release Notes (June 2014)
 
Session 3
Session 3Session 3
Session 3
 
CCCNP ROUTE v6_ch04
CCCNP ROUTE  v6_ch04CCCNP ROUTE  v6_ch04
CCCNP ROUTE v6_ch04
 
Fully Realizing the Microservices Vision with Service Mesh (DEV312-S) - AWS r...
Fully Realizing the Microservices Vision with Service Mesh (DEV312-S) - AWS r...Fully Realizing the Microservices Vision with Service Mesh (DEV312-S) - AWS r...
Fully Realizing the Microservices Vision with Service Mesh (DEV312-S) - AWS r...
 
Network Policy Abstractions in OpenStack Neutron
Network Policy Abstractions in OpenStack NeutronNetwork Policy Abstractions in OpenStack Neutron
Network Policy Abstractions in OpenStack Neutron
 
Lesson.7: Configuring IP Routing B
Lesson.7: Configuring IP Routing BLesson.7: Configuring IP Routing B
Lesson.7: Configuring IP Routing B
 
Apricot2004 bgp00
Apricot2004 bgp00Apricot2004 bgp00
Apricot2004 bgp00
 
Rfp template
Rfp templateRfp template
Rfp template
 
Group 1
Group 1Group 1
Group 1
 
Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019
 

Último

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Routing Policy and Firewall Filters

  • 1. Routing Policy and Firewall Filters © 2010 Juniper Networks, Inc. All rights reserved. | www.juniper.net
  • 2. What Is Routing Policy? Routing policy controls the flow of routing information to and from the routing table •Use policy to accept, reject, or modify attributes for routes: • Received through dynamic routing protocols • Sent to dynamic routing protocols • Installed in the forwarding table © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 2 • Installed in the forwarding table NeighborsNeighborsNeighborsNeighbors ProtocolProtocolProtocolProtocol RoutingRoutingRoutingRouting TableTableTableTable ForwardingForwardingForwardingForwarding TableTableTableTable NeighborsNeighborsNeighborsNeighbors ProtocolProtocolProtocolProtocol ImportImportImportImport RoutesRoutesRoutesRoutes RoutesRoutesRoutesRoutes PFEPFEPFEPFE ExportExportExportExport ExportExportExportExport Import policies control the route importation into the routing table. Export policies control the route exportation from the routing table.
  • 3. Default Routing Policies ProtocolProtocolProtocolProtocol Import PolicyImport PolicyImport PolicyImport Policy Export PolicyExport PolicyExport PolicyExport Policy BGP Accept all BGP routes and import into inet.0 Accept all active BGP routes OSPF Accept all OSPF routes and import into inet.0 Reject everything (protocol floods by default) © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 3 into inet.0 floods by default) IS-IS Accept all IS-IS routes and import into inet.0 Reject everything (protocol floods by default) RIP Accept all RIP routes from explicitly configured neighbors and import into inet.0 Reject everything
  • 4. Building Blocks of Routing Policy term firstterm match no match thenfrom my-policy A routing policy consists of zero or more terms; the software evaluates terms sequentially until it reaches a terminating action or end of policy User-defined policy and term names © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 4 no match no match term secondterm from then term thirdterm from then match match from statements describe match conditions then statements describe the actions to take if a match with the from statement occurs Note: Ordering matters! If you must reorder terms within a policy, consider using the insert CLI command.
  • 5. Common Match Criteria Common match criteria for routing policy: •Prefix (route-filter or prefix-list) •Protocol (OSPF, static, BGP, and so forth) •Routing protocol attributes: • OSPF area ID, AS path, and community © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 5 •Next hop term firstterm match thenfrom Note: If you omit the from statement, all routes match and will take the specified action from statements describe match conditions
  • 6. Prefix Lists Prefix lists contain a list of prefixes: •Configured under [edit policy-options] hierarchy •Can be referenced in firewall filters and routing policy terms [edit policy-options] user@host# show prefix-list rfc1918 { 10.0.0.0/8; 172.16.0.0/12; prefix-list matches the prefix exactly © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 6 172.16.0.0/12; 192.168.0.0/16; } policy-statement policy-1 { from { prefix-list rfc1918; } then reject; } policy-statement policy-2 { from { prefix-list-filter rfc1918 orlonger reject; } } prefix-list-filter allows match types and actions. Supported match types include exact, longer, and orlonger and are covered on subsequent slides.
  • 7. Route Filters Route filters match individual routes within a policy: •You can specify multiple route filters within a single term •Not reusable—term-specific [edit policy-options] user@host# show policy-statement policy-1 { term reject-rfc1918-prefixes { from { © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 7 from { route-filter 172.16.0.0/12 orlonger; route-filter 192.168.0.0/16 orlonger; route-filter 10.0.0.0/8 orlonger; } then reject; } } Note: Various match types are supported. We discuss the match types on subsequent slides.
  • 8. Match Types (1 of 3) exact: •Match the specified prefix and mask exactly orlonger: from route-filter 192.168.0.0/16 exact; © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 8 orlonger: •Match the specified prefix and mask exactly and all routes that are subsets of the prefix and that have longer masks from route-filter 192.168.0.0/16 orlonger;
  • 9. Match Types (2 of 3) longer: •Match routes that are subsets of the prefix and that have longer masks; •Do not match the specified prefix and mask from route-filter 192.168.0.0/16 longer; © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 9 upto: •Match specified prefix and mask exactly and any routes that are subsets of the specified prefix and that have a mask no longer than the second value specified from route-filter 192.168.0.0/16 upto /24;
  • 10. Match Types (3 of 3) prefix-length-range: •Match routes that are subsets of the specified prefix and that have a mask between the two values (inclusive match) through: from route-filter 192.168.0.0/16 prefix-length-range /20-/24; © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 10 through: •Match first and second specified prefixes and masks exactly and all prefixes directly between the two prefixes from route-filter 192.168.0.0/16 through 192.168.16.0/20;
  • 11. Match Type Summary Given a starting prefix of 192.168/16, what matches with each option? … 192.168/16192.168/16192.168/16192.168/16 … 192.168/16192.168/16192.168/16192.168/16 … 192.168/16192.168/16192.168/16192.168/16 © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 11 exact … orlonger (down to /32) … … longer (down to /32) through … … 192.168/16192.168/16192.168/16192.168/16 … … 192.168/16192.168/16192.168/16192.168/16 /x /y prefix-length-range /x-/y … … 192.168/16192.168/16192.168/16192.168/16 upto
  • 12. Common Actions Common actions in routing policy: •Terminating actions: • accept • reject •Flow control: • next term © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 12 • next term • next policy •Modifying attributes: • community (add, delete, and set) • preference term firstterm match thenfrom then statements describe the actions to take if a match with the from statement occurs
  • 13. Implementing Routing Policy (1 of 2) Definition of routing policy is always under the [edit policy-options] hierarchy: [edit policy-options] user@host# show policy-statement my-policy { term accept-local-route { from { protocol local; interface ge-0/0/0; term firstterm thenfrom my-policy © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 13 interface ge-0/0/0; } then accept; } term accept-some-static-routes { from { protocol static; route-filter 172.18.1.0/24 exact; route-filter 172.18.2.0/24 exact; } then accept; } term accept-rip-routes { from protocol rip; then accept; } } match no match no match then term secondterm from then term thirdterm from then from match match
  • 14. Implementing Routing Policy (2 of 2) You can apply routing policies as import or export policies at different levels (protocol dependent) [edit protocols ospf] user@host# show export my-policy; area 0.0.0.0 { interface ge-0/0/1.0; © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 14 interface ge-0/0/1.0; interface ge-0/0/2.0; interface ge-0/0/3.0 { passive; } interface lo0.0; }
  • 15. Routing Policy Flow You can chain routing policies together •Evaluation proceeds left to right until the software reaches a terminating action of accept or reject •The software supports flow-control actions such as next policy RouteRouteRouteRoute © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 15 AcceptAcceptAcceptAccept or rejector rejector rejector reject AcceptAcceptAcceptAccept or rejector rejector rejector reject AcceptAcceptAcceptAccept or rejector rejector rejector reject Policy 1Policy 1Policy 1Policy 1 AcceptAcceptAcceptAccept or rejector rejector rejector reject AcceptAcceptAcceptAccept or rejector rejector rejector reject AcceptAcceptAcceptAccept or rejector rejector rejector reject Policy 2Policy 2Policy 2Policy 2 AcceptAcceptAcceptAccept or rejector rejector rejector reject PolicyPolicyPolicyPolicy nnnn AcceptAcceptAcceptAccept RejectRejectRejectReject Term CTerm CTerm CTerm C Term CTerm CTerm CTerm C DefaultDefaultDefaultDefault policypolicypolicypolicy Term ATerm ATerm ATerm A Term BTerm BTerm BTerm B Term ATerm ATerm ATerm A Term BTerm BTerm BTerm B Term ATerm ATerm ATerm A
  • 16. Case Study: Objective and Topology Advertise the default static route defined on R1 into OSPF using routing policy: .1.2 OSPFOSPFOSPFOSPF Area 0Area 0Area 0Area 0 R1R1R1R1 R2R2R2R2 R4R4R4R4 InternetInternetInternetInternet © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 16 user@R1> show route protocol static inet.0: 16 destinations, 16 routes (16 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[Static/5] 00:00:44 > to 172.30.25.1 via ge-0/0/1.0 .1.2 172.30.25.0/30172.30.25.0/30172.30.25.0/30172.30.25.0/30 R3R3R3R3
  • 17. Case Study: Defining the Policy Sample routing policy configuration used to advertise R1’s default static route into OSPF: [edit policy-options] user@R1# show policy-statement default-static { term accept-default-static { User-defined policy and term names © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 17 term accept-default-static { from { protocol static; route-filter 0.0.0.0/0 exact; } then accept; } } Match criteria Action
  • 18. Case Study: Applying the Policy Sample application of routing policy used to advertise R1’s default static route into OSPF: [edit protocols ospf] user@R1# show export default-static; area 0.0.0.0 { R1R1R1R1 R2R2R2R2 © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 18 area 0.0.0.0 { interface ge-0/0/2.0; interface ge-0/0/3.0; interface lo0.0; } Export default static route from route table to OSPF OSPFOSPFOSPFOSPF Area 0Area 0Area 0Area 0 R1R1R1R1 R4R4R4R4 R3R3R3R3 Note: Once you define routing policy and apply it, R1 floods an external LSA for the default static route to all OSPF routers in Area 0.
  • 19. Case Study: Monitoring the Results Sample verification step to ensure the routing policy works as expected (capture is taken from R4): user@R4> show route protocol ospf exact 0/0 inet.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 19 0.0.0.0/0 *[OSPF/150] 00:03:33, metric 0, tag 0 > to 172.19.3.1 via ge-0/0/2.0 to 172.19.4.1 via ge-0/0/3.0 .1.2 172.30.25.0/30172.30.25.0/30172.30.25.0/30172.30.25.0/30 OSPFOSPFOSPFOSPF Area 0Area 0Area 0Area 0 R1R1R1R1 R2R2R2R2 R4R4R4R4 R3R3R3R3 InternetInternetInternetInternet R4 installs external default OSPF route flooded by R1
  • 20. What Is a Firewall Filter? Firewall filters control the traffic entering and leaving a networking device in a stateless fashion: •Processes every packet independently •Used to filter and monitor network traffic © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 20
  • 21. Building Blocks of Firewall Filters no match term firstterm match thenfrom my-filter Firewall filters consist of one or more terms; the software evaluates terms sequentially until it reaches a terminating action User-defined filter and term names © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 21 no match no match term secondterm term Default match then statements describe the actions to take if a match with the from statement occurs discard Default action for packets not explicitly allowed Note: Ordering matters! If you must reorder terms within a filter, consider using the insert CLI command. from statements describe match conditions thenfrom
  • 22. Common Match Criteria Can match based on most header fields: Match conditions categories include: •Numeric range © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 22 •Numeric range •Address •Bit field term firstterm match thenfromfrom statements describe match conditions
  • 23. Firewall Filter Actions Common actions in firewall filters: •Terminating actions: • accept • discard • Reject •Flow control: term firstterm match thenfrom then statements describe the actions to take if a match with the from statement occurs © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 23 •Flow control: • next term •Action modifiers: • count, log, and syslog • forwarding-class and loss-priority • Policer The software discards all traffic not explicitly allowed!
  • 24. Implementing Firewall Filters (1 of 2) Define firewall filters based on protocol family under the [edit firewall] hierarchy level: [edit firewall family inet] user@host# show filter filter-in { term block-some-packets { from { source-address { The software applies family inet filters only to interfaces running IPv4 term firstterm thenfrom my-policy © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 24 source-address { 10.10.10.0/24; } } then { count spoof-in; discard; } } term accept-others { then accept; } } … If discard is not present then packets are accepted match no match no match then term secondterm from then term thirdterm from then from match match
  • 25. Implementing Firewall Filters (2 of 2) Apply firewall filters as input or output on an interface •Protocol family on interface and filter must match: The software applies firewall [edit interfaces ge-0/0/1] user@host# show unit 0 { family inet { filter { input filter-in; © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 25 The software applies firewall filters using input and output statements input filter-in; output filter-out; } address 172.30.25.2/30; } } InputInputInputInput InputInputInputInputOutputOutputOutputOutput OutputOutputOutputOutput Input firewall filters control traffic entering an interface Output firewall filters control traffic leaving an interface Tip: To avoid late night drives back to the office, use commit confirmed when activating filters!
  • 26. Test Your Knowledge (1 of 2) Apply a filter on R1’s ge-0/0/1.0 interface to allow HTTP traffic to 172.27.102.100 •Should the filter be applied as an input or output filter? © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 26 .1.2 172.30.25.0/30172.30.25.0/30172.30.25.0/30172.30.25.0/30 172.27.102.0/24172.27.102.0/24172.27.102.0/24172.27.102.0/24 R1R1R1R1 ge-0/0/1.0.100.100.100.100 .1.1.1.1 MYNETMYNETMYNETMYNET InternetInternetInternetInternet
  • 27. filter web-server { term allow-web-traffic { from { destination-address { 172.27.102.100/32; } protocol tcp; Test Your Knowledge (2 of 2) Which inbound traffic does the router permit? Applied as an input filter © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 27 protocol tcp; port http; } then accept; } term deny-other-web-traffic { from { protocol tcp; port http; } then { discard; } } } .2 172.27.102.0/24172.27.102.0/24172.27.102.0/24172.27.102.0/24 R1R1R1R1 ge-0/0/1.0.100.100.100.100 .1.1.1.1 MYNETMYNETMYNETMYNET
  • 28. Filtering Local Traffic (1 of 2) Apply filters to lo0 interface to filter local traffic •Filter must account for routing and management protocols Routing EngineRouting EngineRouting EngineRouting Engine © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 28 Frames/Packets InFrames/Packets InFrames/Packets InFrames/Packets In Packet Forwarding EnginePacket Forwarding EnginePacket Forwarding EnginePacket Forwarding Engine Control PlaneControl PlaneControl PlaneControl Plane Forwarding PlaneForwarding PlaneForwarding PlaneForwarding Plane CPUCPUCPUCPU lo0
  • 29. filter limit-ssh-access { term ssh-accept { from { source-prefix-list { trusted; } protocol tcp; destination-port ssh; } then accept; lo0 { unit 0 { family inet { filter { input limit-ssh-access; } address 10.255.71.48/32; } } } Filtering Local Traffic (2 of 2) DefinitionDefinitionDefinitionDefinition ApplicationApplicationApplicationApplication © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 29 then accept; } term ssh-reject { from { protocol tcp; destination-port ssh; } then { discard; } } term else-accept { then accept; } } } Which problems might occur if you omit the else-accept term? Think About ItThink About ItThink About ItThink About It Affects incoming traffic destined to the routing engine!
  • 30. Policing Policing (rate-limiting) enables you to limit the amount of traffic that passes into or out of an interface: •Works with firewall filters to thwart DoS attacks • Common actions include discard and setting loss-priority level •Uses average bandwidth and maximum burst size © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 30 Bit BucketBit BucketBit BucketBit Bucket
  • 31. [edit firewall] user@host# show policer p1 { if-exceeding { bandwidth-limit 400k; burst-size-limit 100k; } then discard; } family inet { filter rate-limit-subnet { term match-subnet { Configuration Example bandwidth-limit * In bits per second * 30,520 bps to 4.29 Gbps burst-size-limit * In bytes * Minimum should = 10 You must apply filter! Policer defined © 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 31 term match-subnet { from { source-address { 192.100.1.0/24; } } then { policer p1; } } term else-accept { then accept; } } } Note: Filter must account for routing and management protocols * Minimum should = 10 times MTU (low speed) or bandwidth times 3–5 milliseconds (high speed) Policer referenced