networkd: add IPv6ProxyNDP (#5913)

This allows enabling proxy_ndp even if no addresses are configured in
networkd, as well as disabling proxy_ndp from a drop-in.
This commit is contained in:
Hristo Venev 2017-05-09 19:04:55 +01:00 committed by Lennart Poettering
parent c83ecc04d9
commit 465dfe59fc
5 changed files with 24 additions and 13 deletions

View File

@ -612,22 +612,27 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>IPv6ProxyNDPAddress=</varname></term>
<listitem><para>An IPv6 address, for which Neighbour Advertisement
messages will be proxied.
Proxy NDP (Neighbor Discovery Protocol) is a technique for IPv6 to
allow routing of addresses to a different destination when peers expect them
to be present on a certain physical link.
<term><varname>IPv6ProxyNDP=</varname></term>
<listitem><para>A boolean. Configures proxy NDP for IPv6. Proxy NDP (Neighbor Discovery
Protocol) is a technique for IPv6 to allow routing of addresses to a different
destination when peers expect them to be present on a certain physical link.
In this case a router answers Neighbour Advertisement messages intended for
another machine by offering its own MAC address as destination.
Unlike proxy ARP for IPv4, is not enabled globally, but will only send Neighbour
Unlike proxy ARP for IPv4, it is not enabled globally, but will only send Neighbour
Advertisement messages for addresses in the IPv6 neighbor proxy table,
which can also be shown by <command>ip -6 neighbour show proxy</command>
This option may be specified more than once. systemd-networkd will control the
per-interface `proxy_ndp` switch for each configured interface, depending on whether
there are <option>IPv6ProxyNDPAddress=</option> entries configured and add these to
the kernels IPv6 neighbor proxy table.
Defaults to unset.
which can also be shown by <command>ip -6 neighbour show proxy</command>.
systemd-networkd will control the per-interface `proxy_ndp` switch for each configured
interface depending on this option.
Defautls to unset.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>IPv6ProxyNDPAddress=</varname></term>
<listitem><para>An IPv6 address, for which Neighbour Advertisement messages will be
proxied. This option may be specified more than once. systemd-networkd will add the
<option>IPv6ProxyNDPAddress=</option> entries to the kernel's IPv6 neighbor proxy table.
This option implies <option>IPv6ProxyNDP=true</option> but has no effect if
<option>IPv6ProxyNDP</option> has been set to false. Defaults to unset.
</para></listitem>
</varlistentry>
<varlistentry>

View File

@ -38,6 +38,9 @@ static bool ipv6_proxy_ndp_is_needed(Link *link) {
if (!link->network)
return false;
if (link->network->ipv6_proxy_ndp != -1)
return link->network->ipv6_proxy_ndp;
if (link->network->n_ipv6_proxy_ndp_addresses == 0)
return false;

View File

@ -63,6 +63,7 @@ Network.IPv6AcceptRA, config_parse_tristate,
Network.IPv6AcceptRouterAdvertisements, config_parse_tristate, 0, offsetof(Network, ipv6_accept_ra)
Network.IPv6DuplicateAddressDetection, config_parse_int, 0, offsetof(Network, ipv6_dad_transmits)
Network.IPv6HopLimit, config_parse_int, 0, offsetof(Network, ipv6_hop_limit)
Network.IPv6ProxyNDP, config_parse_tristate, 0, offsetof(Network, ipv6_proxy_ndp)
Network.ActiveSlave, config_parse_bool, 0, offsetof(Network, active_slave)
Network.PrimarySlave, config_parse_bool, 0, offsetof(Network, primary_slave)
Network.IPv4ProxyARP, config_parse_tristate, 0, offsetof(Network, proxy_arp)

View File

@ -184,6 +184,7 @@ static int network_load_one(Manager *manager, const char *filename) {
network->ipv6_accept_ra = -1;
network->ipv6_dad_transmits = -1;
network->ipv6_hop_limit = -1;
network->ipv6_proxy_ndp = -1;
network->duid.type = _DUID_TYPE_INVALID;
network->proxy_arp = -1;
network->arp = -1;

View File

@ -178,6 +178,7 @@ struct Network {
int ipv6_accept_ra;
int ipv6_dad_transmits;
int ipv6_hop_limit;
int ipv6_proxy_ndp;
int proxy_arp;
bool ipv6_accept_ra_use_dns;