Skip to content

Commit

Permalink
small format fix4
Browse files Browse the repository at this point in the history
  • Loading branch information
IlirEdis committed Jul 3, 2023
1 parent a5bdc0b commit f253ccc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion additional-ip-in-linux.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ you want to add the secondary IP of `192.168.1.2` as follows
**edit** `/etc/network/interfaces` and
**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
```bash
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
```

After editing, run the command `sudo ifup eth0:0` to activate the new interface.

Expand Down

0 comments on commit f253ccc

Please sign in to comment.