summaryrefslogtreecommitdiff
path: root/ipmasq/rules/A10dhcpd.rul
blob: 7be8c1e60852326e3c62f245f69f8d0619385d34 (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 -I input -j ACCEPT -s 0.0.0.0/32 68 -d 255.255.255.255/32 67 -i $i -p udp
  20. $IPCHAINS -I output -j ACCEPT -s $IPOFIF/32 67 -d 255.255.255.255/32 68 -i $i -p udp
  21. ;;
  22. netfilter)
  23. $IPTABLES -I INPUT -j ACCEPT -s 0.0.0.0/32 68 -d 255.255.255.255/32 67 -i $i -p udp
  24. $IPTABLES -I OUTPUT -j ACCEPT -s $IPOFIF/32 67 -d 255.255.255.255/32 68 -i $i -p udp
  25. esac
  26. done
  27. fi