Juniper Contrail Networking User guide

Category
Software
Type
User guide
Contrail® Networking
Contrail Networking and Security User
Guide
Published
2023-07-13
RELEASE
21.4
Juniper Networks, Inc.
1133 Innovaon Way
Sunnyvale, California 94089
USA
408-745-2000
www.juniper.net
Juniper Networks, the Juniper Networks logo, Juniper, and Junos are registered trademarks of Juniper Networks, Inc.
in the United States and other countries. All other trademarks, service marks, registered marks, or registered service
marks are the property of their respecve owners.
Juniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the right
to change, modify, transfer, or otherwise revise this publicaon without noce.
Contrail® Networking Contrail Networking and Security User Guide
21.4
Copyright © 2023 Juniper Networks, Inc. All rights reserved.
The informaon in this document is current as of the date on the tle page.
YEAR 2000 NOTICE
Juniper Networks hardware and soware products are Year 2000 compliant. Junos OS has no known me-related
limitaons through the year 2038. However, the NTP applicaon is known to have some diculty in the year 2036.
END USER LICENSE AGREEMENT
The Juniper Networks product that is the subject of this technical documentaon consists of (or is intended for use
with) Juniper Networks soware. Use of such soware is subject to the terms and condions of the End User License
Agreement ("EULA") posted at hps://support.juniper.net/support/eula/. By downloading, installing or using such
soware, you agree to the terms and condions of that EULA.
ii
Table of Contents
About This Guide | vii
1
Contrail Security
Security Policy Features | 2
Security Policy Features in OpenStack | 22
Policy Generaon | 24
Conguring Policy Generaon | 25
Host-based Firewalls | 32
Host-based Firewalls Overview | 33
Deploying Host-based Firewalls | 33
Prerequisites | 34
Topology | 34
Deployment Instrucons | 36
2
Conguring Virtual Networks
Creang a Virtual Network with Juniper Networks Contrail | 46
Creang a Floang IP Address Pool | 49
Support for IPv6 Networks in Contrail | 51
Conguring EVPN and VXLAN | 55
Conguring the VXLAN Idener Mode | 57
Conguring Forwarding | 60
Conguring the VXLAN Idener | 61
Conguring Encapsulaon Methods | 62
Support for EVPN Route Type 5 | 65
Support for EVPN Type 6 Selecve Mulcast Ethernet Tag Route | 66
Support for L3VPN Inter AS Opon C | 68
iii
Contrail vRouter Next Hop Conguraon | 71
3
Deploying a Mul-Tier Web Applicaon Using Contrail Networking
Example: Deploying a Mul-Tier Web Applicaon | 75
Mul-Tier Web Applicaon Overview | 75
Example: Seng Up Virtual Networks for a Simple Tiered Web Applicaon | 76
Verifying the Mul-Tier Web Applicaon | 79
Sample Addressing Scheme for Simple Tiered Web Applicaon | 79
Sample Physical Topology for Simple Tiered Web Applicaon | 81
Sample Physical Topology Addressing | 81
Sample Network Conguraon for Devices for Simple Tiered Web Applicaon | 83
4
Conguring Services
Conguring DNS Servers | 91
DNS Overview | 91
Dening Mulple Virtual Domain Name Servers in Contrail | 92
IPAM and Virtual DNS | 92
DNS Record Types | 93
Conguring DNS on the User Interface | 94
Conguring DNS Using Scripts | 102
Distributed Service Resource Allocaon with Containerized Contrail | 104
Support for Broadcast and Mulcast | 115
Subnet Broadcast | 115
All-Broadcast/Limited-Broadcast and Link-Local Mulcast | 116
Host Broadcast | 117
5
Conguring Service Chaining
Service Chaining | 119
Service Chaining Basics | 119
iv
Service Chaining Conguraon Elements | 121
Service Chaining MX Series Conguraon | 123
ECMP Load Balancing in the Service Chain | 125
Service Chain Version 2 with Port Tuple | 126
Service Chain Route Reoriginaon | 130
Example: Creang an In-Network Service Chain by Using Contrail Command | 153
Hardware and Soware Requirements | 154
Overview | 154
Conguraon | 154
Example: Creang an In-Network-NAT Service Chain | 162
Prerequisites | 162
Overview | 163
Conguraon | 164
Example: Creang a Transparent Service Chain by Using Contrail Command | 171
Prerequisites | 171
Overview | 172
Conguraon | 172
Using Stac Routes with Services | 180
Stac Routes for Service Instances | 180
Conguring Stac Routes on a Service Instance | 180
Conguring Stac Routes on Service Instance Interfaces | 182
Conguring Stac Routes as Host Routes | 183
Conguring Metadata Service | 184
6
Opmizing Contrail Networking
Source Network Address Translaon (SNAT) | 187
Overview | 187
v
SNAT on MX Series Routers Acng as Data Center Gateways | 188
How to Enable SNAT on an MX Series Router Using Contrail Command | 188
Neutron APIs for Routers | 189
Network Namespace | 190
SNAT and Security Groups | 191
Using the Web UI to Congure Routers with SNAT | 191
Using the Web UI to Congure Distributed SNAT | 193
vi
About This Guide
Use this guide to understand how you can create and orchestrate highly secure virtual networks using
Contrail Networking and Security. Contrail Networking provides dynamic end-to-end networking policy
and control for any cloud, any workload, and any deployment, from a single user interface. And unlike
the convenonal rewall conguraon of IP addresses and port ranges, Contrail Security implements
intent-based policy framework that uses policy constructs such as tags, labels, applicaon policy set,
address groups, and service groups.
Contrail Networking product documentaon is organized into mulple guides as shown in "About This
Guide" on page vii, according to the task you want to perform or the deployment scenario.
Table 1: Contrail Networking Guides
Guide Name Descripon
Contrail Networking Installaon
and Upgrade Guide
Provides step-by-step instrucons to install and bring up Contrail and its
various components.
Contrail Networking for
Container Networking
Environments User Guide
Provides informaon about installing and using Contrail Networking in
containerized environments using Kubernetes orchestraon.
Contrail Networking Fabric
Lifecycle Management Guide
Provides informaon about Contrail underlay management and data center
automaon.
Contrail Networking and
Security User Guide
Provides informaon about creang and orchestrang highly secure virtual
networks.
Contrail Networking Service
Provider Focused Features
Guide
Provides informaon about the features that are used by service providers.
Contrail Networking
Monitoring and
Troubleshoong Guide
Provides informaon about Contrail Insights and Contrail analycs.
vii
RELATED DOCUMENTATION
README Access to Contrail Networking Registry 21xx
Contrail Networking Release Notes 21xx
Tungsten Fabric Architecture Guide
Juniper Networks TechWiki: Contrail Networking
viii
1
CHAPTER
Contrail Security
Security Policy Features | 2
Security Policy Features in OpenStack | 22
Policy Generaon | 24
Conguring Policy Generaon | 25
Host-based Firewalls | 32
Security Policy Features
IN THIS SECTION
Overview of Exisng Network Policy and Security Groups in Contrail | 2
Security Policy Enhancements | 3
Using Tags and Conguraon Objects to Enhance Security Policy | 3
Conguraon Objects | 6
Using the Contrail Web User Interface to Manage Security Policies | 11
Overview of Exisng Network Policy and Security Groups in Contrail
Virtual networks are isolated by default in Contrail. Network policy is used to connect the two networks,
with security policy being applied to provide more granular allow and deny rules to specic trac.
In modern cloud environments, workloads are moving from one server to another, one rack to another
and so on. Therefore, users must rely less on using IP addresses to idenfy the endpoints to be
protected. Instead users must leverage applicaon aributes to author policies, so that the policies don't
need to be updated on account of workload mobility.
You might want to segregate trac based on the dierent categories, such as:
Applicaon name
Segregang trac for specic component ers within the applicaon
Segregang trac based on the deployment environment for the applicaon instance
Segregang trac based on the specic geographic locaon where the applicaon is deployed
Addionally, you might need to group workloads based on combinaons of tags. These intents are hard
to express with exisng network policy constructs or Security Group constructs. Besides, exisng policy
constructs leveraging the network coordinates, must connually be rewrien or updated each me
workloads move or their IP addresses change.
2
Security Policy Enhancements
As the Contrail environment has grown and become more complex, it has become harder to achieve
desired security results with the exisng network policy and security group constructs. The Contrail
network policies have been ed to roung, making it dicult to express security policies for
environments such as cross seconing between categories, or having a mul-er applicaon supporng
development and producon environment workloads with no cross environment trac.
Starng with Contrail Release 4.1, limitaons of the current network policy and security group
constructs are addressed by supporng decoupling of roung from security policies, muldimension
segmentaon, and policy portability. This release also enhances user visibility and analycs funcons for
security.
Contrail Release 4.1 introduces new rewall security policy objects, including the following
enhancements:
Roung and policy decoupling—introducing new rewall policy objects, which decouples policy from
roung.
Muldimension segmentaon—segment trac and add security features, based on mulple
dimensions of enes, such as applicaon, er, deployment, site, usergroup, and so on.
Policy portability—security policies can be ported to dierent environments, such as ‘from
development to producon’, ‘from pci-complaint to producon, ‘to bare metal environment’ and ‘to
container environment’.
Visibility and analycs
Using Tags and Conguraon Objects to Enhance Security Policy
Starng with Contrail Release 4.1, tags and conguraon objects are used to create new rewall policy
objects that decouple roung and network policies, enabling muldimension segmentaon and policy
portability.
Muldimension trac segmentaon helps you segment trac based on dimensions such as applicaon,
er, deployment, site, and usergroup.
You can also port security policies to dierent environments. Portability of policies are enabled by
providing match condions for tags. Match tags must be added to the policy rule to match tag values of
source and desnaon workloads without menoning tag values. For example, in order for the ‘allow
protocol tcp source application-tier=web destination application-tier=application match application and site’ rule
to take eect, the applicaon and site values must match.
3
To create a tag in the Command UI, navigate to Security > Tags. Tags can be created with a Project scope
or a Global scope. For more informaon on tags, see "Security Policy Features" on page 2. For example,
see Figure 1 on page 4.
Figure 1: Create Tag
Starng in Contrail Networking Release 21.3, security policy allows oponal user-dened tags, which
enables you to dene tag IDs along with tag names.
The range of the user-dened tag IDs is 32000 through 64000.
The tag format is: Tag-type ID (upper 16 bit) and Tag value ID (lower 16 bit).
User-dened tag type range: 0x8000 - 0xFFFF
User-dened tag value ID range: 0x8000 - 0xFFFF
NOTE: Dening user-dened tag IDs is oponal. If you do not dene the tag ID, the device will
auto generate a tag ID within the range 0x0 – 0x7FFF. For example: Application=Hrapp 0x0001 000.
Predened Tags
You can choose predened tags based on the environment and deployment requirements.
Predened tags include:
applicaon
4
applicaon-er
• deployment
• site
label (a special tag that allows the user to label objects)
Starng in Contrail Networking Release 21.3, you can create a predened tag type with user-dened tag
value ID.
For example: Application=FinApp(user def tag value id : 32778) 0x0001 800a
NOTE: You can only enter decimal values in the Command UI. Range is 32767 through 65535.
Custom Tags
You can also dene custom tags for a Kubernetes environment. You can dene tags in the UI or upload
conguraons in JSON format.
Starng in Contrail Networking Release 21.3, custom tags supports user-dened tags.
Example Tag Usage
application = HRApp
application-tier = Web
site = USA
For user-dened custom tag: Foo=HrApp(tag value id 32778 tag type id 32778) 0x800a 800a
Tagging Objects
A user can tag the objects project, VN, VM, and VMI with tags and values to map their security
requirements. Tags follow the hierarchy of project, VN, VM and VMI and are inherited in that order. This
gives an opon for the user to provide default sengs for any tags at any level. Policies can specify their
security in terms of tagged endpoints, in addion to expressing in terms of ip prex, network, and
address groups endpoints.
Policy Applicaon
Policy applicaon is a new object, implemented by means of the applicaon tag. The user can create a
list of policies per applicaon to be applied during the ow acceptance evaluaon. Introducing global
5
scoped policies and project scoped policies. There are global scoped policies, which can be applied
globally for all projects, and project scoped policies, which are applied to specic projects.
Conguraon Objects
The following are the conguraon objects for the new security features.
rewall-policy
rewall-rule
• policy-management
applicaon-policy
• service-group
• address-group
• tag
global-applicaon-policy
Conguraon Object Tag Object
Each conguraon object tag object contains:
tag: one of the dened tag types, stored as string and a 32-bit ID.
tag type: Contains the type string and ID (the rst 16 bits of the tag) and references to the tag
resource type
Each value entered by the user creates a unique ID that is set in the tag_id eld. The system can have up
to 64 million tag values. On average, each tag can have up to 2k values, but there are no restricons per
tag.
Tags and labels can be aached to any object, for example, project, VN, VM, VMI, and policy, and these
objects have a tag reference list to support mulple tags.
RBAC controls the users allowed to modify or remove aached tags. Some tags (typically facts) are
aached by the system by default or by means of introspecon.
Tag APIs
Tag APIs are used to give RBAC per tag in any object (VMI, VM, Project ….).
6
REST: HTTP POST to /set_tag_<tag_type>/<obj_uuid>
Python: set_tag_<tag_type> (object_type, object_uuid, tag_value)
Conguraon also supports the following APIs:
tag query
tags (policy)
tags (applicaon tag)
object query
tags (object)
tags (type, value)
Label
Label is special tag type, used to assign labels for objects. All of the tag constructs are valid, except that
tag type is ‘label'. One dierence from other tags is that an object can have any number of labels. All
other tag types are restricted to one tag per object.
Local and Global Tags
Tags can be dened globally or locally under a project; tag objects are children of either cong-root or a
project. An object can be tagged with a tag in its project or with a globally-scoped tag.
Analycs
When given a tag query with a SQL where clause and select clause, analycs should give out objects.
The query can also contain labels, and the labels can have dierent operators.
Example:
User might want to know: a list of VMIs where ’site == USA and deployment == Production'
list of VMIs where ’site == USA and deployment == Production has ’
Given tag SQL where clause and select clause, analycs should give out ows.
Control Node
The control node passes the tags, along with route updates, to agents and other control nodes.
7
Agent
Agent gets aached tags along with conguraon objects. Agent also gets route updates containing tags
associated with IP route. This process is similar to geng security group IDs along with the route
update.
Address-Group Conguraon Object
There are mulple ways to add IP address to address-group.
Manually add IP prexes to the address-group by means of conguraon.
Label a work load with the address-group’s specied label. All ports that are labelled with the same
label are considered to be part of that address-group.
Use introspect workloads, based on certain criteria, to add ip-address to address-group.
Conguraon
The address-group object refers to a label object, descripon, and list of IP prexes. The label - object is
created using the tag APIs.
Agent
Agent gets address-group and label objects referenced in policy conguraon. Agent uses this address
group for matching policy rules.
Analycs
When given address group label, analycs gets all the objects associated with it. Given address group
label, get all the ows associated with it.
Service-Group Conguraon Object
Conguraon
The service-group contains a list of ports and protocols. The open stack service-group has a list of
service objects; the service object contains aributes: id, name, service group id, protocol, source_port,
desnaon_port, icmp_code, icmp_type, meout, tenant id.
Agent
Agent gets service-group object as it is referred to in a policy rule. Agent uses this service group during
policy evaluaon.
8
Applicaon-policy-set Conguraon Object
The applicaon-policy-set conguraon object can refer to a tag of type applicaon, network-policy
objects, and rewall-policy objects. This object can be local (project) or globally scoped.
When an applicaon tag is aached to an applicaon-policy-set object, the policies referred by that
object are automacally applied to the ports that have the same applicaon tag.
Any rewall-policies referred by the applicaon-policy-set objects are ordered using sequence numbers.
If the same applicaon tag is aached to mulple applicaon-policy-sets, all those sets will apply, but
order among those sets is undened.
One applicaon-policy-set (called default-policy-applicaon-set) is special in that policies referred by it
are applied to all interfaces by default, aer applying policies referred to other applicaon-policy-sets.
Upon seeing the applicaon tag for any object, the associated policies are sent to agent. Agent will use
this informaon to nd out the list of policies to be applied and their sequence during ow evaluaon.
User can aach applicaon tag to allowed objects (Project, VN, VM or VMI).
Policy-management Conguraon Object
Policy-management is a global container object for all policy-related conguraon.
Policy-management object contains
network-policies (NPs)
rewall-policies (FWPs)
applicaon-policy-sets
global-policy objects
global-policy-apply objects
NPs - List of contrail networking policy objects
FWPs - List of new rewall policy objects
Applicaon-policies - List of Applicaon-policy objects
Global-policies - List of new rewall policy objects, that are dened for global access
Global-policy-apply - List of global policies in a sequence, and these policies applied during ow
evaluaon.
Network Policies (NP) references are available, as they are today.
9
Firewall-policy Conguraon Object
Firewall-policy is a new policy object that contains a list of rewall-rule-objects and audited ag.
Firewall-policy can be project or global scoped depending on usage. Includes an audited Boolean ag to
indicate that the owner of the policy indicated that the policy is audited. Default is False, and will have
to explicitly be set to True aer review. Generates a log event for audited with mestamp and user
details.
Firewall-rule Conguraon Object
Firewall-rule is a new rule object, which contains the following elds. The syntax is to give informaon
about their layout inside the rule.
<sequence number>
There is a string object sequence number on the link from rewall-policy to rewall-policy-rule
objects. The sequence number decides the order in which the rules are applied.
[< id >]
uuid
[name < name >]
Unique name selected by user
[descripon < descripon >]
• public
{permit | deny}
[ protocol {< protocol-name > | any } desnaon-port { < port range > | any } [ source-port { < port
range > | any} ] ] | service-group < name >
endpoint-1 { [ip < prex > ] | [virtual-network < vnname >] | [address-group < group name >] | [tags
T1 == V1 && T2 == V2 … && Tn == Vn && label == label name...] | any}
{ -> | <- | <-> }
Species connecon direcon. All the rules are connecon oriented and this opon gives the
direcon of the connecon.
endpoint-2 { [ip < prex > ] | [virtual-network < vnname >] | [address-group < group name >] | [tags
T1 == V1 && T2 == V2 … && Tn == Vn && label == label name...] | any }
10
Tags at endpoints support an expression of tags. We support only ‘==‘ and ‘&&’ operators. User can
specify labels also as part the expression. Conguraon object contains list of tag names (or
global:tag-name in case of global tags) for endpoints.
[ match_tags {T1 …. Tn} | none} ]
List of tag types or none. User can specify either match with list of tags or none. Match with list of
tags mean, source and desnaon tag values should match for the rule to take eect.
[ log| mirror | alert | acvate | drop | reject | sdrop ]
complex acons
{ enable | disable }
A boolean ag to indicate the rule is enabled or disabled. Facilitates selecvely turn o the rules,
without remove the rule from the policy. Default is True.
lter
Compilaon of Rules
Whenever the API server receives a request to create/update a rewall policy rule object, it analyzes the
object data to make sure that all virtual-networks, address-group, tag objects exist. If any of them do not
exist, the request will be rejected. In addion, it will actually create a reference to those objects
menoned in the two endpoints. This achieves two purposes. First, we don't allow users to name non-
existent objects in the rule and second, the user is not allowed to delete those objects without rst
removing them from all rules that are referring to them.
Using the Contrail Web User Interface to Manage Security Policies
Adding Security Policies
1. To add a security policy, go to Congure > Security > Global Policies. Near the upper right, click the
buon Firewall Policy Wizard. The Firewall Policy Wizard appears, where you can create your new
rewall policy by adding or selecng an applicaon policy set. See Figure 2 on page 12.
11
Figure 2: Firewall Policy Wizard
2. Click the large + on the Firewall Policy Wizard screen to view the Applicaon Policy Sets window.
The exisng applicaon policy sets are displayed. See Figure 3 on page 12.
Figure 3: Applicaon Policy Sets
3. To create a new rewall policy, click the applicaon policy set in the list to which the new rewall
policy will belong. The Edit Applicaon Policy Sets window appears, displaying a eld for the
descripon of the selected policy set and lisng rewall policies associated with the set. See Figure 4
on page 13, where the HRPolicySet has been selected.
12
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194
  • Page 195 195
  • Page 196 196
  • Page 197 197
  • Page 198 198
  • Page 199 199
  • Page 200 200
  • Page 201 201
  • Page 202 202
  • Page 203 203

Juniper Contrail Networking User guide

Category
Software
Type
User guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI