From badcaa13e0d525fd8a0ce5657a50aada9aafc4c7 Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:45:10 +0200 Subject: [PATCH] fix(tuto): formatting --- .../how-to/configure-debian-ubuntu.mdx | 160 +++++++++--------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/pages/dedibox-ip-failover/how-to/configure-debian-ubuntu.mdx b/pages/dedibox-ip-failover/how-to/configure-debian-ubuntu.mdx index 5a9303cfc2..6521f31cce 100644 --- a/pages/dedibox-ip-failover/how-to/configure-debian-ubuntu.mdx +++ b/pages/dedibox-ip-failover/how-to/configure-debian-ubuntu.mdx @@ -26,102 +26,102 @@ This guide provides step-by-step instructions for configuring a Dedibox [failove ## Failover IP configuration on Debian 1. Connect to your server using SSH and open the network configuration file `/etc/network/interfaces` in a text editor, such as `nano`: - ```bash - nano /etc/network/interfaces - ``` + ```bash + nano /etc/network/interfaces + ``` 2. Add the failover IP to the configuration as shown in the following example: - ```bash - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - # The loopback network interface - auto lo - iface lo inet loopback - # The primary network interface - auto eth0 - iface eth0 inet static - address 195.154.123.123 - netmask 255.255.255.0 - gateway 195.154.123.1 - auto eth0:0 - iface eth0:0 inet static - address ip_failover - netmask 255.255.255.255 - ``` - - The interface name (`eth0` in this example) may vary depending on your OS version and system configuration. Use the `ifconfig` command to determine the name of your primary network interface. - + ```bash + # This file describes the network interfaces available on your system + # and how to activate them. For more information, see interfaces(5). + # The loopback network interface + auto lo + iface lo inet loopback + # The primary network interface + auto eth0 + iface eth0 inet static + address 195.154.123.123 + netmask 255.255.255.0 + gateway 195.154.123.1 + auto eth0:0 + iface eth0:0 inet static + address ip_failover + netmask 255.255.255.255 + ``` + + The interface name (`eth0` in this example) may vary depending on your OS version and system configuration. Use the `ifconfig` command to determine the name of your primary network interface. + 3. Save the file and exit the editor. Bring up the interface using the following command: - ```bash - ifup eth0:0 - ``` + ```bash + ifup eth0:0 + ``` ## Failover IP configuration on Ubuntu (Netplan) Since Ubuntu 18.04, Netplan has been the default network configuration system. 1. Disable cloud-init network configuration to prevent conflicts with Netplan: - ```bash - sudo mkdir -p /etc/cloud/cloud.cfg.d - echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg - ``` - - This step is necessary to prevent cloud-init from overriding the Netplan configuration. - + ```bash + sudo mkdir -p /etc/cloud/cloud.cfg.d + echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg + ``` + + This step is necessary to prevent cloud-init from overriding the Netplan configuration. + 2. Backup the existing Netplan configuration and create a new file: - ```bash - sudo cp /etc/netplan/50-cloud-init.yaml /etc/netplan/01-myplan.yaml - sudo mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml-backup - ``` + ```bash + sudo cp /etc/netplan/50-cloud-init.yaml /etc/netplan/01-myplan.yaml + sudo mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml-backup + ``` 4. Edit the new Netplan configuration file `/etc/netplan/01-myplan.yaml` using `nano`: - ```yml - network: - renderer: networkd - ethernets: - enp5s0: - critical: true - dhcp-identifier: mac - dhcp4: false - dhcp6: false - addresses: - - 51.111.222.333/24 # Server main IP (/24) - - 212.111.222.333/32 # Alternate IPs / IP redirects (/32) - - 212.111.222.334/32 - - 212.111.222.335/32 - routes: - - to: 0.0.0.0/0 - via: 62.210.0.1 - metric: 1 - on-link: true - nameservers: + ```yml + network: + renderer: networkd + ethernets: + enp5s0: + critical: true + dhcp-identifier: mac + dhcp4: false + dhcp6: false addresses: - - 51.159.69.156 - - 51.159.69.162 - enp6s0: - dhcp4: true - dhcp4-overrides: - use-routes: false - routes: - - to: 10.88.0.0/13 # Use appropriate IP/gateway from DHCP - via: 10.89.23.129 - version: 2 - ``` - - Ensure that indentation and formatting are correct to avoid YAML syntax errors. - + - 51.111.222.333/24 # Server main IP (/24) + - 212.111.222.333/32 # Alternate IPs / IP redirects (/32) + - 212.111.222.334/32 + - 212.111.222.335/32 + routes: + - to: 0.0.0.0/0 + via: 62.210.0.1 + metric: 1 + on-link: true + nameservers: + addresses: + - 51.159.69.156 + - 51.159.69.162 + enp6s0: + dhcp4: true + dhcp4-overrides: + use-routes: false + routes: + - to: 10.88.0.0/13 # Use appropriate IP/gateway from DHCP + via: 10.89.23.129 + version: 2 + ``` + + Ensure that indentation and formatting are correct to avoid YAML syntax errors. + 5. Run the following command to test the configuration: - ```bash - sudo netplan try - ``` + ```bash + sudo netplan try + ``` 6. If everything works as expected, apply the configuration: - ```bash - sudo netplan apply - ``` - - If there is an error in your configuration, it might render your network inaccessible. You may need to revert changes using [KVM/IPMI](/dedibox-kvm-over-ip/quickstart/) access. - + ```bash + sudo netplan apply + ``` + + If there is an error in your configuration, it might render your network inaccessible. You may need to revert changes using [KVM/IPMI](/dedibox-kvm-over-ip/quickstart/) access. + ## Troubleshooting