Overview of innernet-publicip
maininnernet-publicip is a library used by innernet to retrieve the local machine's public IP address. It provides support for both IPv4 and IPv6.repository·main·Indexed 26 days ago
https://github.com/tonarino/innernetA private networking system built on top of WireGuard that uses CIDRs and ACL primitives to manage secure, peer-to-peer connectivity across a distributed network. It includes a client for managing network interfaces and a coordination server (innernet-server) to manage peers and endpoint information. The system provides tools for managing network segments, peer invitations, and endpoint overrides, and includes helper libraries such as hostsfile, netlink-request, innernet-publicip, and wireguard-control.
innernet-publicip is a library used by innernet to retrieve the local machine's public IP address. It provides support for both IPv4 and IPv6.wireguard-control is a high-level control library designed to get and set configurations for WireGuard interfaces. It is a heavily-modified fork of wgctrl-rs specifically optimized for use with innernet.
Supported implementations:
wireguard-go on macOS and Linux)hostsfile library provides a simple way to programmatically edit or replace specific parts of the /etc/hosts file. It is designed to allow developers to inject custom host mappings into the system's hosts file without manually parsing or overwriting the entire file.netlink-request is a helper library designed to facilitate performing requests via the Linux netlink interface. It is intended to be used as a dependency for interacting with kernel networking subsystems through netlink.You can install innernet and innernet-server using your system's package manager or via Cargo. Note that WireGuard must be present on your system (either via kernel support or wireguard-go).
Arch Linux
pacman -S innernetmacOS
brew install tonarino/innernet/innernetCargo (Latest Releases)
# Install innernet client
cargo install --locked innernet
# Install innernet server
cargo install --locked innernet-servercargo install --locked innernet
cargo install --locked innernet-serverTo add a peer to the network, first create an invitation via the server or an admin peer. The process generates an invitation file (TOML format) that must be transferred securely to the target machine.
1. Create the invitation (on server/admin):
sudo innernet-server add-peer <interface>
# OR (via admin peer)
sudo innernet add-peer <interface>2. Install the client (on the new peer):
sudo innernet install /path/to/invitation.tomlOnce installed, you can verify the connection with:
sudo innernet list
# or for a hierarchical view
sudo innernet list --treesudo innernet install /path/to/invitation.tomlTo permanently remove a created network and its configuration, use the uninstall command on the server. Use this with extreme caution as it is a destructive action.
sudo innernet-server uninstall <interface>sudo innernet-server uninstall <interface>Peers in different CIDRs cannot communicate unless the CIDRs are explicitly associated. Use an admin peer to create these associations.
Add an association:
sudo innernet add-association <interface>(The CLI will prompt you to select the two CIDRs to associate.)
List current associations:
sudo innernet list-associations <interface>Delete an association:
sudo innernet delete-associations <interface>sudo innernet add-association <interface>innernet-server binary, ensure you have rustc/cargo (v1.50.0+), libclang, and libsqlite3 installed. If your target system uses SELinux, enable the selinux feature to ensure correct context maintenance on the /etc/hosts file by installing the selinux-devel package and adding the --features selinux flag to your build command.To build the innernet client CLI binary, ensure you have rustc/cargo (v1.50.0+) and libclang installed. The resulting binary will be located at ./target/release/innernet.
cargo build --release --bin innernetYou can manually invoke Docker-based tests if a Docker daemon is running. Use the --interactive flag to attach to the server and client innernet Docker containers, allowing you to test commands inside a sandboxed environment.
docker-tests/build-docker-images.sh
docker-tests/run-docker-tests.sh [--interactive]Every innernet network requires a coordination server to manage peers and endpoint information. Use the innernet-server CLI to initialize a new network. The wizard will guide you through setting up the root CIDR and an automatic "infra" CIDR for server reachability.
To start the initialization process:
sudo innernet-server newTo run the server manually:
sudo innernet-server serve <interface>On Linux, you can enable it as a systemd service:
systemctl enable --now innernet-server@<interface>sudo innernet-server new