title iptables vol 1 user strick ip su60.eastnet.gatech.edu lock ******** /section /file outline.txt OUTLINE /subsection Examples * /file lokkit.txt * /file rc.nameif.txt * /file ifconfig.example.txt * /file TardisLan.txt * /file albus-rc.lan.txt * /file masq.txt /section References /section Linux HOWTOS (from ````http://www.netfilter.org/'''') * /link http://www.netfilter.org/documentation/HOWTO/packet-filtering-HOWTO.html Packet Filtering -- ( /link http://www.netfilter.org/documentation/HOWTO//packet-filtering-HOWTO.txt txt ) * /link http://www.netfilter.org/documentation/HOWTO/NAT-HOWTO.html NAT (Masquerade) -- ( /link http://www.netfilter.org/documentation/HOWTO//NAT-HOWTO.txt txt ) * /link http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO.html Extensions -- ( /link http://www.netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO.txt txt ) * /link http://www.netfilter.org/documentation/HOWTO//netfilter-hacking-HOWTO.html Hacking! -- ( /link http://www.netfilter.org/documentation/HOWTO//netfilter-hacking-HOWTO.txt txt ) /section man * /file iptables.txt iptables(8) /section RFCs * /link http://www.faqs.org/rfcs/rfc791.html rfc791: Internet Protocol -- /file ip_header.txt (IP header) /pre( 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| IHL |Type of Service| Total Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification |Flags| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Live | Protocol | Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Example Internet Datagram Header /pre) * /link http://www.faqs.org/rfcs/rfc792.html rfc792: ICMP (Control Messages) -- /file icmp_unreachable.txt (example ICMP body) /pre( Example: Destination Unreachable Message 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | unused | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Internet Header + 64 bits of Original Data Datagram | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Type 3 Code 0 = net unreachable; 1 = host unreachable; 2 = protocol unreachable; 3 = port unreachable; 4 = fragmentation needed and DF set; 5 = source route failed. /pre) * /link http://www.faqs.org/rfcs/rfc768.html rfc768: UDP -- /file udp_header.txt (UDP header) /pre( 0 7 8 15 16 23 24 31 +--------+--------+--------+--------+ | Source | Destination | | Port | Port | +--------+--------+--------+--------+ | | | | Length | Checksum | +--------+--------+--------+--------+ | | data octets ... +---------------- ... User Datagram Header Format /pre) * /link http://www.faqs.org/rfcs/rfc793.html rfc793: TCP -- /file tcp_header.txt (TCP header) /pre( 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Acknowledgment Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | |U|A|P|R|S|F| | | Offset| Reserved |R|C|S|S|Y|I| Window | | | |G|K|H|T|N|N| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Urgent Pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ TCP Header Format Note that one tick mark represents one bit position. /pre) * /link http://www.faqs.org/rfcs/rfc1918.html rfc1918: Private Internet Allocations /pre( The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private internets: 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) /pre) * /link http://www.faqs.org/rfcs/rfc1627.html rfc1627: Network 10 Considered Harmful