aceberg / WatchYourLAN

Lightweight network IP scanner with web GUI
https://hub.docker.com/r/aceberg/watchyourlan
MIT License
1.24k stars 55 forks source link

cannot detect any machine #73

Closed xtay573269555 closed 3 months ago

xtay573269555 commented 5 months ago

Hi, i can detect any machine using this tool. Here is my step and env.

Docker machine is the host running watchyourlan container, and it's ip is 172.16.20.23. This machine is a LXC container running in a physical machine with PVE(Proxmox Virtual Environment) OS.

Docker host machine:

[root@docker tmp]# ip -4 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link-netnsid 0
    inet 172.16.20.23/24 brd 172.16.20.255 scope global eth0
       valid_lft forever preferred_lft forever
4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
[root@docker tmp]# 

Other alive machine in the same LAN:

[root@docker tmp]# ping 172.16.20.21
PING 172.16.20.21 (172.16.20.21) 56(84) bytes of data.
64 bytes from 172.16.20.21: icmp_seq=1 ttl=64 time=0.208 ms
64 bytes from 172.16.20.21: icmp_seq=2 ttl=64 time=0.053 ms
^C
--- 172.16.20.21 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1031ms
rtt min/avg/max/mdev = 0.053/0.130/0.208/0.077 ms
[root@docker tmp]# ping 172.16.20.22
PING 172.16.20.22 (172.16.20.22) 56(84) bytes of data.
64 bytes from 172.16.20.22: icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from 172.16.20.22: icmp_seq=2 ttl=64 time=0.030 ms
^C
--- 172.16.20.22 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1010ms
rtt min/avg/max/mdev = 0.030/0.031/0.033/0.001 ms
[root@docker tmp]#

Running script for watchyourlan

[root@docker tmp]# cat run_watchyourlan.sh 
#!/bin/bash

mkdir -p watchyourlan

docker run -d --restart unless-stopped \
  --name watchyourlan \
  --network=host \
  -e TZ=Asia/Shanghai \
  -e IFACE=eth0@if14 \
  -e GUIIP=0.0.0.0 \
  -e GUIPORT=8989 \
  -e ARP_TIMEOUT=2000 \
  -e TIMEOUT=60 \
  -e IGNOREIP=no \
  -e COLOR=dark \
  -e THEME=zephyr \
  -e HISTORY_DAYS=30 \
  -e LOGLEVEL=verbose \
  -v "$PWD"/watchyourlan:/data \
  aceberg/watchyourlan:1.0.6

Docker logs of watchyourlan:

[root@docker tmp]# docker logs -f watchyourlan 
2024/01/22 15:56:04 ERROR: SQL logic error: no such table: now (1)
2024/01/22 15:56:04 =================================== 
2024/01/22 15:56:04 Web GUI at http://0.0.0.0:8989
2024/01/22 15:56:04 =================================== 
2024/01/22 15:56:04 INFO: removing all history before 2023-12-23 15:56:04
2024/01/22 15:56:04 INFO: scanning interface eth0@if14
2024/01/22 15:56:04 INFO: found IPs: 
2024/01/22 15:57:04 INFO: scanning interface eth0@if14
2024/01/22 15:57:04 INFO: found IPs: 
2024/01/22 15:58:04 INFO: scanning interface eth0@if14
2024/01/22 15:58:04 INFO: found IPs: 
2024/01/22 15:59:04 INFO: scanning interface eth0@if14
2024/01/22 15:59:04 INFO: found IPs: 
2024/01/22 16:00:04 INFO: scanning interface eth0@if14
2024/01/22 16:00:04 INFO: found IPs: 
2024/01/22 16:01:04 INFO: scanning interface eth0@if14
2024/01/22 16:01:04 INFO: found IPs: 
wangeris commented 5 months ago

simillar issue here, not detecting any devices on lan, upgraded from older version. Running inside docker.

log output:

2024/01/24 19:22:42 =================================== 
2024/01/24 19:22:42 Web GUI at http://0.0.0.0:8840
2024/01/24 19:22:42 =================================== 
2024/01/24 19:22:42 INFO: removing all history before 2024-01-24 19:22:42
2024/01/24 19:22:42 INFO: scanning interface enp0s31f6
2024/01/24 19:22:42 INFO: found IPs: 
2024/01/24 19:24:42 INFO: scanning interface enp0s31f6
2024/01/24 19:24:42 INFO: found IPs: 
2024/01/24 19:26:42 INFO: scanning interface enp0s31f6
2024/01/24 19:26:42 INFO: found IPs: 

EDIT: started working after I set an ARP timeout, was empty before.

emidev98 commented 4 months ago

Hey @xtay573269555 and @wangeris,

You may want to check your networking interfaces, do an ifconfig and see if you may have an interface id that is not listed in the configuration file and you think it should be, add it to the config file, save and do a test notification