gluon-next-node: mark local-node ip6 as deprecated

Prevent the local-node ip6 from being eligible for source address
selection. This is highly undesireable in a layer 3 mesh.
This commit is contained in:
Nils Schneider 2016-04-08 12:00:08 +02:00
parent 794738b268
commit f3d02f3d80
4 changed files with 69 additions and 8 deletions

View File

@ -54,6 +54,7 @@ Packages
package/gluon-config-mode-geo-location package/gluon-config-mode-geo-location
package/gluon-ebtables-filter-multicast package/gluon-ebtables-filter-multicast
package/gluon-ebtables-filter-ra-dhcp package/gluon-ebtables-filter-ra-dhcp
package/gluon-next-node
Releases Releases
-------- --------

View File

@ -0,0 +1,21 @@
gluon-next-node
===============
This package provides a virtual interface (tied to *br-client*) called *local-node*
using the same MAC, IP4 and IP6 across all nodes in a mesh. Thus, the node that
the client is currently connected to, can always be reached under a known address.
The IP6 is marked es deprecated to prevent it from being used as a source
address for packages originating from a node.
site.conf
---------
next_node.mac
MAC to be set on the interface.
next_node.ip4
IP4 to be set on the interface.
next_node.ip6
IP6 to be set on the interface.

View File

@ -19,13 +19,22 @@ c:section('network', 'device', 'local_node_dev',
local prefix4 = ip.IPv4(site.prefix4) local prefix4 = ip.IPv4(site.prefix4)
c:delete('network', 'local_node') c:delete('network', 'local_node')
c:section('network', 'interface', 'local_node', c:delete('network', 'local_node4')
c:delete('network', 'local_node6')
c:section('network', 'interface', 'local_node4',
{ {
ifname = 'local-node', ifname = 'local-node',
proto = 'static', proto = 'static',
ipaddr = site.next_node.ip4, ipaddr = site.next_node.ip4 .. '/32',
netmask = prefix4:mask():string(), }
ip6addr = site.next_node.ip6 .. '/128', )
c:section('network', 'interface', 'local_node6',
{
ifname = 'local-node',
proto = 'static_deprecated',
ip6addr = site.next_node.ip6,
} }
) )

View File

@ -0,0 +1,30 @@
#!/bin/sh
. /lib/functions.sh
. ../netifd-proto.sh
init_proto "$@"
proto_static_deprecated_init_config() {
renew_handler=1
proto_config_add_string 'ip6addr:ip6addr'
}
proto_static_deprecated_setup() {
local config="$1"
local iface="$2"
local ip6addr
json_get_vars ip6addr
proto_init_update "*" 1
proto_add_ipv6_address "$ip6addr" "" "0"
proto_send_update "$config"
}
proto_static_deprecated_teardown() {
local config="$1"
}
add_protocol static_deprecated