Please help! Need to change IP address/subnet mask on my new Pi 3 Hass.io setup

Hello, I am a networking newbie and I haven’t been able to switch my Raspberry Pi 3’s IP address to something that my router can detect.

Hass.io is working via hassio.local:8123 and I’ve got SAMBA and Putty working. My problem is that my router itself cannot detect my Pi’s local IP address which is 192.168.1.71 according to my Fing app.

When I do ifconfig in Putty I see:
inet addr:172.30.33.0 Bcast:0.0.0.0 Mask:255.255.254.0

How do I change the IP to 192.168.1.71 and the subnet mask to 255.255.255.0 ? I believe that is what I need to do in order to have my router detect the Pi itself so that I can set up port forwarding rules.

I had/have Home Assistant running on a Windows 10 PC smoothly and only yesterday did I gett this Pi 3 set up and working with Hass.io. Now I would like to get this Hassio setup nicely so I can stop using the Windows version altogether but this IP address thing has me really stuck.

I’ve tried editing the /etc/dhcpcd.conf which was blank to:

interface eth0
static ip_address=192.168.1.71/24

I’ve also tried editing the resin connection file on my sd card to:

[connection]
id=my-ethernet
type=ethernet
interface-name=eth0
permissions=
secondaries=

[ethernet]
mac-address-blacklist=

[ipv4]
address1=192.168.1.71/24,192.168.1.1
dns=8.8.8.8;8.8.4.4;
dns-search=
method=manual

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

Does anyone know what I am doing wrong? I’ve spent about 5 hours now googling and reading and I am stumped. Thank you in advance.

Oh and my router is ASUS RT AC68U

It seems that you are fiddling with the internal networking between the host OS and the docker containers.

My suggestion is to undo the changes you made in the config files, and set the desidered address as a DHCP reservation in your router.

This guide is for RT-AC66U, I hope the interface is similar in your router. You can copy the MAC address from the Fing app.

1 Like

You can also find the mac address from your routers list of DHCP leases.

This is 100% the way to go. It makes IP management centralized and easier.
Also some device (eg Sonos) dont even allow static IPs.

1 Like

Thanks. I’m part way there. I did a fresh install of Hass.io again and have it detected in my router now. I also have it assigned in the DCHP list.
What I can’t understand now is how to access Home Assistant remotely. With my WIndows 10 setup of HA I could use my external ip address:8123 to load HA on my other devices. Now I use ifconfig to find the ip address on the pi3 but the page never loads when I try ipaddress:8123 on my other devices. Any ideas where I am going wrong there?

I notice when I do ifconfig on the pi3 that it lists the mask as: 255.255.254…0 and all my other devices on my network are 255.255.255.0 but I don’t know how to change it to match. and i’m not sure if that is my problem or not.

Probably a huge noob question but should all of my devices on my network have the same external ip address? if so, my pi3 address is different than my old windows 10 HA setup computer had for it’s external ip address.

Use the IP address your router has assigned to the Pi, the 192.168.x.x IP. Then use that on other devices to load it ie: http://192.168.x.x:8123

Ignore the 172.x.x.x address as that is an internal docker IP address that’s not exposed to your LAN.

I am using that while connected to the Wifi network but how do I access the Home Assistant web interface from my phone while not on the wifi?

Port forward in your router port 8123, i advise against this unless you reverse proxy the connection with HTTPS enabled as it will:

  1. Send your password (if setup in configuration.yaml) in the clear (bad)
  2. If no password setup, allow anyone who port scans you access to your home automation (very bad)

Thank you very much for mentioning that. Setting up a reverse proxy was going to be my next step I think I was just trying to identify an external ip address I could use with the Pi3. Do I have that option?

If I follow the tutorials to set up duckdns and letsencrypt will that solve my problem as far as security?

I bought a webhosting package and domain name the other day and I would like to make something like mysite.com/ha point to Hassio and mysite.com/plex point to my plex server. Do you know of any good tutorials showing how to do that? I’ve searched a lot but maybe am not using the right key words.

There isn’t one until you poke a hole in your firewall.

Only if that involves a reverse proxy, honestly I never followed the directions for that. I use an afraid.org dynamic DNS domain.

This can be done using redirects, suggested google search: “apache redirect” or “nginx redirect”, which ever webserver you use.

I’m trying to find a really good tutorial for getting nginx to work. So far no luck but thank you for pointing me in the right direction.

Here’s an example config for use with LetsEncrypt and Nginx:

worker_processes  2;

events {
    worker_connections  1024;
    use epoll;
}


http {
    map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }

    server {
        # Update this line to be your domain
        server_name your.server.name;

        # Ensure these lines point to your SSL certificate and key
        ssl_certificate      /etc/letsencrypt/live/your.server.name/fullchain.pem;
        ssl_certificate_key  /etc/letsencrypt/live/your.server.name/privkey.pem;


        # These shouldn't need to be changed
        # Proxy Home Assistant
        listen 443;
        listen [::]:443;
        add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
        ssl on;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;

        proxy_buffering off;

        location / {
            proxy_pass http://<IPADDRESS OF HA>:8123;
            proxy_set_header Host $host;
            proxy_redirect http:// https://;
            proxy_http_version 1.1;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
        }
   }

}

Thank you I am trying to figure out where to put that config. I installed the nginx addition for hass.io but when I use samba to explore files I just see my Home Assistant config files no new folder for nginx.

I did get duckdns and lets encrypt working so I have it it working with: mydomain.duckdns.com

I would like it to just be mydomain.com to work with my plex and I assume the config above would let me do that but would I need to do anything on my webhosted domain itself? Or is this all on my pi3 side?

and ever since I got the duckdns and lets encrypt working I can no longer reach my HA in my browser with localip:8123 I can now only use the mydomain.duckdns.org

I appreciate your assistance

I have no idea on hass.io, you may need a new thread regarding how to modify the config of nginx on hass.io

You need to update your domain dns a record to point to your isp assigned IP address.
If your isp assigned ip address is dynamic (most are) then you need to get your ddns service to update the dns.
I use cloud flare to manage my dns and dnsomatic as a ddns provider. Dnsomatic is cool as it allows you to update multiple sites in one call - eg update cloudflare and duckdns and afraid.org.

So for me my ddns client runs on my (ubiquiti) router.
When my isp ip changes, the router updates dnsomatic which updates cloudflare with multiple sub domains eg homeassistant.mydomain.com

Regarding not being able to access locally. This is because your router does not support hairpin NAT, or has it disabled ,
You need to enable hairpin NAT - e.g.:

image