I originally had one WAN static IP address assigned to my Raspberry Pi (18.104.22.168). I wanted to add a second (22.214.171.124).
The way I did that was to leave dhcpcd.conf alone, which included this definition of the first IP.
interface eth0 static ip_address=126.96.36.199/29 static routers=188.8.131.52 static domain_name_servers=184.108.40.206
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 220.127.116.11 netmask 255.255.255.248 gateway 18.104.22.168
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.