This commit is contained in:
Astro 2016-11-09 01:18:00 +01:00
parent 718eba8ab9
commit f7490a06fa
5 changed files with 21 additions and 4 deletions

View File

@ -8,6 +8,13 @@ kvm -hda salt.hda -m 1024 -smp 2 -net nic,model=e1000 -net user -cdrom
Now run the Debian installation. Hostname: `server1`
```shell
brctl addbr br-up1
ifdown eth0
brctl addif br-up1 eth0
dhclient br-up1
```
# Bootstrap
Configure a recent version, eg. *stretch*

View File

@ -5,3 +5,5 @@ base:
- vlans
'*gw':
- dhcp
'upstream1':
- upstream.upstream1

View File

@ -13,7 +13,8 @@ lxc.network.flags=up
{%- if conf['type'] == 'veth' %}
lxc.network.veth.pair={{ id }}-{{ net }}
{%- endif %}
{%- set inet_addr = pillar['hosts-inet'][net].get(id) %}
{%- set hosts = pillar['hosts-inet'].get(net) %}
{%- set inet_addr = hosts and hosts.get(id) %}
{%- if inet_addr %}
{%- set prefix_len = pillar['subnets-inet'][net].split('/')[1] %}
lxc.network.ipv4={{ inet_addr }}/{{ prefix_len }}
@ -24,8 +25,9 @@ lxc.network.link=br-{{ net }}
lxc.network.link=bond0.{{ pillar['vlans'].get(net) }}
{%- endif %}
lxc.network.name={{ net }}
{%- if net == 'core' %}
lxc.network.ipv4.gateway=172.20.72.1
{%- set gw = conf.get('gw') %}
{%- if gw %}
lxc.network.ipv4.gateway={{ pillar['hosts-inet'][net][gw] }}
{%- endif %}
#lxc.network.ipv6=
#lxc.network.ipv6.gateway=fe80::1

View File

@ -2,6 +2,7 @@ pub-gw:
interfaces:
core:
type: veth
gw: anon1
pub:
type: phys
@ -9,6 +10,7 @@ serv-gw:
interfaces:
core:
type: veth
gw: upstream1
serv:
type: veth
@ -16,16 +18,20 @@ priv1-gw:
interfaces:
core:
type: veth
gw: upstream1
priv2-gw:
interfaces:
core:
type: veth
gw: upstream1
upstream1:
interfaces:
core:
type: veth
up1:
type: veth
anon1:
interfaces:

View File

@ -13,9 +13,9 @@ base:
- no-ssh
- forwarding
- ospf
- upstream.dhcp
- unbound
'anon*':
- no-ssh
- forwarding
- ospf
- unbound