gluon-next-node: split gluon-next-node-batman-adv
Move ebtables rules dealing with bat0 to gluon-next-node-batman-adv. This new package should be used in batman-adv based setups instead of gluon-next-node.
This commit is contained in:
		
							parent
							
								
									f7c240496f
								
							
						
					
					
						commit
						33264bec97
					
				
							
								
								
									
										31
									
								
								package/gluon-next-node-batman-adv/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								package/gluon-next-node-batman-adv/Makefile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
			
		||||
include $(TOPDIR)/rules.mk
 | 
			
		||||
 | 
			
		||||
PKG_NAME:=gluon-next-node-batman-adv
 | 
			
		||||
PKG_VERSION:=1
 | 
			
		||||
 | 
			
		||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 | 
			
		||||
 | 
			
		||||
include $(GLUONDIR)/include/package.mk
 | 
			
		||||
 | 
			
		||||
define Package/gluon-next-node-batman-adv
 | 
			
		||||
  SECTION:=gluon
 | 
			
		||||
  CATEGORY:=Gluon
 | 
			
		||||
  TITLE:=Next-node anycast address ebtables filter for batman-adv
 | 
			
		||||
  DEPENDS:=+gluon-core +gluon-ebtables +gluon-next-node +gluon-mesh-batman-adv +kmod-macvlan
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
define Build/Prepare
 | 
			
		||||
	mkdir -p $(PKG_BUILD_DIR)
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
define Build/Configure
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
define Build/Compile
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
define Package/gluon-next-node-batman-adv/install
 | 
			
		||||
	$(CP) ./files/* $(1)/
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
$(eval $(call BuildPackage,gluon-next-node-batman-adv))
 | 
			
		||||
@ -0,0 +1,17 @@
 | 
			
		||||
local site = require 'gluon.site_config'
 | 
			
		||||
local next_node = site.next_node
 | 
			
		||||
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -d ' .. next_node.mac .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -d ' .. next_node.mac .. ' -j DROP')
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -s ' .. next_node.mac .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -s ' .. next_node.mac .. ' -j DROP')
 | 
			
		||||
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv4 --ip-destination ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv4 --ip-destination ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv4 --ip-source ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv4 --ip-source ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv6 --ip6-destination ' .. next_node.ip6 .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv6 --ip6-destination ' .. next_node.ip6 .. ' -j DROP')
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv6 --ip6-source ' .. next_node.ip6 .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv6 --ip6-source ' .. next_node.ip6 .. ' -j DROP')
 | 
			
		||||
@ -11,7 +11,7 @@ define Package/gluon-next-node
 | 
			
		||||
  SECTION:=gluon
 | 
			
		||||
  CATEGORY:=Gluon
 | 
			
		||||
  TITLE:=Next-node anycast address
 | 
			
		||||
  DEPENDS:=+gluon-core +gluon-ebtables +gluon-mesh-batman-adv +kmod-macvlan
 | 
			
		||||
  DEPENDS:=+gluon-core +gluon-ebtables +kmod-macvlan
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
define Package/gluon-next-node/description
 | 
			
		||||
 | 
			
		||||
@ -3,18 +3,3 @@ local next_node = site.next_node
 | 
			
		||||
 | 
			
		||||
rule('FORWARD --logical-in br-client -p ARP --arp-ip-src ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
rule('FORWARD --logical-in br-client -p ARP --arp-ip-dst ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -d ' .. next_node.mac .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -d ' .. next_node.mac .. ' -j DROP')
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -s ' .. next_node.mac .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -s ' .. next_node.mac .. ' -j DROP')
 | 
			
		||||
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv4 --ip-destination ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv4 --ip-destination ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv4 --ip-source ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv4 --ip-source ' .. next_node.ip4 .. ' -j DROP')
 | 
			
		||||
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv6 --ip6-destination ' .. next_node.ip6 .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv6 --ip6-destination ' .. next_node.ip6 .. ' -j DROP')
 | 
			
		||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv6 --ip6-source ' .. next_node.ip6 .. ' -j DROP')
 | 
			
		||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv6 --ip6-source ' .. next_node.ip6 .. ' -j DROP')
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user