UpSnap icon indicating copy to clipboard operation
UpSnap copied to clipboard

[REQUEST] Add multiple network interfaces per device

Open carteakey opened this issue 3 years ago • 4 comments

The problem you currently have with this project I have a peculiar (i think) case where my Raspberry Pi is hooked up to my home server (a repurposed ASUS Laptop) through the ethernet cable. Here the Raspberry Pi acts as the Wake-on-LAN server, to send shutdown and wake commands to the main server. Both access internet through Wi-Fi, and the home server apparently only supports WOL, not Wake-on-WLAN. So the ping IP (Wi-Fi) is different than the one for the wake-up (Ethernet). UpSnap can either shutdown or wake up system through the available configurations, but not both.

Describe the solution you'd like Currently i just run commands through the Raspberry pi like so Suspend

sshpass -p password ssh [email protected] "sudo systemctl suspend"

Wake up (send broadcast through the ethernet)

sudo etherwake -i eth0 04:d4:c4:e1:29:83

The request to discuss the possibility of either

  1. Declaring a Broadcast IP directly instead of NetMask.
  2. A custom wakeup command like the shutdown one.

Additional context

If i setup UpSnap with netmask as 255.255.0.0 and IP as 169.254.152.218, it is able to wake the system fine, but this ethernet link will stay up and it will not detect the system to be down ever (ping will always return bytes).

Or, if i setup UpSnap device with the Wi-Fi IP and netmask, it will shutdown the system fine, but wont broadcast the magic packet to the correct eth0 interface / broadcast.

IP details from RPi

pi@raspberrypi:~ $ ip a | grep eth
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether e4:5f:01:4a:39:a5 brd ff:ff:ff:ff:ff:ff
    inet 169.254.152.218/16 brd 169.254.255.255 scope global noprefixroute eth0
    link/ether e4:5f:01:4a:39:a6 brd ff:ff:ff:ff:ff:ff
    link/ether 02:42:52:5b:ba:2d brd ff:ff:ff:ff:ff:ff
    link/ether 02:42:ca:88:f1:00 brd ff:ff:ff:ff:ff:ff

IP details from Server

carteakey@server:~$ ip a
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 04:d4:c4:e1:29:83 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6d4:c4ff:fee1:2983/64 scope link 
       valid_lft forever preferred_lft forever
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 80:91:33:9c:74:3b brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.43/24 brd 192.168.2.255 scope global dynamic noprefixroute wlp3s0
       valid_lft 258554sec preferred_lft 258554sec
    inet6 fe80::8291:33ff:fe9c:743b/64 scope link 
       valid_lft forever preferred_lft forever

Thank you in advance!

carteakey avatar Mar 26 '23 13:03 carteakey

To summarize this, I think it's best to support multiple network interfaces per device instead of custom wake commands. Each network interface could have it's own ip, mac and shutdown command. As this is quite a big change of how the database is set up, I'll put this on my to do for the future.

seriousm4x avatar Mar 26 '23 23:03 seriousm4x

@seriousm4x - I agree, Thank you!

carteakey avatar Mar 27 '23 20:03 carteakey

+1 for this, I have a server with two interfaces, one for WoL and one for OpenShift (Kubernetes). I disable the WoL interface on boot to prevent some issues with OpenShift however this means that upsnap has no way to check if the server is up or down since that interface stops responding after boot.

Being able to configure multiple interfaces and have more control over where commands get sent would be really helpful.

gnunn1 avatar Aug 26 '23 16:08 gnunn1

  • 1 for this, also using upsnap in a server with multiple interfaces and it doesn't work

SIGTERM-015 avatar Nov 04 '23 17:11 SIGTERM-015