pucherot / Pi.Alert

WIFI / LAN intruder detector. Check the devices connected and alert you with unknown devices. It also warns of the disconnection of "always connected" devices
GNU General Public License v3.0
1.98k stars 122 forks source link

Systems with 2 IPs get listed under just 1 of them #48

Open INeedCaffeine opened 3 years ago

INeedCaffeine commented 3 years ago

I have a RPi connected to my network with both ethernet and Wi-Fi:

image

In Pi.Alert the system was only showing as 2 separate "(unknown)" entries:

image

I checked them and found they have different MAC addresses. The first one is actually the ETH0 connection and the second is the WLAN0. The ETH0 uses a static IP that is much higher than the dynamic IP that the system picks up on WLAN0.

Pi.Alert is incorrectly saying the ETH0 connection is using the dynamic IP that the WLAN connection uses and is totally ignoring the static IP for some reason.

(Edit to correct the Pi.Alert screenshot fragment)

pucherot commented 3 years ago

Thanks. I will study this problem.

pucherot commented 3 years ago

please, can you execute this command:

sqlite3 ~/pialert/db/pialert.db "select * from devices where dev_mac like 'dc:a6:32%'"
pucherot commented 3 years ago

Hi? any news?

INeedCaffeine commented 3 years ago

Sorry, was tied up with family events all weekend. Here is the output:

pi@pi-hole:~ $ sqlite3 ~/pialert/db/pialert.db "select * from devices where dev_mac like 'dc:a6:32%'"

dc:a6:32:93:70:c6|pi-hole|House|Other|Raspberry Pi Trading Ltd|0|Always on||2021-01-26 22:11:00|2021-01-26 22:11:00|192.168.1.245|0|1|1|1|0|0|2021-01-26 22:12:21.377531|0 dc:a6:32:9b:d6:7f|Kahncert|House|Server|Raspberry Pi Trading Ltd|0|Always on||2021-01-26 22:11:00|2021-01-26 22:11:00|192.168.1.247|0|1|1|1|0|0|2021-01-26 22:12:21.377531|0 dc:a6:32:a2:d3:b4|Kahncert|House|Server|Raspberry Pi Trading Ltd|0|Always on||2021-01-26 22:11:00|2021-01-26 22:11:00|-|0|1|1|1|0|0|2021-01-26 22:12:21.377531|0 dc:a6:32:a3:0b:37|Kahntainer ETH0|House|NAS|Raspberry Pi Trading Ltd|0|Always on|There is also an WLAN connection|2021-01-26 22:11:00|2021-01-26 22:11:00|192.168.1.31|0|1|1|1|0|0|2021-01-26 22:12:21.377531|1 dc:a6:32:a3:0b:38|Kahntainer WLAN|House|NAS|Raspberry Pi Trading Ltd|0|Always on|There is also an ETH0 connection|2021-01-26 22:11:00|2021-01-26 22:11:00|192.168.1.31|0|1|1|1|0|0|2021-01-26 22:12:21.377531|0

Kahncert is my Kodi server. I swapped the actual RPi out once while triaging a problem with it which is why it has 2 MAC entries. (The problem was a bad power supply.)

Kahntainer is the RPi in question with the dual interfaces.

pucherot commented 3 years ago

76 - Pi device that is running Pi.Alert shows as offline

This fix perhaps solve this problem too.

only to confirm, can you execute this command ip route ?