I originally had one WAN static IP address assigned to my Raspberry Pi (184.108.40.206). I wanted to add a second (220.127.116.11).
The way I did that was to leave dhcpcd.conf alone, which included this definition of the first IP.
interface eth0 static ip_address=18.104.22.168/29 static routers=22.214.171.124 static domain_name_servers=126.96.36.199
To add the second IP, I created a file in /etc/network/interfaces.d called eth0-subs and added the info for the second IP.
auto eth0:1 allow-hotplug eth0:1 iface eth0:1 inet static vlan-raw-device eth0 address 188.8.131.52 netmask 255.255.255.248 gateway 184.108.40.206
I rebooted the Raspberry Pi:
and when it came back up both IPs were functional.
See the following for more information:
Jason works as a project specialist at an IT MSP in Erie, Pennsylvania, USA. He’s an IT/security professional with 17 years experience.