Add Second IP on Raspberry Pi

I originally had one WAN static IP address assigned to my Raspberry Pi (66.211.214.82). I wanted to add a second (66.211.214.83).

The way I did that was to leave dhcpcd.conf alone, which included this definition of the first IP.

/etc/dhcpcd.conf:

interface eth0
static ip_address=66.211.214.82/29
static routers=66.211.214.81
static domain_name_servers=8.8.8.8

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.

/etc/network/interfaces.d/eth0-subs:

auto eth0:1
allow-hotplug eth0:1
iface eth0:1 inet static
vlan-raw-device eth0
address 66.211.214.83
netmask 255.255.255.248
gateway 66.211.214.81

I rebooted the Raspberry Pi:

sudo reboot 

and when it came back up both IPs were functional.

See the following for more information:
https://raspberrypi.stackexchange.com/questions/89927/create-multiple-ip-adresses-on-pi

This was performed on Raspian 9 (stretch) in May, 2019.

Leave a Reply

Your email address will not be published. Required fields are marked *