summaryrefslogtreecommitdiff
path: root/ipmasq/rules/F50ipsec.def
blob: cad4d78560ada2cc5b1ab91cd39bdc2395015096 (plain)
  1. # You should not edit this file. Instead, create a file with the same
  2. # name as this one, but with a .rul extension instead of .def. The
  3. # .rul file will override this one.
  4. #
  5. # However, any changes you make to this file will be preserved.
  6. #: Forward packets among internal and IPsec networks
  7. if [ -n "$IPSEC" ]; then
  8. for j in $IPSEC; do
  9. jj=$(echo $j | sed -e 's/\:/_/g')
  10. eval "CIDROFIPSEC=\$CIDROFIPSEC_$jj"
  11. for DESTCIDR in $CIDROFIPSEC; do
  12. for i in $INTERNAL; do
  13. if [ "$i" != "$j" ]; then
  14. ipnm_cache $i
  15. case $MASQMETHOD in
  16. ipfwadm)
  17. if [ -n "$PEEROFIF" ]; then
  18. $IPFWADM -F -a accept -S $PEEROFIF/$NMOFIF -D $DESTCIDR
  19. fi
  20. $IPFWADM -F -a accept -S $IPOFIF/$NMOFIF -D $DESTCIDR
  21. ;;
  22. ipchains)
  23. if [ -n "$PEEROFIF" ]; then
  24. $IPCHAINS --no-warnings -A forward -j ACCEPT -s $PEEROFIF/$NMOFIF -d $DESTCIDR
  25. fi
  26. $IPCHAINS --no-warnings -A forward -j ACCEPT -s $IPOFIF/$NMOFIF -d $DESTCIDR
  27. ;;
  28. netfilter)
  29. if [ -n "$PEEROFIF" ]; then
  30. $IPTABLES -A FORWARD -j ACCEPT -s $PEEROFIF/$NMOFIF -d $DESTCIDR
  31. fi
  32. $IPTABLES -A FORWARD -j ACCEPT -s $IPOFIF/$NMOFIF -d $DESTCIDR
  33. ;;
  34. esac
  35. fi
  36. done
  37. done
  38. done
  39. fi