bundlewrap/nodes/home/router.py

101 lines
3.2 KiB
Python
Raw Normal View History

2020-11-13 22:57:12 +00:00
from bundlewrap.metadata import atomic
2020-11-13 17:47:40 +00:00
nodes['home.router'] = {
2020-11-13 22:57:12 +00:00
'hostname': '172.19.138.1',
2020-11-13 20:41:24 +00:00
'bundles': {
'iptables',
2020-11-13 20:41:24 +00:00
'pppd',
'radvd',
'dhcpd',
'wide-dhcp6c',
2020-11-13 20:41:24 +00:00
},
2020-11-13 17:47:40 +00:00
'groups': set(),
'metadata': {
'interfaces': {
'enp1s0.23': {
'ips': {
2020-11-13 22:57:12 +00:00
'172.19.139.1/24',
2020-11-13 17:47:40 +00:00
},
},
'enp1s0.42': {
'ips': {
2020-11-13 22:57:12 +00:00
'172.19.138.1/24',
2020-11-13 17:47:40 +00:00
},
},
2020-11-13 20:41:24 +00:00
'enp1s0.100': {
'ignore': True,
},
2020-11-13 17:47:40 +00:00
},
'backups': {
'exclude_from_backups': True,
},
'cron': {
# Our internet provider resets the connection if you're
# connected longer than 24 hours. We install this cronjob
# to make sure we don't get disconnected randomly during the
# day.
'restart_pppd': '23 2 * * * root systemctl restart pppoe',
},
'iptables': {
'custom_rules': [
'iptables_both -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT',
'iptables_both -A FORWARD -i enp1s0.23 -o enp1s0.42 -j REJECT',
'iptables_both -A FORWARD -i enp1s0.23 -j ACCEPT',
'iptables_both -A FORWARD -i enp1s0.42 -j ACCEPT',
],
},
2020-11-13 22:57:12 +00:00
'nameservers': atomic({
'9.9.9.10',
}),
'radvd': {
'integrate-with-pppd': True,
'interfaces': {
'enp1s0.42': {
'rdnss': {
'2001:4860:4860::8888',
'2001:4860:4860::8844',
},
},
},
},
2020-11-13 20:41:24 +00:00
'pppd': {
'username': vault.decrypt('encrypt$gAAAAABfruZ5AZbgJ3mfMLWqIMx8o4bBRMJsDPD1jElh-vWN_gnhiuZVjrQ1-7Y6zDXNkxXiyhx8rxc2enmvo26axd7EBI8FqknCptXAPruVtDZrBCis4TE='),
'password': vault.decrypt('encrypt$gAAAAABfruaXEDkaFksFMU8g97ydWyJF8p2KcSDJJBlzaOLDsLL6oCDYjG1kMPVESOzqjn8ThtSht1uZDuMCstA-sATmLS-EWQ=='),
'interface': 'enp1s0.100',
},
'dhcpd': {
'subnets': {
'home': {
'subnet': '172.19.138.0',
'netmask': '255.255.255.0',
'range_lower': '172.19.138.100',
'range_higher': '172.19.138.250',
'interface': 'enp1s0.42',
'options': {
'routers': '172.19.138.1',
'domain-name-servers': '8.8.8.8, 8.8.4.4',
'domain-name': 'franzi-home.kunbox.net',
'broadcast-address': '172.19.138.255',
'subnet-mask': '255.255.255.0',
},
'default-lease-time': 300,
'max-lease-time': 1800,
},
},
},
2020-11-13 17:47:40 +00:00
'vm': {
'cpu': 2,
'ram': 2,
},
'wide-dhcp6c': {
'integrate-with-pppd': True,
'source': 'ppp0',
'targets': {
'enp1s0.42': '1',
},
},
2020-11-13 17:47:40 +00:00
},
'os': 'debian',
'os_version': (10,),
}