You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/dedibox-ip-failover/how-to/configure-debian-ubuntu.mdx
+80-80Lines changed: 80 additions & 80 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,102 +26,102 @@ This guide provides step-by-step instructions for configuring a Dedibox [failove
26
26
## Failover IP configuration on Debian
27
27
28
28
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
+
```
32
32
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
-
<Messagetype="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
+
<Messagetype="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>
53
53
54
54
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
+
```
58
58
59
59
## Failover IP configuration on Ubuntu (Netplan)
60
60
61
61
Since Ubuntu 18.04, Netplan has been the default network configuration system.
62
62
63
63
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
-
<Messagetype="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
+
<Messagetype="important">
69
+
This step is necessary to prevent cloud-init from overriding the Netplan configuration.
70
+
</Message>
71
71
72
72
2. Backup the existing Netplan configuration and create a new file:
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
98
87
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>
113
113
114
114
5. Run the following command to test the configuration:
115
-
```bash
116
-
sudo netplan try
117
-
```
115
+
```bash
116
+
sudo netplan try
117
+
```
118
118
6. If everything works as expected, apply the configuration:
119
-
```bash
120
-
sudo netplan apply
121
-
```
122
-
<Messagetype="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
+
<Messagetype="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.
0 commit comments