SETUP-POLICY-ROUTES(8)

NAME
setup-policy-routes - configure systemd-networkd within an Amazon VPC network

SYNOPSIS
setup-policy-routes INTERFACE stop|start|cleanup

DESCRIPTION
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:

    • Sets up DHCPv4 and DHCPv6 clients • Assigns or unassigns secondary IPv4 addresses as IP aliases as appropriate • 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. • Installs interface aliases corresponding to the ENI ID and attachment ID

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

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.

OPTIONS
setup-policy-routes takes a network interface name as the first parameter and one of start, stop, or cleanup as the second parameter:

    • start indicates that the given interface should be configured • stop indicates that the given interface should be deconfigured and the installed configuration should be cleaned up • cleanup performs internal housekeeping

ENVIRONMENT

setup-policy-routes recognizes the following environment variables

    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.

FILES

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

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