openwrt/package/network/config
Roger Pueyo Centelles c6d3a62919 gre: add different per-protocol prefixes to GRE-TAP IPv4/6 tunnel interfaces.
This commit modifies the /lib/netifd/proto/gre.sh script so that, when
GRE-TAP tunnels are created, either IPv4 or IPv6, the prefix before the chosen
interface name contains the "tap" substring, to differentiate them from non-TAP
GRE tunnels.

Right now, both GRE and GRE-TAP tunnel (either IPv4 or IPv6) interfaces defined
in /etc/config/network are named equally ("gre-"+$ifname or "grev6"+$ifname)
upon creation. For instance, the following tunnels:

        config interface 'tuna'
                option peeraddr '172.30.22.1'
                option proto 'gre'

        config interface 'tunb'
                option peeraddr '192.168.233.4'
                option proto 'gretap'

        config interface 'tunc'
                option peer6addr 'fdc5:7c9e:e93d:45af::1'
                option proto 'grev6'

        config interface 'tund'
                option peer6addr 'fdc0:6071:1348:31ff::2'
                option proto 'grev6tap'

are named, respectively, "gre-tuna", "gre-tunb", "grev6-tunc" and "grev6-tund".

The current change makes that each GRE tunnel interface of the four different
types available (gre, gretap, grev6 and grev6tap) gets a different prefix.
Therefore, the abovementioned tunnels will be named, respectively:
"gre4-tuna", "gre4t-tunb", "gre6-tunc" and "gre6t-tund".

This is coherent with other types of virtual interfaces (i.e. PPP, PPPoE, PPPoA)
where the whole protocol name is used. For instance, a PPPoA interface named
"p1" and a PPPoE interface named "p2" will respectively appear as "pppoa-p1"
and "pppoe-p2", not as "ppp-p1" and "ppp-p2").

Since Linux interfaces names are limited to 15 characters, these prefixes leave,
for the worst case (TAP tunnels), 9 characters for the actual name.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
2017-01-03 14:36:37 +01:00
..
firewall treewide: clean up and unify PKG_VERSION for git based downloads 2016-12-22 16:42:21 +01:00
gre gre: add different per-protocol prefixes to GRE-TAP IPv4/6 tunnel interfaces. 2017-01-03 14:36:37 +01:00
ipip ipip: Support fqdn as remote tunnel endpoint 2016-10-26 17:53:53 +02:00
ltq-adsl-app treewide: clean up download hashes 2016-12-16 22:39:22 +01:00
ltq-vdsl-app treewide: clean up download hashes 2016-12-16 22:39:22 +01:00
netifd netifd: Upstep to git HEAD version 2016-12-25 21:01:02 +01:00
qos-scripts treewide: replace nbd@openwrt.org with nbd@nbd.name 2016-06-07 08:58:42 +02:00
soloscli treewide: clean up download hashes 2016-12-16 22:39:22 +01:00
swconfig swconfig: replace the shared library with a static one 2016-12-14 12:13:13 +01:00
vti vti: add empty install rules for vtiv4 & vtiv6 2016-12-22 16:33:28 +01:00