File: setup-policy-routes.8

package info (click to toggle)
amazon-ec2-net-utils 2.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 216 kB
  • sloc: sh: 492; makefile: 4
file content (110 lines) | stat: -rw-r--r-- 3,464 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
\"  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
\"
\"  Licensed under the Apache License, Version 2.0 (the "License"). You may
\"  not use this file except in compliance with the License. A copy of the
\"  License is located at
\"
\"       http://aws.amazon.com/apache2.0/
\"
\"  or in the "license" file accompanying this file. This file is distributed
\"  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
\"  express or implied. See the License for the specific language governing
\"  permissions and limitations under the License.
\" SPDX-License-Identifier: Apache-2.0
.TH SETUP-POLICY-ROUTES 8 23-Dec-2022 amazon-ec2-net-utils
.SH NAME
setup-policy-routes \- configure systemd-networkd within an Amazon VPC network
.SH SYNOPSIS
.B setup-policy-routes
.RI "INTERFACE"
.RI "stop|start|cleanup"
.SH DESCRIPTION
.B setup-policy-routes
installs systemd-networkd configuration to the /run/systemd/network
directory to configure the given network interface for optimal use in
an Amazon Virtual Private Cloud (VPC) network environment.

The installed systemd-networkd configuration:

.IP

\(bu Sets up DHCPv4 and DHCPv6 clients

\(bu Assigns or unassigns secondary IPv4 addresses as IP aliases as
appropriate

\(bu Installs per-interface route tables and policy routing rules to
ensure that egress traffic with a given source address is routed via
the ENI with which that address (or its corresponding prefix) is
associated.  This ensures compliance with the VPC anti-spoofing
protections.

\(bu Installs interface aliases corresponding to the ENI ID and
attachment ID

.PP
Installed configuration can be overridden as needed by placing a file
with the same name as the generated file in /etc/systemd/network.  See
.BR systemd.network(5)
for more details.

.PP
.B setup-policy-routes
is not normally executed by hand, but is instead normally invoked by
udev rules either on boot or by a systemd timer.

.SH OPTIONS
.B setup-policy-routes
takes a network interface name as the first parameter and one of
start, stop, or cleanup as the second parameter:
.IP
\(bu
.B start
indicates that the given interface should be configured

\(bu
.B stop
indicates that the given interface should be deconfigured and the
installed configuration should be cleaned up

\(bu
.B cleanup
performs internal housekeeping

.SH ENVIRONMENT
.PP
.B setup-policy-routes
recognizes the following environment variables

.IP
.B EC2_IF_INITIAL_SETUP
This variable should be set when performing initial configuration of
an interface, as opposed to refreshing the configuration of an
interface that is already active.  It enables additional retry logic
for some internal operations that rely on the Amazon EC2 Instance
Metadata Service (IMDS) in order to ensure that the interface
setup accounts for any configuration data that may still be in flight
while the interface is being configured on the instance.

.SH FILES
.PP
.IR /run/systemd/network/*.network
.br
.IR /run/systemd/network/*.network.d/eni.conf
.br
.IR /usr/lib/systemd/network/80-ec2.network
.br
.IR /usr/lib/udev/rules.d/99-vpc-policy-routes.rules

.SH SEE ALSO
.BR systemd-networkd (8),
.BR networkctl (1),
.BR systemd.network(5),
.BR systemd.timer(5),
.UR https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html
The Amazon Virtual Private Cloud User Guide
.UE
.UR https://github.com/amazonlinux/amazon-ec2-net-utils
The amazon-ec2-net-utils GitHub repository.
.UE
.br