Skip to content

Commit

Permalink
this article needs rework ASAP
Browse files Browse the repository at this point in the history
  • Loading branch information
xploz1on committed Jul 4, 2023
1 parent 8a98f41 commit 040868d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions configure-additional-ip-for-linux.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ Below are instructions on how to add a secondary IP address to your KVM.
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
```bash
nano /etc/network/interfaces
```
**add** the following 2 lines at the end of your config:

auto eth0 iface eth0 inet static address 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.254 post-up ip a a 192.168.1.2/24 dev eth0 pre-down ip a d 192.168.1.2/24 dev eth0
Expand All @@ -29,9 +32,9 @@ 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.
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
name it after the first virtual adapter _ifcfg-eth0:0_

Expand Down

0 comments on commit 040868d

Please sign in to comment.