diff options
author | Freya Murphy <freya@freyacat.org> | 2023-12-30 15:23:30 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2023-12-30 15:23:30 -0500 |
commit | 9ea034f42095bb1a61d1e8ee628575cb2bbee7e6 (patch) | |
tree | 123e5758aa4b078eea5dce59ebe4f1afaf7ec523 /README.md | |
parent | stubnet (diff) | |
download | freyanet-9ea034f42095bb1a61d1e8ee628575cb2bbee7e6.tar.gz freyanet-9ea034f42095bb1a61d1e8ee628575cb2bbee7e6.tar.bz2 freyanet-9ea034f42095bb1a61d1e8ee628575cb2bbee7e6.zip |
refactor
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 156 |
1 files changed, 85 insertions, 71 deletions
@@ -1,102 +1,116 @@ # freyanet -this container allows perring multiple servers togeather with ospf creating an internetwork on any subnet +peer multiple ospf nodes over wireguard to make an internal network ## running -`docker run --privileged --network host -v $PWD/config:/config g.freya.cat/freya/freyanet` - -or with docker-compose: +### docker ```yml version: "3" services: inet2: - image: g.freya.cat/freya/freyanet - network_mode: host # needed otherwise internal network wont be accessable - privileged: true - volumes: - - ./config:/config + image: g.freya.cat/freya/freyanet + network_mode: host # needed otherwise internal network wont be accessable + privileged: true + volumes: + - ./inet2.conf:/etc/inet2.conf +``` + +### host + +run the following commands with the provided makefile + +```bash +$ make +$ make <os> ``` +the current supported os's are: `alpine` + +start the `inet2` service to start freyanet + ## config -create a file at /config/inet2.conf +- if running in docker mount a file called `inet2.conf` at `/etc/inet2.conf` +- if running on host make a file called `/etc/inet2.conf` ``` -# specify router id +# specify router id for ospf RouterID 10.1.1.1 +# optionally assign static addresses to the loopback interface +Loopback 1.2.3.4 + # specify routed subnets +# ips that are not in these subnets will be ignored +# put the ip blocks for your entire internal network Subnet 10.0.0.0/8 -Subnet fd:cafe::/48 +Subnet fd:cafe::/32 + +# specify node stubnets +# ip blocks that this node is gurenteed to route +Stubnet 10.1.0.0/8 +Stubnet fd:cafe:dead::/48 # optional global private key gets used for all interfaces PrivateKey = {host private key} +# create a peered wireguard interface +# specify addresses, routes, ports, pre/post commands, and peers +# keys can be generated with wg genkey and wg pubkey interface interfacename - # indentation is a single tab per level - - # set the address(es) to assign to the interface - # route lines are usually the same as Address but with host bits zeroed - Address 10.2.255.1/30 - Route 10.2.255.0/30 # must specify route - # you can also set ipv6 - Address fd:cafe::ffff/64 - Address fd:cafe::/64 - # link local is also possible (and prefered for peering routers) - # link-local addresses should *not* have an associated Route line - Address fe80::1/64 - Route 1.1.1.0/24 - # more syntax options - Route 1.1.2.0/24 via 1.1.1.2 - Route default via 1.1.1.3 - # optional: set Gateway and Gateway6 to configure a default gateway - # through this interface - Gateway 1.1.1.2 - Gateway6 fe80::1111:1111:1111:1111 - # port to listen on in the host's network namespace, over udp - # you probably have to allow this through your firewall - ListenPort {host port} - # omit if using global private key - PrivateKey {host private key} - # all optional - PreUp command - PostUp command - PreDown command - PostDown command - - # if running ospf on this interface - OSPF - # if running ospf on this interface and it's a stub network (no other routers) - OSPF stub - - peer peername - PublicKey {peer public key} - # if the peer is a router, it has to have AllowedIPs set to everything and be the only - # peer on the interface - AllowedIPs 0.0.0.0/0, ::/0 - # either: - Domain = {domain name of peer} - Port = {peer port} - # or: - Endpoint = {peer ip}:{peer port} - # make domain enpoint resolve with ipv (ipv6 is default) - IPv4 - - # optional - PersistentKeepalive = 25 + # indentation is a single tab per level + # otherwise file will fail to parse -# optionally assign static addresses to the loopback interface -# this has its uses for making things ibgp not dependent on a specific interface being up -Loopback 1.2.3.4 + # set the address(es) to assign to the interface + # route lines are usually the same as Address but with host bits zeroed + Address 10.2.255.1/30 + Route 10.2.255.0/30 # must specify route + # you can also set ipv6 + Address fd:cafe::ffff/64 + Address fd:cafe::/64 + # link local is also possible (and prefered for peering routers) + # link-local addresses should *not* have an associated Route line + Address fe80::1/64 + Route 1.1.1.0/24 + # more syntax options + Route 1.1.2.0/24 via 1.1.1.2 + Route default via 1.1.1.3 + # port to listen on in the host's network namespace, over udp + # you probably have to allow this through your firewall + ListenPort {host port} + # omit if using global private key + PrivateKey {host private key} + # all optional + PreUp command + PostUp command + PreDown command + PostDown command + + # if running ospf on this interface + OSPF + # if running ospf on this interface and it's a stub network (no other routers) + OSPF stub + + peer peername + PublicKey {peer public key} + # if the peer is a router, it has to have AllowedIPs set to everything and be the only + # peer on the interface + AllowedIPs 0.0.0.0/0, ::/0 + # either: + Domain = {domain name of peer} + Port = {peer port} + # or: + Endpoint = {peer ip}:{peer port} + # make domain enpoint resolve with ipv (ipv6 is default) + IPv4 + + # optional + PersistentKeepalive = 25 ``` -and other optional files: -- `/config/setup.sh` gets run on the first run of the container with the host's networking -- `/config/start.sh` gets run every time the container starts up with the host's networking - -### Licenses +## licenses | License | Author | Project | |---------|--------|---------| |