SETUP-POLICY-ROUTES(8)
π¦ setup-policy-routes(8) β System Manager's Manual π¦
okay so this is the setup-policy-routes page, bestie β manual name is System Manager's Manual, and it's all about making systemd-networkd behave inside an Amazon VPC network. slay. π
β¨ NAME β¨
setup-policy-routes β configure systemd-networkd within an Amazon VPC network
πΈ SYNOPSIS πΈ
setup-policy-routes INTERFACE stop|start|cleanup
π DESCRIPTION π
okay so setup-policy-routes installs systemd-networkd configuration into the /run/systemd/network directory, and the whole point is to configure the given network interface for optimal use in an Amazon Virtual Private Cloud (VPC) network environment. iconic. β¨
The installed systemd-networkd configuration does all this:
- 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
ngl, you can override the installed configuration 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. so likeβ¦ don't just start typing it for fun, okay? π
π 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 configuredstopβ indicates that the given interface should be deconfigured and the installed configuration should be cleaned upcleanupβ 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
- The
amazon-ec2-net-utilsGitHub repository.
later, bestie π this page came from amazon-ec2-net-utils, dated 23-Dec-2022, and it's the SETUP-POLICY-ROUTES(8) manual page. mwah π
π¦ where this page comes from
- nixpkgs unstable: amazon-ec2-net-utils 2.7.6
- π the page's license: Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms