Skip to content

Commit 3785464

Browse files
fix(tuto): formatting (#5223)
1 parent e1957dd commit 3785464

File tree

1 file changed

+80
-80
lines changed

1 file changed

+80
-80
lines changed

pages/dedibox-ip-failover/how-to/configure-debian-ubuntu.mdx

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -26,102 +26,102 @@ This guide provides step-by-step instructions for configuring a Dedibox [failove
2626
## Failover IP configuration on Debian
2727

2828
1. Connect to your server using SSH and open the network configuration file `/etc/network/interfaces` in a text editor, such as `nano`:
29-
```bash
30-
nano /etc/network/interfaces
31-
```
29+
```bash
30+
nano /etc/network/interfaces
31+
```
3232
2. Add the failover IP to the configuration as shown in the following example:
33-
```bash
34-
# This file describes the network interfaces available on your system
35-
# and how to activate them. For more information, see interfaces(5).
36-
# The loopback network interface
37-
auto lo
38-
iface lo inet loopback
39-
# The primary network interface
40-
auto eth0
41-
iface eth0 inet static
42-
address 195.154.123.123
43-
netmask 255.255.255.0
44-
gateway 195.154.123.1
45-
auto eth0:0
46-
iface eth0:0 inet static
47-
address ip_failover
48-
netmask 255.255.255.255
49-
```
50-
<Message type="note">
51-
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.
52-
</Message>
33+
```bash
34+
# This file describes the network interfaces available on your system
35+
# and how to activate them. For more information, see interfaces(5).
36+
# The loopback network interface
37+
auto lo
38+
iface lo inet loopback
39+
# The primary network interface
40+
auto eth0
41+
iface eth0 inet static
42+
address 195.154.123.123
43+
netmask 255.255.255.0
44+
gateway 195.154.123.1
45+
auto eth0:0
46+
iface eth0:0 inet static
47+
address ip_failover
48+
netmask 255.255.255.255
49+
```
50+
<Message type="note">
51+
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.
52+
</Message>
5353

5454
3. Save the file and exit the editor. Bring up the interface using the following command:
55-
```bash
56-
ifup eth0:0
57-
```
55+
```bash
56+
ifup eth0:0
57+
```
5858

5959
## Failover IP configuration on Ubuntu (Netplan)
6060

6161
Since Ubuntu 18.04, Netplan has been the default network configuration system.
6262

6363
1. Disable cloud-init network configuration to prevent conflicts with Netplan:
64-
```bash
65-
sudo mkdir -p /etc/cloud/cloud.cfg.d
66-
echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
67-
```
68-
<Message type="important">
69-
This step is necessary to prevent cloud-init from overriding the Netplan configuration.
70-
</Message>
64+
```bash
65+
sudo mkdir -p /etc/cloud/cloud.cfg.d
66+
echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
67+
```
68+
<Message type="important">
69+
This step is necessary to prevent cloud-init from overriding the Netplan configuration.
70+
</Message>
7171

7272
2. Backup the existing Netplan configuration and create a new file:
73-
```bash
74-
sudo cp /etc/netplan/50-cloud-init.yaml /etc/netplan/01-myplan.yaml
75-
sudo mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml-backup
76-
```
73+
```bash
74+
sudo cp /etc/netplan/50-cloud-init.yaml /etc/netplan/01-myplan.yaml
75+
sudo mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml-backup
76+
```
7777
4. Edit the new Netplan configuration file `/etc/netplan/01-myplan.yaml` using `nano`:
78-
```yml
79-
network:
80-
renderer: networkd
81-
ethernets:
82-
enp5s0:
83-
critical: true
84-
dhcp-identifier: mac
85-
dhcp4: false
86-
dhcp6: false
87-
addresses:
88-
- 51.111.222.333/24 # Server main IP (/24)
89-
- 212.111.222.333/32 # Alternate IPs / IP redirects (/32)
90-
- 212.111.222.334/32
91-
- 212.111.222.335/32
92-
routes:
93-
- to: 0.0.0.0/0
94-
via: 62.210.0.1
95-
metric: 1
96-
on-link: true
97-
nameservers:
78+
```yml
79+
network:
80+
renderer: networkd
81+
ethernets:
82+
enp5s0:
83+
critical: true
84+
dhcp-identifier: mac
85+
dhcp4: false
86+
dhcp6: false
9887
addresses:
99-
- 51.159.69.156
100-
- 51.159.69.162
101-
enp6s0:
102-
dhcp4: true
103-
dhcp4-overrides:
104-
use-routes: false
105-
routes:
106-
- to: 10.88.0.0/13 # Use appropriate IP/gateway from DHCP
107-
via: 10.89.23.129
108-
version: 2
109-
```
110-
<Message type="tip">
111-
Ensure that indentation and formatting are correct to avoid YAML syntax errors.
112-
</Message>
88+
- 51.111.222.333/24 # Server main IP (/24)
89+
- 212.111.222.333/32 # Alternate IPs / IP redirects (/32)
90+
- 212.111.222.334/32
91+
- 212.111.222.335/32
92+
routes:
93+
- to: 0.0.0.0/0
94+
via: 62.210.0.1
95+
metric: 1
96+
on-link: true
97+
nameservers:
98+
addresses:
99+
- 51.159.69.156
100+
- 51.159.69.162
101+
enp6s0:
102+
dhcp4: true
103+
dhcp4-overrides:
104+
use-routes: false
105+
routes:
106+
- to: 10.88.0.0/13 # Use appropriate IP/gateway from DHCP
107+
via: 10.89.23.129
108+
version: 2
109+
```
110+
<Message type="tip">
111+
Ensure that indentation and formatting are correct to avoid YAML syntax errors.
112+
</Message>
113113
114114
5. Run the following command to test the configuration:
115-
```bash
116-
sudo netplan try
117-
```
115+
```bash
116+
sudo netplan try
117+
```
118118
6. If everything works as expected, apply the configuration:
119-
```bash
120-
sudo netplan apply
121-
```
122-
<Message type="important">
123-
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.
124-
</Message>
119+
```bash
120+
sudo netplan apply
121+
```
122+
<Message type="important">
123+
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.
124+
</Message>
125125

126126
## Troubleshooting
127127

0 commit comments

Comments
 (0)