Verified and Tested 08/12/2015
This guide will show you how to add an additional public and/or private IP on your Arch Linux server.
-An Arch Linux server and an additional public IP reserved and assigned to the server or a private IP chosen for your granted private IP range.
-Netctl installed on the server.
Adding an Additional IP on Arch Linux
The first thing we will need to do is create a netctl file for eth0 (or edit the current one if it exists.) In our case the file /etc/netctl/eth0 exists, so we’ll edit that and add our additional IP address, y.y.y.y/xy.
Connection='ethernet' Description='Eth0 IPs' Interface='eth0' IP='static' Address=('x.x.x.x/xy' 'y.y.y.y/xy') Gateway='xg.xg.xg.xg' DNS=('18.104.22.168' '22.214.171.124')
Connection is the connection type.
Description is a custom description for the connection. You can use what you’d like.
Interface is the interface we will be using for the connection.
IP is the type the IP will be. Usually this is static or DHCP if you have IP allocation by DHCP available.
Address is the list of IP addresses and their associated subnets. Each IP address needs to be contained inbetween a pair of ‘ ‘ and separated by a space. They need to contain their associated subnet in order to work. This is where you list your main IP and then any additional IP addresses.
Gateway is the default gateway for the server. This should be the main IP’s gateway and no others.
DNS would be the DNS servers. In this instance I used the Atlantic.Net DNS servers.
We then need to restart this by running:
netctl restart eth0
Once up, you should be good to go and the additional IP should now respond.
Adding an Private IP on Arch Linux
To do a private IP we would need to create a new netctl file that we’ll name eth1. It is essentially the same as adding a public IP only this uses the private interface.
Description='Private ethernet connection' Interface=eth1 Connection=ethernet IP=static Address=('x.x.x.x/xy')
You can add as many private IPs as you’d like following the IP addition example in the Public IP section. Simply add more IPs between a pair of ‘ ‘ and separated by a space. Once saved, just bring it up with:
netctl start eth1
Once this is up, your private IP will start working.
That’s all there is to adding a new IP address on an Arch Linux system.