PKG_NAME:=firewall
PKG_VERSION:=2
PKG_NAME:=firewall
PKG_VERSION:=2
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/package.mk
local vers=
case "$addr" in
local vers=
case "$addr" in
- *.*) vers=4 ;;
- *:*) vers=6 ;;
+ *.*) vers=4; mask="${mask:-32}" ;;
+ *:*) vers=6; mask="${mask:-128}" ;;
esac
export ${NO_EXPORT:+-n} -- "${varn}=${addr}"
esac
export ${NO_EXPORT:+-n} -- "${varn}=${addr}"
for redirect_proto in $redirect_proto; do
fw add $mode n zone_${redirect_src}_prerouting DNAT $ { $redirect_src_ip $redirect_dest_ip } { \
${redirect_proto:+-p $redirect_proto} \
for redirect_proto in $redirect_proto; do
fw add $mode n zone_${redirect_src}_prerouting DNAT $ { $redirect_src_ip $redirect_dest_ip } { \
${redirect_proto:+-p $redirect_proto} \
- ${redirect_src_ip:+-s $redirect_src_ip} \
- ${redirect_src_dip:+-d $redirect_src_dip} \
+ ${redirect_src_ip:+-s $redirect_src_ip/$redirect_src_ip_prefixlen} \
+ ${redirect_src_dip:+-d $redirect_src_dip/$redirect_src_dip_prefixlen} \
${redirect_src_port:+--sport $redirect_src_port} \
${redirect_src_dport:+--dport $redirect_src_dport} \
${redirect_src_mac:+-m mac --mac-source $redirect_src_mac} \
${redirect_src_port:+--sport $redirect_src_port} \
${redirect_src_dport:+--dport $redirect_src_dport} \
${redirect_src_mac:+-m mac --mac-source $redirect_src_mac} \
fw add $mode f zone_${redirect_src}_forward ACCEPT ^ { $redirect_src_ip $redirect_dest_ip } { \
-d $redirect_dest_ip \
${redirect_proto:+-p $redirect_proto} \
fw add $mode f zone_${redirect_src}_forward ACCEPT ^ { $redirect_src_ip $redirect_dest_ip } { \
-d $redirect_dest_ip \
${redirect_proto:+-p $redirect_proto} \
- ${redirect_src_ip:+-s $redirect_src_ip} \
+ ${redirect_src_ip:+-s $redirect_src_ip/$redirect_src_ip_prefixlen} \
${redirect_src_port:+--sport $redirect_src_port} \
${fwd_dest_port:+--dport $fwd_dest_port} \
${redirect_src_mac:+-m mac --mac-source $redirect_src_mac} \
${redirect_src_port:+--sport $redirect_src_port} \
${fwd_dest_port:+--dport $fwd_dest_port} \
${redirect_src_mac:+-m mac --mac-source $redirect_src_mac} \
for rule_proto in $rule_proto; do
fw add $mode f $chain $target $rule_pos { $rule_src_ip $rule_dest_ip } { \
${rule_proto:+-p $rule_proto} \
for rule_proto in $rule_proto; do
fw add $mode f $chain $target $rule_pos { $rule_src_ip $rule_dest_ip } { \
${rule_proto:+-p $rule_proto} \
- ${rule_src_ip:+-s $rule_src_ip} \
+ ${rule_src_ip:+-s $rule_src_ip/$rule_src_ip_prefixlen} \
${rule_src_port:+--sport $rule_src_port} \
${rule_src_mac:+-m mac --mac-source $rule_src_mac} \
${rule_src_port:+--sport $rule_src_port} \
${rule_src_mac:+-m mac --mac-source $rule_src_mac} \
- ${rule_dest_ip:+-d $rule_dest_ip} \
+ ${rule_dest_ip:+-d $rule_dest_ip/$rule_dest_ip_prefixlen} \
${rule_dest_port:+--dport $rule_dest_port} \
${rule_icmp_type:+--icmp-type $rule_icmp_type} \
}
${rule_dest_port:+--dport $rule_dest_port} \
${rule_icmp_type:+--icmp-type $rule_icmp_type} \
}