SETUP-POLICY-ROUTES(8)

πŸ“¦ version 2.7.6, in nixpkgs unstable

πŸ¦‹ 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 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 πŸ‘‘


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