summaryrefslogtreecommitdiff
path: root/ipmasq/rules/A10dhcpd.rul
blob: ff3cd29460ea4764a79436a08ad76aeaf4f76f21 (plain)
  1. # From Kalle Olavi Niemitalo <tosi@ees2.oulu.fi>:
  2. # Here's my /etc/ipmasq/rules/A10dhcpd.rul file in case you'd
  3. # like to add it in the examples directory. It's somewhat
  4. # stricter than /usr/doc/ipmasq/examples/Z99dhcpd.rul. Also, I'm
  5. # using priority A10 rather than Z99 because some of my other
  6. # rules would reject the packets.
  7. #
  8. # This works with dhcp_1.0.2-0.1 and the Windows 95 DHCP client.
  9. # The ipfwadm invocations are untested.
  10. if [ -n "$INTERNAL" ]; then
  11. for i in $INTERNAL; do
  12. ipnm_cache $i
  13. case $MASQMETHOD in
  14. ipfwadm)
  15. $IPFWADM -I -i accept -S 0.0.0.0/32 68 -D 255.255.255.255/32 67 -W ${i%%:*} -P udp
  16. $IPFWADM -O -i accept -S $IPOFIF/32 67 -D 255.255.255.255/32 68 -W ${i%%:*} -P udp
  17. ;;
  18. ipchains)
  19. $IPCHAINS -A input -j ACCEPT -s 0.0.0.0/32 68 -d 255.255.255.255/32 67 -i ${i%%:*} -p udp
  20. $IPCHAINS -A output -j ACCEPT -s $IPOFIF/32 67 -d 255.255.255.255/32 68 -i ${i%%:*} -p udp
  21. ;;
  22. netfilter)
  23. $IPTABLES -A INPUT -j ACCEPT -s 0.0.0.0/32 -d 255.255.255.255/32 -i ${i%%:*} -p udp --source-port 68 --destination-port 67
  24. $IPTABLES -A OUTPUT -j ACCEPT -s $IPOFIF/32 -d 255.255.255.255/32 -o ${i%%:*} -p udp --source-port 67 --destination-port 68
  25. ;;
  26. esac
  27. done
  28. fi