# Cannot access raspberry pi with static ip

**URL:** <https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220>\
**Category:** Hardware\
**Created:** [7 May 2020 08:59 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220 "2020-05-07T08:59:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RednodeNewbie](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@RednodeNewbie](https://discourse.nodered.org/u/RednodeNewbie)\
**Post date:** [7 May 2020 08:59 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/1 "2020-05-07T08:59:24Z")

</div>

Hello everyone, I am newbie on this platform I am sorry if I am in a wrong place to ask this. I have a raspberry pi server that node red is running on and a client/arduino. I set static ip in raspberry I wrote only ipv4 ip and router ip( for example 162.27.200.45 and 162.27.200.1 ) the rest automatically filled up. I connect 3 device (server, client and my windows pc) into switch. I set 162.27.200.50 ip on my windows pc, I cannot connect my server via my computer I tried send ping to server, didnt respond but I can reach my client through ping. When I use router in place of switch, there is no problem with connection. What might be the problem ? Why i cannot reach raspberry pi through ip altough I am in the same ip block ?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 May 2020 09:05 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/2 "2020-05-07T09:05:23Z")

</div>

You may need to elaborate on the IP numbers a bit more.

- What is the RasPie's IP
- What is the Subnet mask

How are you trying to connect to the _server_? _Server_ as in: RasPi and Node-Red?

To connect to see Node-Red on the RasPie, you need to enter:  
`<ip address>:1880` in the URL of the browser.

That may be all you need, so maybe try the last part first and the first part last if that doesn't work.

---

<div class="post-metadata">

**Author:** ![RednodeNewbie](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@RednodeNewbie](https://discourse.nodered.org/u/RednodeNewbie)\
**Post date:** [7 May 2020 09:13 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/3 "2020-05-07T09:13:28Z")

</div>

Raspberry pi ip : 162.17.200.22 / subnetmask: 255.255.0.0 / gateway : 162.17.200.1  
My windows pc : 162.17.200.24 / subnetmask: 255.255.0.0 / gateway : 162.17.200.1  
aduino ip : 162.17.200.23 subnetmask: 255.255.0.0 / gateway : 162.17.200.1

When I send ping to raspberry from my PC in comnand window using switch  
Request timed out.  
Request timed out.  
Request timed out.  
Request timed out.

when I use router I send ping to raspberry from pc  
Reply from 162.17.200.23: bytes=32 time\<1ms TTL=128  
Reply from 162.17.200.23: bytes=32 time\<1ms TTL=128  
Reply from 162.17.200.23: bytes=32 time\<1ms TTL=128  
Reply from 162.17.200.23: bytes=32 time\<1ms TTL=128

Ping statistics for 172.17.60.25:  
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),  
Approximate round trip times in milli-seconds:

Why I use 255.255.0.0 ? Actually I didnt pay attention to that, later I changed it but nothing changed  
Gateway ip address is 162.17.200.1 for all the devices.

ı dont know what kind of router I use. Everest brand one of the cheap ones

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 May 2020 09:17 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/4 "2020-05-07T09:17:11Z")

</div>

Dumb question:

Why do you have subnet masks of `255.255.0.0` and not the usual `255.255.255.0`?

What kind of router do you have?

~~Oh, another question: What are the `gateway` IP addresses in the devices?~~  
Sorry.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 May 2020 09:23 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/5 "2020-05-07T09:23:57Z")

</div>

Could you clarify what is happening with the `switch` and what is happening with the `router`.

The way it is written is not clear.

Say what happens with the `switch` connected (NO ROUTER) and pinging between RasPi and _PC_.

Then what happens with the `router`.  
PING only for now.

Oh, P.S.  
As you are a _newbie_ you will be limited to how many posts you can do.  
I would suggest you post your reply to my `PING` question and then stop posting `new` posts. EDIT the reply you will be posting in answer to the `PING` question/s.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [7 May 2020 10:45 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/6 "2020-05-07T10:45:47Z")

</div>

> [@RednodeNewbie](#):
>
> 162.17.200.x

This is not a correct range within a LAN, it is a public ip while you should use private ip’s in a LAN (it will technically work but can cause conflicts, also on the internet). How did you get these addresses?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 May 2020 10:45 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/7 "2020-05-07T10:45:49Z")

</div>

Can you ping the PC from the Pi?  
Can you access the Arduino from the PC and the Pi?

---

<div class="post-metadata">

**Author:** ![RednodeNewbie](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@RednodeNewbie](https://discourse.nodered.org/u/RednodeNewbie)\
**Post date:** [7 May 2020 10:54 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/8 "2020-05-07T10:54:20Z")

</div>

I tried now I cannot reach from pi to pc or vice versa. There is no problem with arduino now I can reach arduino.

It might be out of range but still it should be able to reach like in arduino.

Edit : In advanced ip scanner program on pc, I can see my raspberry device but still no connection

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 May 2020 11:02 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/9 "2020-05-07T11:02:22Z")

</div>

Can you reach the Arduino from both the pi and the pc?  
What else is connected to the switch and what IP addresses do they have?

---

<div class="post-metadata">

