net/ipv4/ip_gre: Ethernet multipoint GRE over IP
Subsystems (3)
PATCH v5 1/1 net/ipv4/ip_gre: Ethernet multipoint GRE over IP
From: Stefan Gula <[email protected]>
This patch is an extension for current Ethernet over GRE implementation, which allows user to create virtual bridge (multipoint VPN) and forward traffic based on Ethernet MAC address information in it. It simulates the Bridge behavior learning mechanism, but instead of learning port ID from which given MAC address comes, it learns IP address of peer which encapsulated given packet. Multicast, Broadcast and unknown-multicast traffic is send over network as multicast encapsulated GRE packet, so one Ethernet multipoint GRE tunnel can be represented as one single virtual switch on logical level and be also represented as one multicast IPv4 address on network level.
---
V5 changes: created ipgre_tap_bridge_rcv function to make code somehow more readable
include/net/ipip.h +8 -0
@@ -27,6 +27,14 @@ struct ip_tunnel {__u32 o_seqno;/* The last output seqno */ int hlen;/* Precalculated GRE header length */ int mlink; +#ifdef CONFIG_NET_IPGRE_BRIDGE +#define GRETAP_BR_HASH_BITS 8 +#define GRETAP_BR_HASH_SIZE (1 << GRETAP_BR_HASH_BITS) +struct hlist_head hash[GRETAP_BR_HASH_SIZE ]; +spinlock_t hash_lock; +unsigned long ageing_time; +struct timer_list gc_timer; +#endif struct ip_tunnel_parm parms;
net/ipv4/Kconfig +9 -0
@@ -211,6 +211,15 @@ config NET_IPGRE_BROADCAST Network), but can be distributed all over the Internet. If you want to do that, say Y here and to "IP multicast routing" below. +config NET_IPGRE_BRIDGE + bool "IP: Ethernet over multipoint GRE over IP" + depends on IP_MULTICAST && NET_IPGRE && NET_IPGRE_BROADCAST + help + Allows you to use multipoint GRE VPN as virtual switch and interconnect + several L2 endpoints over L3 routed infrastructure. It is useful for + creating multipoint L2 VPNs which can be later used inside bridge + interfaces If you want to use. GRE multipoint L2 VPN feature say Y. + config IP_MROUTE bool "IP: multicast routing" depends on IP_MULTICAST
net/ipv4/ip_gre.c +243 -2
311 lines not on this page · raw message