Skip to content

Commit

Permalink
alternatives: update doc to use the usual alternatives commands
Browse files Browse the repository at this point in the history
  • Loading branch information
HuijingHei committed Oct 25, 2024
1 parent 27968e3 commit 8d08485
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions modules/ROOT/pages/alternatives.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,43 @@ storage:
overwrite: true
hard: false
----

== Using alternatives commands

Starting with Fedora CoreOS based on Fedora 41, you can use `alternatives` commands to configure the default command.

. Example systemd unit to configure default the iptables backend
[source,yaml,subs="attributes"]
----
variant: fcos
version: {butane-latest-stable-spec}
systemd:
units:
- name: custom-iptables-nft.service
enabled: true
contents: |
[Unit]
Description=Set the nft backend for iptables
[Service]
ExecStart=/usr/sbin/alternatives --set iptables /usr/sbin/iptables-nft
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
----

You can also configure the default command manually. For example, to use the nft backend of the `iptables` commands:

.Example manually to configure default the iptables backend
[source,bash]
----
# Check the link info
alternatives --display iptables
iptables --version
# Config iptables to point to iptables-nft
sudo alternatives --set iptables /usr/sbin/iptables-nft
# Verify iptables version is iptables-nft
alternatives --display iptables
iptables --version
----

0 comments on commit 8d08485

Please sign in to comment.