Crates.io | lookaround |
lib.rs | lookaround |
version | 0.1.6 |
source | src |
created_at | 2021-12-06 00:12:15.772751 |
updated_at | 2021-12-09 18:24:25.715419 |
description | Report and find your MAC and IP addresses within LANs |
homepage | https://six-five-six-four.com/git/reactor/lookaround |
repository | https://six-five-six-four.com/git/reactor/lookaround |
max_upload_size | |
id | 492918 |
size | 76,699 |
"I want to SSH into my laptop, but I keep forgetting its IP!!"
Has this ever happened to you?
$ ping $(lookaround find-nick laptop)
PING 192.168.1.101 (192.168.1.101) 56(84) bytes of data.
...
$ lookaround client
Found 3 peers:
11:11:11:11:11:11 = 192.168.1.101 `laptop`
22:22:22:22:22:22 = 192.168.1.102 `desktop`
33:33:33:33:33:33 = 192.168.1.103 `old-laptop`
LookAround is a Rust program for looking up your computers' MAC and IP addresses within a LAN. There's no central server, so it's not a look-up, it's a look-around.
Make sure Cargo is installed from RustUp.
# Install LookAround with Cargo
cargo install lookaround
# Find your config directory
# Prints something like `Using config dir "/home/user/.config/lookaround"`
lookaround config
Create the files client.ini
and/or server.ini
in that directory
(e.g. /home/user/.config/lookaround/server.ini)
# Clients can store MAC-nickname pairs in client.ini, like a hosts file.
# This is useful if your servers are short-lived and you want the clients
# to be the source of truth for nicknames.
[nicknames]
11-11-11-11-11-11 = laptop
22-22-22-22-22-22 = desktop
# Long-lived servers can have their nickname configured in server.ini
[server]
nickname = my-computer
Put this systemd unit in ~/.config/systemd/user/lookaround.service
:
[Unit]
Description=LookAround
[Service]
ExecStart=/home/user/.cargo/bin/lookaround server
Restart=always
[Install]
WantedBy=default.target
Then start the service, check that it's running okay, and enable it for auto-start:
systemctl --user start lookaround
systemctl --user status lookaround
systemctl --user enable lookaround
(untested)
lookaround.exe server
so it will run the serverC:\ProgramData\somewhere
Run the server manually: (To test before installing)
lookaround server --nickname my-computer
On a client computer:
# Use the `find-nick` subcommnad to find an IP...
lookaround find-nick laptop
# Prints `192.168.1.101`
# Or ping it...
ping $(lookaround find-nick laptop)
# Or SSH to it...
ssh user@$(lookaround find-nick laptop)
# Or pull a file from it
# (after starting `nc -l -p 9000 < some-file` on the laptop)
nc $(lookaround find-nick laptop) 9000
# Use the `client` subcommand to find all servers in the same multicast domain
lookaround client
# Use a longer timeout if servers need more than 500 ms to respond
lookaround client --timeout-ms 1000
Pull requests are welcome. This is a hobby project, so I may reject contributions that are too big to review.
Use the kazupon Git commit message convention
This repo's upstream is https://six-five-six-four.com/git/reactor/lookaround. It's mirrored on my GitHub, https://github.com/ReactorScram/lookaround
I don't use GitHub issues, so issues are in issues.md in the repo.