https://github.com/realityanomaly/nix-router
Set up a BGP/OSPF network on the public internet with Nix.
https://github.com/realityanomaly/nix-router
Last synced: 2 months ago
JSON representation
Set up a BGP/OSPF network on the public internet with Nix.
- Host: GitHub
- URL: https://github.com/realityanomaly/nix-router
- Owner: RealityAnomaly
- Created: 2023-06-27T23:48:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-05T17:35:32.000Z (almost 2 years ago)
- Last Synced: 2025-02-14T19:23:26.398Z (4 months ago)
- Language: Nix
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nix-router
nix-router is a router configuration framework written entirely in Nix which can dynamically generate and integrate configuration for routing tools available on NixOS, such as bird2, tinc, wireguard, tailscale, tayga, and iptables.
## Example
Make sure you import your peer configurations!
```nix
services.nix-router.router.peers = import ./peers.nix;
``````nix
services.nix-router = {
# enables the routing framework
enable = true;# the interface to use for management and tunnel traffic
underlay = "ens18";router = {
# Configures the primary IPv4 and IPv6 addresses of this node.
ipv4.addrs.primary = { address = "185.167.182.4"; prefixLength = 30; };
ipv6.addrs.primary = { address = "2a10:4a80:3::1"; prefixLength = 48; };
};peers = {
ifog = {
asn = 34927;
types = peerTypes.upstream;
ipv4.addrs = ["193.148.249.1"];
ipv6.addrs = ["2a0c:9a40:1::1"];
};
};
}
```