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: includes/virtual-network-multiple-ip-addresses-os-config.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,59 +52,59 @@ We recommend looking at the latest the documentation for your Linux distribution
52
52
1. Open a terminal window.
53
53
2. Make sure you are the root user. If you are not, enter the following command:
54
54
55
-
```bash
56
-
sudo -i
57
-
```
55
+
```bash
56
+
sudo -i
57
+
```
58
58
59
59
3. Update the configuration file of the network interface (assuming ‘eth0’).
60
60
61
61
* Keep the existing line item for dhcp. The primary IP address remains configured as it was previously.
62
62
* Add a configuration for an additional static IP address with the following commands:
63
63
64
-
```bash
65
-
cd /etc/network/interfaces.d/
66
-
ls
67
-
```
64
+
```bash
65
+
cd /etc/network/interfaces.d/
66
+
ls
67
+
```
68
68
69
69
You should see a .cfg file.
70
70
4. Open the file. You should see the following lines at the end of the file:
71
71
72
-
```bash
73
-
auto eth0
74
-
iface eth0 inet dhcp
75
-
```
72
+
```bash
73
+
auto eth0
74
+
iface eth0 inet dhcp
75
+
```
76
76
77
77
5. Add the following lines after the lines that exist in this file:
78
78
79
-
```bash
80
-
iface eth0 inet static
81
-
address <your private IP address here>
82
-
netmask <your subnet mask>
83
-
```
79
+
```bash
80
+
iface eth0 inet static
81
+
address <your private IP address here>
82
+
netmask <your subnet mask>
83
+
```
84
84
85
85
6. Save the file by using the following command:
86
86
87
-
```bash
88
-
:wq
89
-
```
87
+
```bash
88
+
:wq
89
+
```
90
90
91
91
7. Reset the network interface with the following command:
92
92
93
-
```bash
94
-
sudo ifdown eth0 && sudo ifup eth0
95
-
```
93
+
```bash
94
+
sudo ifdown eth0 && sudo ifup eth0
95
+
```
96
96
97
-
> [!IMPORTANT]
98
-
> Run both ifdown and ifup in the same line if using a remote connection.
99
-
>
97
+
> [!IMPORTANT]
98
+
> Run both ifdown and ifup in the same line if using a remote connection.
99
+
>
100
100
101
101
8. Verify the IP address is added to the network interface with the following command:
102
102
103
-
```bash
104
-
ip addr list eth0
105
-
```
103
+
```bash
104
+
ip addr list eth0
105
+
```
106
106
107
-
You should see the IP address you added as part of the list.
107
+
You should see the IP address you added as part of the list.
108
108
109
109
### Linux (Ubuntu 18.04+)
110
110
Ubuntu 18.04 and above have changed to `netplan`for OS network management. We recommend looking at the latest the documentation for your Linux distribution.
0 commit comments