Futher flesh out the generator
- Create a per-host directory called overlays/$(overlay)/hostname/$(host.hostname) to have files that ought to be included only for that host. Things like /etc/vpp/config/interface.vpp go there - Rename the "templates" directory as overlays/$(overlay)/common/ - Render one after the other, so a file can exist in common and hostname, the latter taking precedence - Remove the config for 'pubkeys' and instead just make these common/root/.ssh/* and common/home/ipng/.ssh/* - Split out bootstrap.vpp so that a per-host include can be overriden for interfaces.vpp - But keep a default common/etc/vpp/config/interface.vpp as a placeholder, so that VPP will still start even if the per-hostname override isn't provided. - Generate a fresh output for 'default' on all machines
This commit is contained in:
6
overlays/bird/common/etc/bird/bfd.conf.j2
Normal file
6
overlays/bird/common/etc/bird/bfd.conf.j2
Normal file
@ -0,0 +1,6 @@
|
||||
protocol bfd bfd1 {
|
||||
interface "e*" {
|
||||
interval 100 ms;
|
||||
multiplier 20;
|
||||
};
|
||||
}
|
19
overlays/bird/common/etc/bird/bird.conf.j2
Normal file
19
overlays/bird/common/etc/bird/bird.conf.j2
Normal file
@ -0,0 +1,19 @@
|
||||
router id {{ node.loopback.ipv4.split("/")[0] }};
|
||||
|
||||
protocol device { scan time 30; }
|
||||
protocol direct { ipv4; ipv6; check link yes; }
|
||||
protocol kernel kernel4 {
|
||||
ipv4 { import none; export where source != RTS_DEVICE; };
|
||||
learn off;
|
||||
scan time 300;
|
||||
}
|
||||
protocol kernel kernel6 {
|
||||
ipv6 { import none; export where source != RTS_DEVICE; };
|
||||
learn off;
|
||||
scan time 300;
|
||||
}
|
||||
|
||||
include "static.conf";
|
||||
include "bfd.conf";
|
||||
include "ospf.conf";
|
||||
include "ibgp.conf";
|
1
overlays/bird/common/etc/bird/ibgp.conf.j2
Normal file
1
overlays/bird/common/etc/bird/ibgp.conf.j2
Normal file
@ -0,0 +1 @@
|
||||
# NOTE(ipng): Not created yet
|
21
overlays/bird/common/etc/bird/ospf.conf.j2
Normal file
21
overlays/bird/common/etc/bird/ospf.conf.j2
Normal file
@ -0,0 +1,21 @@
|
||||
protocol ospf v2 ospf4 {
|
||||
ipv4 { export where source = RTS_DEVICE; import all; };
|
||||
area 0 {
|
||||
interface "loop0" { stub yes; };
|
||||
interface "e0" { type pointopoint; cost 5; bfd off; };
|
||||
interface "e1" { type pointopoint; cost 5; bfd off; };
|
||||
interface "e2" { type pointopoint; cost 5; bfd off; };
|
||||
interface "e3" { type pointopoint; cost 5; bfd off; };
|
||||
};
|
||||
}
|
||||
|
||||
protocol ospf v3 ospf6 {
|
||||
ipv6 { export where source = RTS_DEVICE; import all; };
|
||||
area 0 {
|
||||
interface "loop0" { stub yes; };
|
||||
interface "e0" { type pointopoint; cost 5; bfd off; };
|
||||
interface "e1" { type pointopoint; cost 5; bfd off; };
|
||||
interface "e2" { type pointopoint; cost 5; bfd off; };
|
||||
interface "e3" { type pointopoint; cost 5; bfd off; };
|
||||
};
|
||||
}
|
11
overlays/bird/common/etc/bird/static.conf.j2
Normal file
11
overlays/bird/common/etc/bird/static.conf.j2
Normal file
@ -0,0 +1,11 @@
|
||||
protocol static static4 {
|
||||
ipv4 { export all; };
|
||||
# route 192.0.2.0/24 via 10.0.0.1;
|
||||
route {{lab.ipv4}} unreachable;
|
||||
}
|
||||
|
||||
protocol static static6 {
|
||||
ipv6 { export all; };
|
||||
# route 2001:db8:cafe::/48 via 2001:db8::1;;
|
||||
route {{lab.ipv6}} unreachable;
|
||||
}
|
1
overlays/bird/common/etc/hostname.j2
Normal file
1
overlays/bird/common/etc/hostname.j2
Normal file
@ -0,0 +1 @@
|
||||
{{ node.hostname }}
|
7
overlays/bird/common/etc/hosts.j2
Normal file
7
overlays/bird/common/etc/hosts.j2
Normal file
@ -0,0 +1,7 @@
|
||||
127.0.0.1 localhost
|
||||
127.0.1.1 {{node.hostname}}.lab.ipng.ch {{node.hostname}}
|
||||
|
||||
# The following lines are desirable for IPv6 capable hosts
|
||||
::1 localhost ip6-localhost ip6-loopback
|
||||
ff02::1 ip6-allnodes
|
||||
ff02::2 ip6-allrouters
|
14
overlays/bird/common/etc/netplan/01-netcfg.yaml.j2
Normal file
14
overlays/bird/common/etc/netplan/01-netcfg.yaml.j2
Normal file
@ -0,0 +1,14 @@
|
||||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
enp1s0:
|
||||
optional: true
|
||||
accept-ra: false
|
||||
dhcp4: false
|
||||
addresses: [ {{node.mgmt.ipv4}}, {{node.mgmt.ipv6}} ]
|
||||
gateway4: {{lab.mgmt.gw4}}
|
||||
gateway6: {{lab.mgmt.gw6}}
|
||||
nameservers:
|
||||
addresses: [ "2001:678:d78::3", "2001:678:d78::4" ]
|
||||
search: [ "lab.ipng.ch", "ipng.ch", "ipng.nl", "rfc1918.ipng.nl" ]
|
8
overlays/bird/common/etc/vpp/bootstrap.vpp.j2
Normal file
8
overlays/bird/common/etc/vpp/bootstrap.vpp.j2
Normal file
@ -0,0 +1,8 @@
|
||||
comment { Apply system defaults from the build }
|
||||
exec /etc/vpp/config/defaults.vpp
|
||||
exec /etc/vpp/config/loopback.vpp
|
||||
exec /etc/vpp/config/interface.vpp
|
||||
exec /etc/vpp/config/lcp.vpp
|
||||
|
||||
comment { Allow user to set persistent manual configs }
|
||||
exec /etc/vpp/config/manual.vpp
|
4
overlays/bird/common/etc/vpp/config/defaults.vpp
Normal file
4
overlays/bird/common/etc/vpp/config/defaults.vpp
Normal file
@ -0,0 +1,4 @@
|
||||
set logging class linux-cp rate-limit 1000 level warn syslog-level notice
|
||||
lcp default netns dataplane
|
||||
lcp lcp-sync on
|
||||
lcp lcp-auto-subint off
|
1
overlays/bird/common/etc/vpp/config/interface.vpp.j2
Normal file
1
overlays/bird/common/etc/vpp/config/interface.vpp.j2
Normal file
@ -0,0 +1 @@
|
||||
comment { This file is overridden by blobs/{{node.hostname}}/etc/vpp/config/interfaces.vpp }
|
6
overlays/bird/common/etc/vpp/config/lcp.vpp
Normal file
6
overlays/bird/common/etc/vpp/config/lcp.vpp
Normal file
@ -0,0 +1,6 @@
|
||||
comment { Create one LinuxCP Interface Pair for each phy }
|
||||
lcp create loop0 host-if loop0
|
||||
lcp create GigabitEthernet10/0/0 host-if e0
|
||||
lcp create GigabitEthernet10/0/1 host-if e1
|
||||
lcp create GigabitEthernet10/0/2 host-if e2
|
||||
lcp create GigabitEthernet10/0/3 host-if e3
|
5
overlays/bird/common/etc/vpp/config/loopback.vpp.j2
Normal file
5
overlays/bird/common/etc/vpp/config/loopback.vpp.j2
Normal file
@ -0,0 +1,5 @@
|
||||
comment { Create a loopback interface }
|
||||
create loopback interface instance 0
|
||||
set interface state loop0 up
|
||||
set interface ip address loop0 {{ node.loopback.ipv4 }}
|
||||
set interface ip address loop0 {{ node.loopback.ipv6 }}
|
5
overlays/bird/common/home/ipng/.ssh/authorized_keys
Normal file
5
overlays/bird/common/home/ipng/.ssh/authorized_keys
Normal file
@ -0,0 +1,5 @@
|
||||
# pim@ipng.nl - absynth, bfib, gripe, spongebob, homenet
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8X6oRdLn7PckWIRL+Fgp46qN+fglQLBJIvPHJ2P277v4tx/qlELaT8w45YyEPrUZ4XbbNIB4P59H63wPxIpk/d15k0C7Zx3kTESaEQuts3fne3ZFmrWm0dLD2yDTiB0zCraiQ5a0w++xuGEC3wdWPV+FHZh5Ea+WCd91g2xXPHJeosAQzBBBBaC9Shhx91h6lbCm4evvgqLnwt7JgnI2N4w2qr13lDDaRD4BXfyFrtLSTdhBgYEaFnUd6Afz5ilfDYXQW/yTSHZOIQ/vNVFpFxYrtmwHDdrSMiDpz0FE/4LLBG/rFl2VvRTmTEyjvwpGpEVaivMOLo/jRc3TA7jKB pim@ipng.nl
|
||||
|
||||
# pim's M1 macbookpro SeKEY
|
||||
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKDP/hLZusPNfKTy3t9bbbOHyczX+UACc4rYstc3QEDBDfxBnCZcMKN5Mv10o+q/+ap7wyFhONlz/qcUhEMbI1k=
|
5
overlays/bird/common/root/.ssh/authorized_keys
Normal file
5
overlays/bird/common/root/.ssh/authorized_keys
Normal file
@ -0,0 +1,5 @@
|
||||
# pim@ipng.nl - absynth, bfib, gripe, spongebob, homenet
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8X6oRdLn7PckWIRL+Fgp46qN+fglQLBJIvPHJ2P277v4tx/qlELaT8w45YyEPrUZ4XbbNIB4P59H63wPxIpk/d15k0C7Zx3kTESaEQuts3fne3ZFmrWm0dLD2yDTiB0zCraiQ5a0w++xuGEC3wdWPV+FHZh5Ea+WCd91g2xXPHJeosAQzBBBBaC9Shhx91h6lbCm4evvgqLnwt7JgnI2N4w2qr13lDDaRD4BXfyFrtLSTdhBgYEaFnUd6Afz5ilfDYXQW/yTSHZOIQ/vNVFpFxYrtmwHDdrSMiDpz0FE/4LLBG/rFl2VvRTmTEyjvwpGpEVaivMOLo/jRc3TA7jKB pim@ipng.nl
|
||||
|
||||
# pim's M1 macbookpro SeKEY
|
||||
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKDP/hLZusPNfKTy3t9bbbOHyczX+UACc4rYstc3QEDBDfxBnCZcMKN5Mv10o+q/+ap7wyFhONlz/qcUhEMbI1k=
|
Reference in New Issue
Block a user