How to Add Second IP on Raspberry Pi

  • Post author:
  • Post category:Linux

I originally had one WAN static IP address assigned to my Raspberry Pi (i.e. I wanted to add a second (

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


interface eth0
static ip_address=
static routers=
static domain_name_servers=

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

I rebooted the Raspberry Pi:

sudo reboot 

and when it came back up both IPs were functional.

See the following for more information:

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


Jason works as a project specialist at an IT MSP in Pennsylvania, USA. He's an IT/security professional with 20 years experience.