$IPTABLES -I INPUT -i $LAN_IFACE -p udp --dport 67:68 --sport \
67:68 -j ACCEPT
Do note that we allow all traffic to and from UDP port 67 and 68 now, however, this should not be such a huge problem since it only allows requests from hosts doing the connection from port 67 or 68 as well. This rule could, of course, be even more restrictive, but it should be enough to actually accept all DHCP requests and updates without opening up too large of holes. If you are concerned, this rule could of course be made even more restrictive.
mIRC DCC problems
mIRC uses a special setting which allows it to connect through a firewall and to make DCC connections work properly without the firewall knowing about it. If this option is used together with iptables and specifically the ip_conntrack_irc and ip_nat_irc modules, it will simply not work. The problem is that mIRC will automatically NAT the inside of the packets for you, and when the packet reaches the firewall, the firewall will simply not know how and what to do with it. mIRC does not expect the firewall to be smart enough to take care of this by itself by simply querying the IRC server for its IP address and sending DCC requests with that address instead.
Turning on the "I am behind a firewall" configuration option and using the ip_conntrack_irc and ip_nat_irc modules will result in Netfilter creating log entries with the following content "Forged DCC send packet".
The simplest possible solution is to just uncheck that configuration option in mIRC and let iptables do the work. This means, that you should tell mIRC specifically that it is not behind a firewall.
Appendix C. ICMP types
This is a complete listing of all ICMP types. Note the reference pointing to the RFC or person who introduced the type and code. For a complete and absolute up to date listing of all ICMP types and codes, look at the icmp-parameters document at Internet Assigned Numbers Authority.
Note Iptables and netfilter uses ICMP type 255 internally since it is not reserved for any real usage, and most likely will never have any real usage. If you set a rule to match iptables -A INPUT -p icmp --icmp-type 255 -j DROP, this will DROP all ICMP packets. It is in other words used to match all ICMP types.
Table C-1. ICMP types
Appendix D. TCP options
This appendix is a simple and brief list of all the TCP options that are officially recognized. These references and numbers were all retreived from the Internet Assigned Numbers Authority website. The master file can be found at this location. The full contact details of the people referenced in this document has been removed, so to create less workload for them hopefully.
Table D-1. TCP Options
Appendix E. Other resources and links
Here is a list of links to resources and where I have gotten information from, etc :
• ip-sysctl.txt - from the 2.4.14 kernel. A little bit short but a good reference for the IP networking controls and what they do to the kernel.
• InGate - InGate is a commercial firewall producer that uses Linux as the base for their firewall products. Their productrange goes from basic firewalls to SIP gateways and QoS machines.
• RFC 768 - User Datagram Protocol - This is the official RFC describing how the UDP protocol should be used, in detail, and all of it's headers.
• RFC 791 - Internet Protocol - The IP specification as still used on the Internet, with additions and updates. The basic is still the same for IPv4.
• RFC 792 - Internet Control Message Protocol - The definitive resource for all information about ICMP packets. Whatever technical information you need about the ICMP protocol, this is where you should turn first. Written by J. Postel.
• RFC 793 - Transmission Control Protocol - This is the original resource on how TCP should behave on all hosts. This document has been the standard on how TCP should work since 1981 and forward. Extremely technical, but a must read for anyone who wants to learn TCP in every detail. This was originally a Department of Defense standard written by J. Postel.
• RFC 1122 - Requirements for Internet Hosts - Communication Layers - This RFC defines the requirements of the software running on a Internet host, specifically the communication layers.
• RFC 1349 - Type of Service in the Internet Protocol Suite - RFC describing some changes and clarifications of the TOS field in the IP header.
• RFC 1812 - Requirements for IP Version 4 Routers - This RFC specifies how routers on the Internet should behave and how they are expected to handle different situations. Very interesting reading.
• RFC 2401 - Security Architecture for the Internet Protocol - This is an RFC talking about the IPSEC implementation and standardisation. Well worth reading if you are working with IPSEC.
• RFC 2474 - Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers - In this document you will find out how the DiffServ works, and you will find much needed information about the TCP/IP protocol additions/changes needed for the DiffServ protocol to work.
• RFC 2638 - A Two-bit Differentiated Services Architecture for the Internet - This RFC describes a method of implementing two different differentiated service architecture into one. Both where described originally by D. Clark and van Jacobsen at the Munich IETH meeting 1997.
• RFC 2960 - Stream Control Transmission Protocol - This is a relatively new protocol developed by several large telecoms companies to complement UDP and TCP as a layer 3 protocol with higher reliability and resilience.