# Wifi not working when network cable is plugged in

**URL:** <https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660>\
**Category:** General\
**Created:** [3 June 2021 15:54 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660 "2021-06-03T15:54:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [3 June 2021 15:54 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/1 "2021-06-03T15:54:19Z")

</div>

Hi Guys  
I have a small network of click PLCs  
I'm monitoring inputs using Modbus  
My PLCc are addressed 192.168.11.---  
The Server is addressed 192.168.63.1  
I changed my Pie's Wan IP Address to 192.168.11.101  
And I left the Pies wifi address as automatic  
If I don't have the cat 5 cable plugged in I can get internet over wifi (But cannot communicate with PLCs)  
When I plug in the cat 5 cable I can communicate with PLCs but I loose my internet connection  
Can anybody assist me with this  
Regards  
Barry Miller

---

<div class="post-metadata">

**Author:** ![wb666greene](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wb666greene/32/6534_2.png) [@wb666greene](https://discourse.nodered.org/u/wb666greene)\
**Post date:** [3 June 2021 16:10 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/2 "2021-06-03T16:10:10Z")

</div>

What is the Pie's address when on wifi?

192.168.11.xxx and 192.168.63.xxx are different class C subnets and devices can't talk to devices on the differnet subnet unless you have a gateway that routes between them. Your Pie should be able to be that router/gateway.

This might get you started:  
[https://linuxhint.com/raspberry\_pi\_wired\_router/#:~:text=Raspberry%20Pi%20has%20a%20Wi,to%20the%20wired%20network%20interface.](https://linuxhint.com/raspberry_pi_wired_router/#:~:text=Raspberry%20Pi%20has%20a%20Wi,to%20the%20wired%20network%20interface.)

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [3 June 2021 16:32 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/3 "2021-06-03T16:32:59Z")

</div>

Hi wb666greene  
192.168.63.112  
Thanks for the link

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [3 June 2021 16:40 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/4 "2021-06-03T16:40:19Z")

</div>

The Plot thickens  
With my cat 5 plugged in I can  
I can log into my pie using VNC  
But my pie cannot access the internet or send email  
So I have internet access  
??  
I'm confused

---

<div class="post-metadata">

**Author:** ![wb666greene](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wb666greene/32/6534_2.png) [@wb666greene](https://discourse.nodered.org/u/wb666greene)\
**Post date:** [3 June 2021 17:25 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/5 "2021-06-03T17:25:11Z")

</div>

I'm confused too, what is the IP of the host running the VNC that is logging into your Pie?  
Your Pie has to route from the Ethernet (192.168.11.xxx) to the WiFi (192.168.63.xxx) and vice-versa with the default gateway being your Internet router on 192.168.63 subnet.

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [3 June 2021 17:30 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/6 "2021-06-03T17:30:19Z")

</div>

Connection-specific DNS Suffix . :  
Link-local IPv6 Address . . . . . : fe80::556a:ac6:3b4e:a394%21  
IPv4 Address. . . . . . . . . . . : 192.168.11.101  
Subnet Mask . . . . . . . . . . . : 255.255.255.0  
Default Gateway . . . . . . . . . : 192.168.63.1

Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . : MSI.local  
Link-local IPv6 Address . . . . . : fe80::588f:ef4:acb0:5efb%20  
IPv4 Address. . . . . . . . . . . : 192.168.63.58  
Subnet Mask . . . . . . . . . . . : 255.255.255.0  
Default Gateway . . . . . . . . . : 192.168.63.1

I'm using this PC to program PLCs via network cable  
And surfing internet via wifi connection, And both connections work simultaneously

---

<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:** [3 June 2021 20:34 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/7 "2021-06-03T20:34:05Z")

</div>

What have you got connected on the ethernet port? Is it just the PLCs or is the 192.168.63.1 router also connected there? If not then you shouldn't have that as the gateway.

The problem is that it is trying to access the internet via that port in preference to the wifi (which is normally a good thing to do). You need to tell the OS that the wifi port should be preferred over the ethernet port, so it will only use ethernet for the PLC connection. I am not sure how to do that without looking it up, and I haven't time at the moment, so you may need to do a bit of googling. You need to use the `metric` option on the port.

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [4 June 2021 14:57 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/8 "2021-06-04T14:57:36Z")

</div>

The PLCs and the Pie are on the local network  
I was getting conflicts with my PLCs while they where addressed 192.168.63.---  
So physically they are on the same network but addressed with 192.168.11.---  
This eliminated all my conflicts , But I cannot communicate with the Pie.  
thanks for you help

---

<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:** [4 June 2021 20:31 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/9 "2021-06-04T20:31:42Z")

</div>

You cannot have two subnets on the same wire. So with a subnet mask of 255.255.255.0 you cannot have 192.168.11.x and 192.168.63.x addressed devices connected together. You could do that if you have one subnet on the ethernet and one on the wifi, but you seem to be saying that is not the case.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 August 2021 20:31 UTC](https://discourse.nodered.org/t/wifi-not-working-when-network-cable-is-plugged-in/46660/10 "2021-08-03T20:31:57Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
