Skip to content

Commit

Permalink
Gerhard was here
Browse files Browse the repository at this point in the history
and PUSH
  • Loading branch information
gExPl0ReR committed Jul 3, 2023
1 parent 81671eb commit 6e8d658
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions additional-ip-in-linux.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Adding aditional IP in Linux VPS"
title: "Adding additional IPv4 on a Linux VPS"
description: >
How to add aditional IP address in your Linux VPS
How to add an aditional IPv4 address on your Linux VPS
---

If you obtained an additional IP address for your KVM, it will not be added to your server's network settings automatically. You have to manually configure the IP address in your operating system's network configuration. Before you add or update any IP addresses on your VPS, make sure to restart your service (reboot). Doing so updates the ethernet bridge's firewall and allows your VPS to communicate with the internet.
Expand All @@ -12,10 +12,10 @@ Below are instructions on how to add a secondary IP address to your KVM.

#### Adding an IP address in Debian Linux or Ubuntu

On your server with primary IP `192.168.1.1` on `eth0`
On your server with primary IP `192.168.1.1` on `eth0`
you want to add the secondary IP of `192.168.1.2` as follows

**edit** `/etc/network/interfaces` and
**edit** `/etc/network/interfaces` and
**add** the following 2 lines at the end of your config:

```bash filename="/etc/network/interfaces"
Expand All @@ -33,17 +33,17 @@ After editing, run the command `sudo ifup eth0:0` to activate the new interface.

#### Adding an IP address in CentOS

On your server with primary IP 192.168.1.1 on eth0
On your server with primary IP 192.168.1.1 on eth0
you want to add the secondary IP of 192.168.1.2 as follows

Log in as user root and navigate to your **/etc/sysconfig/network-scripts** directory.
Log in as user root and navigate to your **/etc/sysconfig/network-scripts** directory.
In this folder you find your network interface config file(s).

```bash
ls -l | grep ifcfg-eth -rw-r--r-- 1 root root 119 Jan 11 19:16 ifcfg-eth0
```

Clone (copy) the primary adapter configuration file _ifcfg-eth0_ and
Clone (copy) the primary adapter configuration file _ifcfg-eth0_ and
name it after the first virtual adapter _ifcfg-eth0:0_

```bash
Expand All @@ -53,9 +53,9 @@ ls -l | grep ifcfg-eth -rw-r--r-- 1 root root 119 Jan 11 19:16 ifcfg-eth0 -rw-r-

**edit** the file `ifcfg-eth0:0`, and use the following configuration for this virtual adapter.

static IP
remove hardware address (MAC)
configure the IP address and netmask
static IP
remove hardware address (MAC)
configure the IP address and netmask
rename the device from `eth0` to `eth0:0`

```bash
Expand All @@ -66,5 +66,5 @@ IPADDR=192.168.1.2
NETMASK=255.255.255.0
```

After editing you will have to restart the networking service
After editing you will have to restart the networking service
with the command `service network restart`

0 comments on commit 6e8d658

Please sign in to comment.