diff options
| author | Michael Biebl <biebl@debian.org> | 2021-10-01 23:05:04 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2021-10-01 23:05:04 +0200 |
| commit | e74c568b07b50b97873fb4ee1d776dedefbd54d6 (patch) | |
| tree | 3469f17ea9af91f7ff169b890633bda68b0cf76e /man/nm-cloud-setup.xml | |
| parent | bfe522304da217296e2a61040f58e35ec5d6f3f2 (diff) | |
New upstream version 1.32.12 upstream/1.32.12
Diffstat (limited to 'man/nm-cloud-setup.xml')
| -rw-r--r-- | man/nm-cloud-setup.xml | 105 |
1 files changed, 92 insertions, 13 deletions
diff --git a/man/nm-cloud-setup.xml b/man/nm-cloud-setup.xml index 388ef3ba..976fc647 100644 --- a/man/nm-cloud-setup.xml +++ b/man/nm-cloud-setup.xml @@ -187,10 +187,45 @@ <para><literal>NM_CLOUD_SETUP_GCP</literal>: boolean, whether Google GCP support is enabled. Defaults to <literal>no</literal>.</para> </listitem> + <listitem> + <para><literal>NM_CLOUD_SETUP_ALIYUN</literal>: boolean, whether Alibaba Cloud (Aliyun) support is enabled. Defaults + to <literal>no</literal>.</para> + </listitem> </itemizedlist> </refsect1> + <refsect1 id="deploy"> + <title>Example Setup for Configuring and Predeploying nm-cloud-setup</title> + + <para>As detailed before, nm-cloud-setup needs to be explicitly enabled. As it + runs as a systemd service and timer, that basically means to enable and configure + those. This can be done by dropping the correct files and symlinks to disk. + </para> + <para> + The following example enables nm-cloud-setup for Amazon EC2 cloud: + <programlisting> +dnf install -y NetworkManager-cloud-setup + +mkdir -p /etc/systemd/system/nm-cloud-setup.service.d +cat > /etc/systemd/system/nm-cloud-setup.service.d/10-enable-ec2.conf << EOF +[Service] +Environment=NM_CLOUD_SETUP_EC2=yes +EOF + +# systemctl enable nm-cloud-setup.service +mkdir -p /etc/systemd/system/NetworkManager.service.wants/ +ln -s /usr/lib/systemd/system/nm-cloud-setup.service /etc/systemd/system/NetworkManager.service.wants/nm-cloud-setup.service + +# systemctl enable nm-cloud-setup.timer +mkdir -p /etc/systemd/system/timers.target.wants/ +ln -s /etc/systemd/system/timers.target.wants/nm-cloud-setup.timer /usr/lib/systemd/system/nm-cloud-setup.timer + +# systemctl daemon-reload + </programlisting> + </para> + </refsect1> + <refsect1 id="providers"> <title>Supported Cloud Providers</title> @@ -221,7 +256,9 @@ Also, if the device is currently not activated in NetworkManager or if the currently activated profile has a user-data <literal>org.freedesktop.nm-cloud-setup.skip=yes</literal>, it is skipped.</para> - <para>Then, the tool will change the runtime configuration of the device. + <para>If only one interface and one address is configured, then the tool does nothing + and leaves the automatic configuration that was obtained via DHCP.</para> + <para>Otherwise, the tool will change the runtime configuration of the device. <itemizedlist> <listitem> <para>Add static IPv4 addresses for all the configured addresses from <literal>local-ipv4s</literal> with @@ -232,15 +269,25 @@ <para>Choose a route table 30400 + the index of the interface and add a default route <literal>0.0.0.0/0</literal>. The gateway is the first IP address in the CIDR subnet block. For - example, we might get a route <literal>"0.0.0.0/0 172.16.5.1 10 table=30401"</literal>.</para> + example, we might get a route <literal>"0.0.0.0/0 172.16.5.1 10 table=30400"</literal>.</para> + <para>Also choose a route table 30200 + the interface index. This + contains a direct routes to the subnets of this interface.</para> </listitem> <listitem> <para>Finally, add a policy routing rule for each address. For example - <literal>"priority 30401 from 172.16.5.3/32 table 30401, priority 30401 from 172.16.5.4/32 table 30401"</literal>.</para> + <literal>"priority 30200 from 172.16.5.3/32 table 30200, priority 30200 from 172.16.5.4/32 table 30200"</literal>. + and + <literal>"priority 30400 from 172.16.5.3/32 table 30400, priority 30400 from 172.16.5.4/32 table 30400"</literal> + The 30200+ rules select the table to reach the subnet directly, while the 30400+ rules use the + default route. Also add a rule + <literal>"priority 30350 table main suppress_prefixlength 0"</literal>. This has a priority between + the two previous rules and causes a lookup of routes in the main table while ignoring the default + route. The purpose of this is so that other specific routes in the main table are honored over + the default route in table 30400+.</para> </listitem> </itemizedlist> With above example, this roughly corresponds for interface <literal>eth0</literal> to - <command>nmcli device modify "eth0" ipv4.addresses "172.16.5.3/24,172.16.5.4/24" ipv4.routes "0.0.0.0/0 172.16.5.1 10 table=30401" ipv4.routing-rules "priority 30401 from 172.16.5.3/32 table 30401, priority 30401 from 172.16.5.4/32 table 30401"</command>. + <command>nmcli device modify "eth0" ipv4.addresses "172.16.5.3/24,172.16.5.4/24" ipv4.routes "172.16.5.0/24 0.0.0.0 10 table=30200, 0.0.0.0/0 172.16.5.1 10 table=30400" ipv4.routing-rules "priority 30200 from 172.16.5.3/32 table 30200, priority 30200 from 172.16.5.4/32 table 30200, priority 20350 table main suppress_prefixlength 0, priority 30400 from 172.16.5.3/32 table 30400, priority 30400 from 172.16.5.4/32 table 30400"</command>. Note that this replaces the previous addresses, routes and rules with the new information. But also note that this only changes the run time configuration of the device. The connection profile on disk is not affected. @@ -317,20 +364,52 @@ <listitem> <para>Then, for each IP address index fetch the address at <literal>http://169.254.169.254/metadata/instance/network/interface/$IFACE_INDEX/ipv4/ipAddress/$ADDR_INDEX/privateIpAddress?format=text&api-version=2017-04-02</literal>. - Also fetch the size of the subnet (the netmask) for the interface from + Also fetch the size of the subnet and prefix for the interface from + <literal>http://169.254.169.254/metadata/instance/network/interface/$IFACE_INDEX/ipv4/subnet/0/address/?format=text&api-version=2017-04-02</literal>. + and <literal>http://169.254.169.254/metadata/instance/network/interface/$IFACE_INDEX/ipv4/subnet/0/prefix/?format=text&api-version=2017-04-02</literal>. </para> </listitem> <listitem> <para>At this point, we have a list of all interfaces (by MAC address) and their configured IPv4 addresses.</para> - <para>For each device, we lookup the currently applied connection in NetworkManager. That implies, that the device is currently activated - in NetworkManager. If no such device was in NetworkManager, or if the profile has user-data <literal>org.freedesktop.nm-cloud-setup.skip=yes</literal>, - we skip the device. Now for each found IP address we add a static address "$ADDR/$SUBNET_PREFIX". Also we configure policy routing - by adding a static route "$ADDR/$SUBNET_PREFIX $GATEWAY 10, table=$TABLE" where $GATEWAY is the first IP address in the subnet and table - is 30400 plus the interface index. Also we add a policy routing rule "priority $TABLE from $ADDR/32 table $TABLE".</para> - <para>The effect is not unlike calling - <command>nmcli device modify "$DEVICE" ipv4.addresses "$ADDR/$SUBNET [,...]" ipv4.routes "$ADDR/32 $GATEWAY 10 table=$TABLE" ipv4.routing-rules "priority $TABLE from $ADDR/32 table $TABLE"</command> - for all relevant devices and all found addresses.</para> + <para>Then the tool configures the system like doing for AWS environment. That is, using source based policy routing + with the tables/rules 30200/30400.</para> + </listitem> + </itemizedlist> + </refsect2> + + <refsect2> + <title>Alibaba Cloud (Aliyun)</title> + + <para>For Aliyun, the tools tries to fetch configuration from <literal>http://100.100.100.200/</literal>. Currently, it only + configures IPv4 and does nothing about IPv6. It will do the following.</para> + + <itemizedlist> + <listitem> + <para>First fetch <literal>http://100.100.100.200/2016-01-01/meta-data/</literal> to determine whether the + expected API is present. This determines whether Aliyun environment is detected and whether to proceed + to configure the host using Aliyun meta data.</para> + </listitem> + <listitem> + <para>Fetch <literal>http://100.100.100.200/2016-01-01/meta-data/network/interfaces/macs/</literal> to get the list + of available interface. Interfaces are identified by their MAC address.</para> + </listitem> + <listitem> + <para>Then for each interface fetch <literal>http://100.100.100.200/2016-01-01/meta-data/network/interfaces/macs/$MAC/vpc-cidr-block</literal>, + <literal>http://100.100.100.200/2016-01-01/meta-data/network/interfaces/macs/$MAC/private-ipv4s</literal>, + <literal>http://100.100.100.200/2016-01-01/meta-data/network/interfaces/macs/$MAC/netmask</literal> and + <literal>http://100.100.100.200/2016-01-01/meta-data/network/interfaces/macs/$MAC/gateway</literal>. + Thereby we get a list of private IPv4 addresses, one CIDR subnet block and private IPv4 addresses prefix.</para> + </listitem> + <listitem> + <para>Then nm-cloud-setup iterates over all interfaces for which it could fetch IP configuration. + If no ethernet device for the respective MAC address is found, it is skipped. + Also, if the device is currently not activated in NetworkManager or if the currently + activated profile has a user-data <literal>org.freedesktop.nm-cloud-setup.skip=yes</literal>, + it is skipped. Also, there is only one interface and one IP address, the tool does nothing.</para> + <para>Then the tool configures the system like doing for AWS environment. That is, using source based policy routing + with the tables/rules 30200/30400. One difference to AWS is that the gateway is also fetched via metadata instead + of using the first IP address in the subnet.</para> </listitem> </itemizedlist> </refsect2> |