Commit 3e66b113 authored by nanahira's avatar nanahira

dns

parent b50bbc62
...@@ -7,6 +7,9 @@ FwMark = {{conn.localGatewayMark}} ...@@ -7,6 +7,9 @@ FwMark = {{conn.localGatewayMark}}
{% endif %} {% endif %}
MTU = {{conn.mtu|int - 80}} MTU = {{conn.mtu|int - 80}}
Table = off Table = off
{% if dns is defined and (inventory_hostname_short == "103" and conn.name == "mc-drjin" or inventory_hostname_short == "218" and conn.name != "mc-drjin") %}
DNS = {{dns}}
{% endif %}
PostUp = dev=%i localPeerAddress={{conn.localPeerAddress}} remotePeerAddress={{conn.remotePeerAddress}} remoteMark={{conn.remoteMark}} inbound={{conn.inbound}} outbound={{conn.outbound}} mtu={{conn.mtu|int - 80}} /etc/wireguard/postup.sh PostUp = dev=%i localPeerAddress={{conn.localPeerAddress}} remotePeerAddress={{conn.remotePeerAddress}} remoteMark={{conn.remoteMark}} inbound={{conn.inbound}} outbound={{conn.outbound}} mtu={{conn.mtu|int - 80}} /etc/wireguard/postup.sh
PreDown = dev=%i localPeerAddress={{conn.localPeerAddress}} remotePeerAddress={{conn.remotePeerAddress}} remoteMark={{conn.remoteMark}} inbound={{conn.inbound}} outbound={{conn.outbound}} mtu={{conn.mtu|int - 80}} /etc/wireguard/predown.sh PreDown = dev=%i localPeerAddress={{conn.localPeerAddress}} remotePeerAddress={{conn.remotePeerAddress}} remoteMark={{conn.remoteMark}} inbound={{conn.inbound}} outbound={{conn.outbound}} mtu={{conn.mtu|int - 80}} /etc/wireguard/predown.sh
......
...@@ -9,6 +9,9 @@ FwMark = {{conn.localGatewayMark}} ...@@ -9,6 +9,9 @@ FwMark = {{conn.localGatewayMark}}
{% endif %} {% endif %}
MTU = {{conn.mtu|int - 80}} MTU = {{conn.mtu|int - 80}}
Table = off Table = off
{% if dns is defined and (inventory_hostname_short == "103" and conn.name == "mc-drjin" or inventory_hostname_short == "218" and conn.name != "mc-drjin") %}
DNS = {{dns}}
{% endif %}
PostUp = dev=%i localPeerAddress={{conn.localPeerAddress}} remotePeerAddress={{conn.remotePeerAddress}} remoteMark={{conn.remoteMark}} inbound={{conn.inbound}} outbound={{conn.outbound}} mtu={{conn.mtu|int - 80}} /etc/wireguard/postup.sh PostUp = dev=%i localPeerAddress={{conn.localPeerAddress}} remotePeerAddress={{conn.remotePeerAddress}} remoteMark={{conn.remoteMark}} inbound={{conn.inbound}} outbound={{conn.outbound}} mtu={{conn.mtu|int - 80}} /etc/wireguard/postup.sh
PreDown = dev=%i localPeerAddress={{conn.localPeerAddress}} remotePeerAddress={{conn.remotePeerAddress}} remoteMark={{conn.remoteMark}} inbound={{conn.inbound}} outbound={{conn.outbound}} mtu={{conn.mtu|int - 80}} /etc/wireguard/predown.sh PreDown = dev=%i localPeerAddress={{conn.localPeerAddress}} remotePeerAddress={{conn.remotePeerAddress}} remoteMark={{conn.remoteMark}} inbound={{conn.inbound}} outbound={{conn.outbound}} mtu={{conn.mtu|int - 80}} /etc/wireguard/predown.sh
[Peer] [Peer]
......
...@@ -83,6 +83,7 @@ class InventoryBuilder { ...@@ -83,6 +83,7 @@ class InventoryBuilder {
const connections = []; const connections = [];
const null_connection = "10000,null"; const null_connection = "10000,null";
const lan_interfaces = host.lan_interfaces.length > 0 ? host.lan_interfaces.split(",") : []; const lan_interfaces = host.lan_interfaces.length > 0 ? host.lan_interfaces.split(",") : [];
const dns = host.dns.length > 0 ? host.dns : undefined;
for (const h of this.connections) { for (const h of this.connections) {
if (h != host.name) { if (h != host.name) {
const to = host[h]; const to = host[h];
...@@ -114,7 +115,8 @@ class InventoryBuilder { ...@@ -114,7 +115,8 @@ class InventoryBuilder {
//gateways: _.mapValues(this.gateways[host.name], gw => _.pick(gw, ['mark_gateway'])), //gateways: _.mapValues(this.gateways[host.name], gw => _.pick(gw, ['mark_gateway'])),
gateways: _.values(this.gateways[host.name]), gateways: _.values(this.gateways[host.name]),
connections, connections,
lan_interfaces lan_interfaces,
dns
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment