summaryrefslogtreecommitdiff
path: root/README.md
blob: 909a15585d562952bdd17e7b3fdb27f2643edd2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# freyanet

this container allows perring multiple servers togeather with ospf creating an internetwork on any subnet

## running

`docker run --privileged --network host -v $PWD/config:/config g.freya.cat/freya/freyanet`

or with docker-compose:

```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
```

## config

create a file at /config/inet2.conf

```
# specify router id
RouterID 10.1.1.1

# specify routed subnets
Subnet 10.0.0.0/8
Subnet fd:cafe::/48

# optional global private key gets used for all interfaces
PrivateKey = {host private key}

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

# 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
```

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

| License | Author | Project |
|---------|--------|---------|
| [MIT](https://mit-license.org/) | tint | [inet2](https://git.tint.red/tint/inet2) |
| [MIT](https://mit-license.org/) | freya | freyanet |