Ver código fonte

ipv4 default gateway configuration

netifs
pai
commit
aef5e034e8
1 arquivos alterados com 4 adições e 2 exclusões
  1. +4
    -2
      templates/network-interfaces.j2

+ 4
- 2
templates/network-interfaces.j2 Ver arquivo

@@ -139,7 +139,6 @@ iface {{ dev }} inet6 static
iface {{ dev }} inet6 static
address {{ ip.ip | ipv6('address') }}
netmask {{ ip.ip | ipv6('prefix') }}
#gateway
{% if netifs[netif].dns_resolvers is defined and netifs[netif].dns_resolvers | ipv6 %}
dns-nameservers {{ netifs[netif].dns_resolvers | ipv6 | join(" ") }}
{% endif %}
@@ -154,7 +153,10 @@ iface {{ dev }} inet static
network {{ ip.ip | ipv4('network') }}
netmask {{ ip.ip | ipv4('prefix') }}
broadcast {{ ip.ip | ipv4('broadcast') }}
#gateway
{% if loop.index == 1 and netifs[netif].routes is defined %}
{% set default_route = netifs[netif].routes | json_query("[?to=='default']") | first %}
gateway {{default_route.via}}
{% endif %}
{% if netifs[netif].dns_resolvers is defined and netifs[netif].dns_resolvers | ipv4 %}
dns-nameservers {{ netifs[netif].dns_resolvers | ipv4 | join(" ") }}
{% endif %}


Carregando…
Cancelar
Salvar