I have a Sungrow inverter I'd like to connect to. The inverter only has the option to change the ip and subnet (192.168.1.239). My RPi (Stretch) is physically connected to the inverter and I have set the RPi to have a static IP (192.168.1.6)but I cannot connect or even ping the inverter. I have a wireless router providing dhcp (192.168.1.100-150). The wlan0 is connected to the router via a static ip (192.168.1.5). How do I set the eth0 ip to connect to the inverter without providing the eth0 with a gateway or dns? Have I got this wrong? Should I be putting in the dns and gateway of my router in the eth0 settings as well?
As far as I understand your Raspberry Pi uses two interfaces: wlan0 to connect to your local wireless router, and eth0 to connect wired to the Sungrow inverter. With different interfaces you also have to use different subnets, each interface connected to a subnet. The wireless network (interface wlan0) uses subnet 192.168.1.0/24 with ip addresses 192.168.1.1 to 192.168.1.255.
You set eth0 to 192.168.1.6 and the inverters ip address to 192.168.1.239. This cannot work because these ip addresses are on the same subnet of wlan0. I suggest to configure eth0 to subnet 192.168.2.0/24 and give it the ip address 192.168.2.6 and the inverter set to 192.168.2.239/24 (or what you like between 192.168.2.1 and 192.168.2.254 except 192.168.2.6), or in netmask notification: to 192.168.2.239 netmask 255.255.255.0.
iptables
. – Seamus Aug 16 '20 at 14:37