Changeset 37866


Ignore:
Timestamp:
2013-09-01T19:59:48+02:00 (4 years ago)
Author:
cyrus
Message:

netfilter: Add IPv6-NAT support for kernel and ipt
Thanks to Berni, Adam Novak and Sedat Dilek for patches and inspiration

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/netfilter.mk

    r37821 r37866  
    157157 
    158158# kernel only 
    159 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NF_NAT, $(P_XT)nf_nat $(P_V4)nf_nat_ipv4 $(P_XT)xt_nat $(P_V4)iptable_nat, ge 3.7.0),)) 
    160159$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NF_NAT, $(P_V4)nf_nat $(P_V4)iptable_nat, lt 3.7.0),)) 
     160$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NF_NAT, $(P_XT)nf_nat $(P_XT)xt_nat, ge 3.7.0),)) 
     161$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT,CONFIG_NF_NAT_IPV4, $(P_V4)nf_nat_ipv4 $(P_V4)iptable_nat, ge 3.7.0),)) 
     162$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_NF_NAT_IPV6, $(P_V6)nf_nat_ipv6 $(P_V6)ip6table_nat, ge 3.7.0),)) 
     163$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_MASQUERADE, $(P_V6)ip6t_MASQUERADE, ge 3.7.0),)) 
     164$(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, $(P_V6)ip6t_NPT, ge 3.7.0),)) 
    161165 
    162166# userland only 
    163167$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT,CONFIG_NF_NAT, ipt_SNAT ipt_DNAT))) 
     168$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, ip6t_DNPT ip6t_SNPT))) 
    164169 
    165170$(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_MASQUERADE, $(P_V4)ipt_MASQUERADE)) 
    166171$(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_REDIRECT, $(P_XT)xt_REDIRECT, ge 3.7.0)) 
    167172$(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_REDIRECT, $(P_V4)ipt_REDIRECT, lt 3.7.0)) 
     173$(eval $(call nf_add,IPT_NAT6,CONFIG_IP_NF_TARGET_REDIRECT, $(P_V4)ip6t_REDIRECT, lt 3.8.0)) 
    168174 
    169175 
     
    172178$(eval $(call nf_add,IPT_NAT_EXTRA,CONFIG_IP_NF_TARGET_NETMAP, $(P_XT)xt_NETMAP, ge 3.7.0)) 
    173179$(eval $(call nf_add,IPT_NAT_EXTRA,CONFIG_IP_NF_TARGET_NETMAP, $(P_V4)ipt_NETMAP, lt 3.7.0)) 
     180$(eval $(call nf_add,IPT_NAT6,CONFIG_IP_NF_TARGET_NETMAP, $(P_V6)ip6t_NETMAP, lt 3.8.0)) 
    174181 
    175182 
     
    284291IPT_BUILTIN += $(IPT_IPV6-y) $(IPT_IPV6-m) 
    285292IPT_BUILTIN += $(IPT_NAT-y) 
     293IPT_BUILTIN += $(IPT_NAT6-y) 
    286294IPT_BUILTIN += $(IPT_NAT_EXTRA-y) 
    287295IPT_BUILTIN += $(IPT_NATHELPER-y) 
  • trunk/package/kernel/linux/modules/netfilter.mk

    r37520 r37866  
    166166 
    167167 
     168define KernelPackage/ipt-nat6 
     169  TITLE:=IPv6 NAT targets 
     170  KCONFIG:=$(KCONFIG_IPT_NAT6) 
     171  FILES:=$(foreach mod,$(IPT_NAT6-m),$(LINUX_DIR)/net/$(mod).ko) 
     172  AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT6-m))) 
     173  $(call AddDepends/ipt,+kmod-ipt-conntrack) 
     174  $(call AddDepends/ipt,+kmod-ipt-nat) 
     175  $(call AddDepends/ipt,+kmod-ip6tables) 
     176endef 
     177 
     178define KernelPackage/ipt-nat6/description 
     179 Netfilter (IPv6) kernel modules for NAT targets 
     180endef 
     181 
     182$(eval $(call KernelPackage,ipt-nat6)) 
     183 
     184 
    168185define KernelPackage/ipt-nat-extra 
    169186  TITLE:=Extra NAT targets 
     
    395412  KCONFIG:=$(KCONFIG_IPT_IPV6) 
    396413  FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).ko) 
    397   AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m))) 
     414  AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_IPV6-m))) 
    398415endef 
    399416 
  • trunk/package/network/utils/iptables/Makefile

    r37865 r37866  
    299299  TITLE:=IPv6 firewall administration tool 
    300300  MENU:=1 
     301endef 
     302 
     303 
     304define Package/ip6tables-mod-nat 
     305$(call Package/iptables/Default) 
     306  DEPENDS:=ip6tables +kmod-ipt-nat6 
     307  TITLE:=IPv6 NAT extensions 
     308endef 
     309 
     310define Package/ip6tables-mod-nat/description 
     311iptables extensions for IPv6-NAT targets. 
    301312endef 
    302313 
     
    448459$(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m))) 
    449460$(eval $(call BuildPackage,ip6tables)) 
     461$(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m))) 
    450462$(eval $(call BuildPackage,libiptc)) 
    451463$(eval $(call BuildPackage,libip4tc)) 
Note: See TracChangeset for help on using the changeset viewer.