Add secondary IP
In rare cases, a second IP might be required. To add a secondary IP, the network configuration file will need to be manually edited.
Download a copy of the network configuration file. These are stored in
/etc/netctl
and are share the same name as the interface. If you are usingenp2s0
to access the gateway, then you'll need to download/etc/netctl/enp2s0
.Edit the file in a Unix compatible text editor. Most modern editors will work (Atom, VSCode, Sublime Notepad++), but avoid older programs like Notepad.
Add the following line to the end of the file, replacing the IP address and interface name with your required values. Essentially these strings are passed directly to the
ip
command. Routes and tertiary addresses can also be added by adding more strings to the array.Save the changes and upload the file to the device, replacing the old configuration file
Restart the interface, e.g.
netctl restart enp2s0
Last updated