**Author:** ![RednodeNewbie](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@RednodeNewbie](https://discourse.nodered.org/u/RednodeNewbie)\
**Post date:** [7 May 2020 11:07 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/10 "2020-05-07T11:07:50Z")

</div>

I can reach from pc but not from raspberry.

Apart from these 3 device, there is no another device

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 May 2020 11:12 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/11 "2020-05-07T11:12:16Z")

</div>

So you can reach the arduino from the pc but the pi is not accessible and cannot talk to anything. Therefore you have a fundamental problem of some sort with the Pi or its connection. On the pi what do you see if your run  
`ifconfig`  
or if that command is not found then  
`ip addr`  
Also show us the output on the pc of pinging the Arduino.

---

<div class="post-metadata">

**Author:** ![RednodeNewbie](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@RednodeNewbie](https://discourse.nodered.org/u/RednodeNewbie)\
**Post date:** [7 May 2020 11:43 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/12 "2020-05-07T11:43:22Z")

</div>

I think Lets put arduino aside for now and focus on rpi connection.

I see all the values I set as I configured before.  
inet 162.17.200.22 netmask 255.255.255.0 broadcast 162.17.200.255 on raspberry side

Pinging arduino respond in miliseconds

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 May 2020 12:25 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/13 "2020-05-07T12:25:03Z")

</div>

What exactly do you see for the Arduino ping? We can't put it aside as it works. There must be a difference somewhere.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 May 2020 12:28 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/14 "2020-05-07T12:28:13Z")

</div>

I presume you can't do a screenshot or copy/paste of the Pi ifconfig output as it doesn't have a network connection, can you take a photo of it?

---

<div class="post-metadata">

**Author:** ![RednodeNewbie](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@RednodeNewbie](https://discourse.nodered.org/u/RednodeNewbie)\
**Post date:** [7 May 2020 13:25 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/15 "2020-05-07T13:25:13Z")

</div>

I cannot do it right know I am away from my home. I basically want to learn why I cannot reach my RPi without using router. When I use router there is no problem at all and then I remove all ethernet cables and plug them into switch, I cannot reach anymore. Do I need to use router every time I want to reach rpi ?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [7 May 2020 14:22 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/16 "2020-05-07T14:22:02Z")

</div>

Hi  
You seem to be using very unusual IP addresses on your devices - as @bakman2 said - 162. addresses are real internet addresses not normally used on LANs

LANs use addresses starting 192.168 or 10. or 172.16. (See [https://en.wikipedia.org/wiki/Private\_network](https://en.wikipedia.org/wiki/Private_network))

So "normally" a home device gets an IP address from a router (most commonly starting 192.168) so the first thing I'd do would be to reset your PC and your Pi back to using DHCP and see what addresses they end up with.

If you could do that and report back that would help out a lot as it would give us a base line to work with 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 May 2020 14:49 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/19 "2020-05-07T14:49:01Z")

</div>

> [@RednodeNewbie](#):
>
> Do I need to use router every time I want to reach rpi ?

I don't know, provide the asked for information and it may be possible to determine the reason.  
None of this is anything to do with node-red of course.  
As others have said it would also be better to give your devices conventional ip addresses

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 May 2020 21:34 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/20 "2020-05-07T21:34:39Z")

</div>

Another thing which hasn't been addressed:

Is Node-Red running on the rpi?

It may be installed, but is it running?

Is the rpi set up for SSH?

I feel a lot of the problem/s could be that if NR isn't running, the page (understandably) won't load. And if it isn't set up to accept SSH connections it is going to be a real problem seeing its configuration.

Question to @RednodeNewbie:  
You haven't clarified what happens if you have a `switch` between the devices and what happens with the `router`.

In which configuration can they all be pinged from the PC?

My suspicion is that the `router` is not _routing_ the stuff locally.  
Where as if it is only a `switch` (and works) it is because it is sending the requests out on all ports (at this stage) and is getting a reply.

You also need to qualify:  
Is it a `managed` switch, or a `non-managed` switch.  
And when using it: Is there an _uplink_ else where?  
(This information is also handy when using the `router`)

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [7 May 2020 23:36 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/21 "2020-05-07T23:36:11Z")

</div>

If he puts the router into the network it will probably route all traffic out to the internet using the ip's he's provided because the router would think that's where the ip's are. That is unless he jiggered with the routing table and I would assume he hasn't done that if he's asking the questions he's asked. Using a subnet of 255.255.0.0 wouldn't cause his pings to fail in a normal situation it would just open up his network to a whole lot more ip addresses. If he has a switch or even a hub the first thing to do would be to hard wire all the devices into it. (hub or switch) assign the ip's and try to ping. At that point if it doesn't respond you have a bad hub/switch, bad cable, bad network card or misconfigured ip addresses. As long as there is no router in the network he could use any address range he wanted. Assuming they are all in the same subnet.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [7 May 2020 23:39 UTC](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220/22 "2020-05-07T23:39:47Z")

</div>

Honestly, I'm not sure.

The subnet mask and the default gateway as shown shouldn't work.  
Because the address for the gateway is in the wrong range. Though I guess you can set the gateway at what ever address you want.

I agree the pings (etc) may be getting sent up stream if the router is used.

But he hasn't really clarified that part.

[Next page](https://discourse.nodered.org/t/cannot-access-raspberry-pi-with-static-ip/26220.md?page=2)
