ipv6-tunnel: migrate to systemd-networkd
This commit is contained in:
parent
96c9a2d2f9
commit
d52e9e6fe7
|
@ -12,5 +12,5 @@ port-forwarding:
|
|||
|
||||
ipv6-tunnel:
|
||||
endpoint: 216.66.80.30
|
||||
address: 2001:470:1f0a:12b2::2
|
||||
address: 2001:470:1f0a:12b2::2/64
|
||||
gateway: 2001:470:1f0a:12b2::1
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
auto ipv6
|
||||
iface ipv6 inet6 v4tunnel
|
||||
address {{ address }}
|
||||
netmask 64
|
||||
endpoint {{ endpoint }}
|
||||
ttl 255
|
||||
gateway {{ gateway }}
|
|
@ -1,18 +1,36 @@
|
|||
ifupdown:
|
||||
pkg.installed: []
|
||||
|
||||
/etc/network/interfaces.d/ipv6-tunnel.conf:
|
||||
file.managed:
|
||||
- source: salt://upstream/ipv6-tunnel.conf
|
||||
- template: 'jinja'
|
||||
- context:
|
||||
endpoint: {{ pillar['ipv6-tunnel'].get('endpoint') }}
|
||||
address: {{ pillar['ipv6-tunnel'].get('address') }}
|
||||
gateway: {{ pillar['ipv6-tunnel'].get('gateway') }}
|
||||
- require:
|
||||
- pkg: ifupdown
|
||||
/etc/systemd/network/ipv6.netdev:
|
||||
file.append:
|
||||
- text: |
|
||||
[NetDev]
|
||||
Name=ipv6
|
||||
Kind=sit
|
||||
[Tunnel]
|
||||
Remote={{ pillar['ipv6-tunnel']['endpoint'] }}
|
||||
|
||||
'ifdown ipv6; ifup ipv6':
|
||||
cmd.run:
|
||||
- onchanges:
|
||||
- file: /etc/network/interfaces.d/ipv6-tunnel.conf
|
||||
/etc/systemd/network/ipv6.network:
|
||||
file.append:
|
||||
- text: |
|
||||
[Match]
|
||||
Name=ipv6
|
||||
[Network]
|
||||
Address={{ pillar['ipv6-tunnel']['address'] }}
|
||||
Gateway={{ pillar['ipv6-tunnel']['gateway'] }}
|
||||
|
||||
/etc/systemd/network/ipv6-up.network:
|
||||
file.append:
|
||||
- text: |
|
||||
[Match]
|
||||
Name={{ pillar['upstream']['interface'] }}
|
||||
[Network]
|
||||
Tunnel=ipv6
|
||||
|
||||
systemd-networkd:
|
||||
service:
|
||||
- running
|
||||
- watch:
|
||||
- file: /etc/systemd/network/ipv6.netdev
|
||||
- file: /etc/systemd/network/ipv6.network
|
||||
- file: /etc/systemd/network/ipv6-up.network
|
||||
|
|
Loading…
Reference in New Issue