B.2. p-o-m ¿É¼Ç ¼±ÅÃ

DSCP.patch NOT APPLIED ( 2 missing files)

Status: Pending for kernel inclusion.

0x0ºÎÅÍ 0x4f »çÀÌ °ªÀ¸·Î DSCP(Differentiated Services Code Point, ÀÌÀü¿¡´Â TOS, Type Of Sevice¶ó ºÒ·¶Áö¿ä) Çʵ带 ¼³Á¤ÇÒ ¼ö ÀÖ´Â CONFIG_IP_NF_TARGET_DSCP ¿É¼ÇÀ» º¸ÅÇ´Ï´Ù. ÁÁÀº ÀϵéÀÌ ÀÖ½À´Ï´Ù. TOS¿¡ ´ëÇؼ­´Â º»¹®À» Âü°íÇϼ¼¿ä.

ECN.patch

Status: Pending for kernel inclusion.

iptables mangle Å×ÀÌºí¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖ´Â ECN Ÿ±êÀ» Ãß°¡ÇÕ´Ï´Ù. ÀÎÅͳݿ¡¼­ ECN ºí·¢È¦À» ÇÇÇØ°¥ ¶§ ²Ï À¯¿ëÇÏÁö¸¸, ÀϹÝÀûÀ¸·Î ECN ºñÆ®¸¦ Á¶ÀÛÇؼ­ ¾µ¸ð ¾øÀÌ ¸¸µå´Â ÀÏÀº º°·Î ¹Ù¶óÁö ¾Ê½À´Ï´Ù.

REJECT_mark.patch

Status: working

TCP ¸®¼ÂÀ¸·Î °ÅÀýÇÒ ¶§¿¡ Áö³­ ÆÐŶÀÇ nfmark °ªÀ» »õ RST ÆÐŶ¿¡ º¹»çÇÏÁö ¸¶¼¼¿ä.

ip_route_output´Â nfmark ¶ó¿ìÆÃÀ» Á¦´ë·Î ÀÌÇØÇؼ­, ³ªÁß¿¡ ±× ÆÐŶÀ» ´Ù½Ã ¶ó¿ìÆÃÇÏÁö ¾Êµµ·Ï mangle OUTPUTÀ» ¸·±âÀ§ÇØ mark °ªÀ» ¹Ù²Ü ¸¸Å­ ¶È¶ÈÇÏÁö ¸øÇÕ´Ï´Ù.

ahesp-static.patch

Status: working

Make the init and fini functions of ipt_ah.c static.

conntrack+nat-helper-unregister.patch

Status: Submitted to the kernel at 2.4.18-pre3 time

ip_{conntrack,nat}_{irc,ftp}.o°¡ ¸ðµâ·Î ÄÄÆÄÀÏÇßÀ» ¶§ helper µî·Ï¿¡ ½ÇÆÐÇÏ´Â »ç¼ÒÇÑ ¹®Á¦µéÀ» ¹Ù·ÎÀâ´Â ÆÐÄ¡ÀÔ´Ï´Ù.

¾ÆÁÖ ¾ÆÁÖ µå¹°°Ô ¹ß»ýÇÕ´Ï´Ù (¾î¶² ÀÌ°¡ °°Àº Æ÷Æ® ¹øÈ£·Î ¼­·Î ´Ù¸¥ ÇÛÆÛ¿¡ µî·ÏÇÏ·Á ÇÒ ¶§)

conntrack.patch

Status: Works For Me.

ÀϹÝÀûÀÎ conntrack ¸ÅÄ¡ ¸ðµâ·Î, »óÅ ÆÐÄ¡ ¼öÆÛ¼Â(superset)ÀÔ´Ï´Ù. (Ä¿³Î 2.4.18-pre4³ª ±× ÀÌ»óÀÌ ÇÊ¿äÇÕ´Ï´Ù)

´ÙÁß ÀÎÅÍ³Ý ¸µÅ©³ª Åͳο¡¼­ NAT °ÔÀÌÆ®¿þÀÌó·³ º¹ÀâÇÑ È¯°æ¿¡¼­ ¸Å¿ì À¯¿ëÇÏ°Ô ¾²ÀÌ´Â Ãß°¡ÀûÀÎ conntrack Á¤º¸¸¦ ¸ÅĪÇÕ´Ï´Ù.

ÇöÀç ¾Æ·¡ ¿É¼ÇµéÀ» Áö¿øÇÕ´Ï´Ù:

표 B-1. conntrack options:

optiondesc
[!] --ctstate [INVALID|ESTABLISHED|NEW|RELATED|SNAT|DNAT][,...] State(s) to match
[!] --ctproto proto Protocol to match; by number or name, eg. `tcp'
--ctorigsrc [!] address[/mask] Original source specification
--ctorigdst [!] address[/mask] Original destination specification
--ctreplsrc [!] address[/mask] Reply source specification
--ctrepldst [!] address[/mask] Reply destination specification
[!] --ctstatus [NONE|EXPECTED|SEEN_REPLY|ASSURED][,...] Status(es) to match
[!] --ctexpire time[:time] Match remaining lifetime in seconds against value or range of values (inclusive)

"»õ·Î¿î" SNAT, DNAT »óÅ´ °¡»óÀÇ °ÍÀ¸·Î ÁøÂ¥ ¼Ò½º ÁÖ¼Ò°¡ ÀÀ´ä ¸ñÀûÁö¿Í ´Ù¸£°Å³ª ÁøÂ¥ ¸ñÀûÁö ÁÖ¼Ò°¡ ÀÀ´ä Ãâ¹ßÁö¿Í ´Ù¸¥ °æ¿ì ¸ÅĪÇÕ´Ï´Ù.

dscp.patch

Status: Pending for kernel inclusion.

IPv4 ÆÐŶ¿¡¼­ DSCP Çʵ带 °Ë»çÇÕ´Ï´Ù.

ecn.patch

Status: Pending for kernel inclusion.

IPv4¿¡¼­ TCP Çì´õÀÇ ECN ºñÆ®¸¦ °Ë»çÇÕ´Ï´Ù.

helper.patch

Status: Pending for inclusion after newnat

ipt_helper ¸ðµâÀº »õ·Î¿î ¸ÅĪ ±â¹ýÀ» Á¦°øÇÕ´Ï´Ù. µ¿ÀûÀ¸·Î ÇÒ´çµÈ ¿¬°áÀÌ¶óµµ Æ¯Á¤ conntrack ÇïÆÛ¿Í °ü·ÃÁö¾î ÆÐŶÀ» °Ë»çÇÒ ¼ö ÀÖ½À´Ï´Ù.

¿©·¯ºÐÀÌ ftp µ¥ÀÌÅÍ ¼¼¼Ç¿¡ ¼ÓÇÑ ¸ðµç ÆÐŶÀ» °Ë»çÇÏ·Á ÇÑ´Ù¸é: (¿À·ÎÁö µ¥ÀÌÅÍ ¿¬°á¸¸ ¿øÇÒ »Ó, ÄÁÆ®·Ñ ¿¬°áÀº ÇÊ¿ä ¾øÀ» ¶§)

iptables -A INPUT -m helper --helper ftp -j ACCEPT

irc-dcc-sessions ¿¡´Â irc¸¦ »ç¿ëÇϼ¼¿ä.

ipv6-agr.patch.ipv6

Status: It worked w/o problems

EUI64 (MAC ÁּҷκÎÅÍ ¹ÞÀº) ÁÖ¼Ò¿¡¼­ ¸¶Áö¸· 64 ºñÆ®¿Í IPv6 Ãâ¹ßÁö ÁÖ¼Ò¸¦ ºñ±³ °Ë»çÇÕ´Ï´Ù.

Example:

ip6tables -N ipv6ok
ip6tables -A INPUT -m eui64 -j ipv6ok
ip6tables -A INPUT -s ! 3FFE:2F00:A0::/64 -j ipv6ok
ip6tables -A INPUT -j LOG
ip6tables -A ipv6ok -j ACCEPT

length.patch.ipv6

Status: Should Work.

IPv6 µ¥ÀÌÅͱ׷¥ Àüü ±æÀ̸¦ °Ë»çÇÕ´Ï´Ù (IPv6 Çì´õ + È®Àå Çì´õµéÀ» Æ÷ÇÔ, ±×·± °ÍµéÀÌ ÀÖ´Ù¸é)

--length '!' ±âÈ£¸¦ »ç¿ëÇÒ ¼ö ÀÖÀ¸¸ç, 0ºÎÅÍ 65536 »çÀÌ °ªÀ» Çã¿ëÇÕ´Ï´Ù (16Áø¼ö·Î °ªÀ» ¼³Á¤ÇÒ ¼öµµ ÀÖ½À´Ï´Ù)

¹üÀ§¸¦ ÁöÁ¤ÇÒ ¶§¿¡ ù¹ø° °ªÀº ÃÖ¼Ò ±æÀÌ, µÎ¹ø° °ªÀº ÃÖ´ë ±æÀ̸¦ Á¦ÇÑÇÕ´Ï´Ù:

--length '!' ±âÈ£¸¦ »ç¿ëÇÒ ¼ö ÀÖÀ¸¸ç, ÃÖ¼Ò°ª:ÃÖ´ë°ª Çü½ÄÀ» »ç¿ëÇϼ¼¿ä. 0ºÎÅÍ 65536 »çÀÌ °ªÀ» Çã¿ëÇϸç, ÃÖ¼Ò°ªÀÌ ÃÖ´ë°ªº¸´Ù Å©¸é ¾ÈµË´Ï´Ù.

¿¹:

# ip6tables -A FORWARD -p udp -m length --length 85:0xffff -j DROP
# iptables -A FORWARD -p udp -m length --length ! :84 -j DROP

(µÎ ¿¹¹®Àº ¿ÏÀüÈ÷ ¶È°°Àº ÀÏÀ» ÇÕ´Ï´Ù)

¹üÀ§°ªÀ» »ç¿ëÀÚ°¡ ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é: ÃÖ¼Ò°ªÀ¸·Î´Â 0, ÃÖ´ë °ªÀ¸·Î´Â 0xffffÀ» ´ëüÇÕ´Ï´Ù.

nat-memoryleak-fix.patch

Status: Submitted for kernel inclusion at 2.4.19-pre10 time

¸ðµâÀ» ³»¸± ¶§ ÀÚ¿øÀ» ±ú²ýÀÌ µ¹·ÁÁÖÁö ¾Ê´Â °æ¿ì ¸Þ¸ð¸® ûũ°¡ ¾î´À Á¤µµ ¹ß»ýÇϴµ¥, ÀÌ ¿É¼ÇÀº iptable_nat load/unload¿¡¼­ ¸Þ¸ð¸® ´©¼ö Çö»óÀ» ¹Ù·ÎÀâ½À´Ï´Ù.

ownercmd.patch

Status: Works For Me.

--cmd-owner ¿É¼ÇÀ¸·Î ¿©·¯ºÐ ÀڽŸ¸ÀÇ ÇÁ·Î¼¼½º À̸§À» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.

ÀÌ ±â´ÉÀ» ÀÌ¿ëÇØ ssh µð¸Õ¿¡ ÀÇÇØ Æ÷¿öµåµÇ´Â ¿¬°áµéÀ» ÇÊÅÍÇÒ ¼ö ÀÖ½À´Ï´Ù: You can use this feature to filter connections forwarded by

iptables -N CheckSSHSyns
# allow forwarded connections to rsync port on 192.168.1.1
iptables -A CheckSSHSyns -p tcp -d 192.168.1.1 --dport 873 -j RETURN
# refuse everything else
iptables -A CheckSSHSyns -j REJECT --reject-with tcp-reset
iptables -I OUTPUT -p tcp --syn -m owner --cmd-owner sshd -j CheckSSHSyns

pkttype.patch

Status: It works

BROADCAST, MULTICAST µî "class"¿¡ µû¶ó ÆÐŶÀ» °Ë»çÇÕ´Ï´Ù.

iptables -A INPUT -m pkttype --pkt-type broadcast -j LOG

z-newnat16.patch

Status: Submitted for 2.4.20-pre1

Ä¿³Î 2.4.19-pre4³ª ±× À̻󿡼­ Áö¿øÇÏ´Â new nat API¸¦ Á¦°øÇÕ´Ï´Ù.

- H.323, IRC, PPTP µîÀ» Á¦´ë·Î ÃßÀûÇÒ ¼ö ÀÖ½À´Ï´Ù.

- timeout¸¦ ¿¹Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.

- NAT Äڵ忡 ¿ÏÀüÇÑ SACK ±â´ÉÀ» Ãß°¡ÇÕ´Ï´Ù

IPV4OPTSSTRIP.patch

The base/IPV4OPTSSTRIP patch: Status: Works For Me.

ÆÐŶ¿¡¼­ IP ¿É¼ÇÀ» ¸ðµÎ ¹þ°Ü³¾ ¼ö Àִ Ÿ±ê ¸ðµâ CONFIG_IP_NF_TARGET_IPV4OPTSSTRIP ±â´ÉÀ» Ãß°¡ÇÕ´Ï´Ù.

ÀÌ Å¸±êÀº ¿É¼ÇÀÌ ¾øÀ¸¸ç, µû¶ó¼­ »ç¿ë¹ýÀÌ ¹«Ã´ ½±½À´Ï´Ù:

# iptables -t mangle -A PREROUTING -j IPV4OPTSSTRIP
# iptables -t mangle --list -n
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
IPV4OPTSSTRIP all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination

NETLINK.patch

Status: Working, will not go into main kernel

³Ý¸²Å© ¼ÒÄÏÀ» ÅëÇØ À¯Àú½ºÆäÀ̽º·Î µå¶øµÈ ÆÐŶÀ» º¸³»´Â NETLINK Ÿ±êÀ» Ãß°¡ÇÕ´Ï´Ù(CONFIG_IP_NF_TARGET_NETLINK) ipchains -o ¿É¼ÇÀ» ´ë½ÅÇÕ´Ï´Ù.

NETMAP.patch

Status: Experimental

nat Å×ÀÌºí¿¡ »õ·Î¿î Ÿ±êÀ» ¸¸µì´Ï´Ù(CONFIG_IP_NF_TARGET_NETMAP ¿É¼Ç) È£½ºÆ® ÁÖ¼Ò´Â ±×´ë·Î µÐ ä ³×Æ®¿öÅ© ÁÖ¼Ò¸¸ ¹Ù²Ù´Â °íÁ¤ 1:1 ¸ÅÇÎÀ» ¸¸µì´Ï´Ù. PREROUTING üÀο¡ Àû¿ëÇؼ­ µé¾î¿À´Â ¿¬°áµéÀ» ¸ñÀûÁö ÁÖ¼Ò¸¦ ¹Ù²Ü ¼ö ÀÖÀ¸¸ç, POSTROUTING üÀÎÀÌ Àû¿ëÇؼ­ ³ª°¡´Â ¿¬°áµéÀÇ Ãâ¹ßÁö ÁÖ¼Ò¸¦ ¹Ù²Ü ¼ö ÀÖÀ¸¸ç, µÑ ´Ù ÇѲ¨¹ø¿¡ ¹Ù²Ü ¼öµµ ÀÖ½À´Ï´Ù.(·êÀ» ±¸ºÐÇؼ­)

Examples:

iptables -t nat -A PREROUTING -d 1.2.3.0/24 -j NETMAP --to 5.6.7.0/24
iptables -t nat -A POSTROUTING -s 5.6.7.0/24 -j NETMAP --to 1.2.3.0/24

REJECT.patch.ipv6

Status: In Development, REQUIRES ipv6-fixes.patch

icmp-typeÀº icmpv6 Çü½Ä°ú ´Ù¸¨´Ï´Ù. ÀØÁö ¸¶¼¼¿ä. (ip6tables -j REJECT -h ¸í·ÉÀ¸·Î ´õ ¸¹Àº Á¤º¸¸¦ º¼ ¼ö ÀÖ½À´Ï´Ù)

SAME.patch

The base/SAME patch: Status: In Development/Works For Me

SNATÇÏ°í ºñ½ÁÇÑ ±â´ÉÀ» Á¦°øÇÕ´Ï´Ù(CONFIG_IP_NF_TARGET_SAME): ÁÖ¼Ò ¹üÀ§¸¦(`--to 1.2.3.4-1.2.3.7') »ç¿ëÇÏ´õ¶óµµ Ŭ¶óÀ̾ðÆ®°¡ ÇÑ ¹ø ¿¬°áµÇ°í ³ª¸é ¶È°°Àº ÁÖ¼Ò¸¦ °¡Áý´Ï´Ù.

--nodst ¿É¼ÇÀ» »ç¿ëÇÏ¸é »õ·Î¿î Ãâ¹ßÁö-ip¸¦ ¼±ÅÃÇÒ ¶§ ¸ñÀûÁö-ip¸¦ ÀÌ¿ëÇؼ­ °è»êÇÏÁö ¾Ê½À´Ï´Ù.

ÁÖ¼Ò ÇϳªºÎÅÍ ´ÙÁß ¹üÀ§±îÁö Áö¿øÇÕ´Ï´Ù.

TTL.patch

The base/TTL patch: Status: Stable, needs new checksum handling

IP ÆÐŶ¿¡ TTL °ªÀ» ¼³Á¤Çϰųª ÀÌ¹Ì µé¾î ÀÖ´Â °ªÀ» ´ÃÀÌ°í/ÁÙÀÏ ¼ö ÀÖ´Â CONFIG_IP_NF_TARGET_TTL ¿É¼ÇÀ» Ãß°¡ÇÕ´Ï´Ù.

ahesp6.patch.ipv6

Status: It works 4 me!

AH³ª ESP Çì´õ¸¦ °Ë»çÇÕ´Ï´Ù.

표 B-2. AH options:

optiondesc
--ahspi [!] spi[:spi] match spi (range)
--ahlen [!] length total length of this header
--ahres check the reserved filed, too

표 B-3. ESP options:

optiondesc
--espspi [!] spi[:spi] match spi (range)

frag6.patch.ipv6

Status: It works 4 me!

IPv6 ÆÐŶÀÇ ºÐÀý Çì´õ(fragmentation header) Çʵ带 ±â¹ÝÀ¸·Î ÆÐŶÀ» ¼±ÅÃÇÕ´Ï´Ù.

표 B-4. FRAG options:

optiondesc
--fragid [!] id[:id] match the id (range)
--fraglen [!] length total length of this header
--fragres check the reserved filed, too
--fragfirst matches on the first fragment
[--fragmore|--fraglast] there are more fragments or this is the last one

iplimit.patch

Status: ItWorksForMe[tm]

Ŭ¶óÀ̾ðÆ® IP ÁÖ¼Ò¸¶´Ù µ¿½Ã¿¡ ¼­¹ö¿¡ ¿¬°áÇÒ ¼ö ÀÖ´Â ¼ýÀÚ¸¦ Á¦ÇÑÇÏ´Â CONFIG_IP_NF_MATCH_IPLIMIT¸¦ Ãß°¡ÇÕ´Ï´Ù. (or address block).

Examples:

# Ŭ¶óÀ̾ðÆ®¸¶´Ù ÅÚ³Ý ¿¬°áÀ» µÑ¾¿ Çã¿ëÇÕ´Ï´Ù:
iptables -p tcp --syn --dport 23 -m iplimit --iplimit-above 2 -j REJECT

# °°Àº ±ÔÄ¢À» ´Ù¸¥ ¹æ¹ýÀ¸·Î:
iptables -p tcp --syn --dport 23 -m iplimit ! --iplimit-above 2 -j ACCEPT

# 24ºñÆ® ³Ý¸Å½ºÅ©¸¦ ÀÌ¿ëÇؼ­,
# http µ¿½Ã Á¢¼ÓÀ» 16°³·Î Á¦ÇÑ
iptables -p tcp --syn --dport 80 -m iplimit --iplimit-above 16 --iplimit-mask 24 -j REJECT

ipt_unclean-ubit.patch

Status: Works for me

»ç¿ëÇÏÁö ¾Ê´Â ºñÆ®°¡ Á¶ÀÛµÈ IP·Î ÆÐŶÀ» °Ë»çÇÏ´Â unclean ¸ðµâÀ» Á¦°øÇÕ´Ï´Ù. ÀÌ ¿ÀÇÁ¼Â¿¡´Â µÎ Çʵ尡 ÀÖ½À´Ï´Ù: 3 bit fragmentation flags 13 bit fragmentation offset

Exerpt from RFC 791:

Flags: 3 bits

Various Control Flags.

표 B-5. unclean bits:

desc
Bit 0: reserved, must be zero Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment. Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments. 0 1 2 +---+---+---+ | | D | M | | 0 | F | F | +---+---+---+

Ofir ArkinÀÌ "°ËÁõµÇÁö ¾ÊÀº Çʵå - ¿À´Ã³¯ ¹æÈ­º® & ¹æÈ­º® ±â¼ú¿¡ ¹®Á¦Á¡"¿¡¼­ ¼³¸íÇÑ OS fingerprinting ÇêÁ¡À» ÀÌ¿ëÇÕ´Ï´Ù. ¾Æ·¡ »çÀÌÆ®¿¡¼­ ÀÌ ±ÛÀ» Àо ¼ö ÀÖ½À´Ï´Ù: http://www.sys-security.com/archive/papers/Unverified_Fields_1.0.pdf http://www.sys-security.com/archive/papers/Unverified_Fields_1.0.ps

ipv4options.patch

Status: experimental

ip ¿É¼ÇÀ» °Ë»çÇÏ´Â CONFIG_IP_NF_MATCH_IPV4OPTIONS ¿É¼ÇÀ» Ãß°¡ÇÕ´Ï´Ù.

Áö¿øÇÏ´Â ¿É¼ÇµéÀº:

표 B-6. IPv4 options:

optiondesc
--ssrr To match packets with the flag strict source routing.
--lsrr To match packets with the flag loose source routing.
--no-srr To match packets with no flag for source routing.
[!] --rr To match packets with the RR flag.
[!] --ts To match packets with the TS flag.
[!] --ra To match packets with the router-alert option.
[!] --any-opt To match a packet with at least one IP option, or no IP option at all if ! is chosen.

Example:

$ iptables -A input -m ipv4options --rr -j DROP

will drop packets with the record-route flag.

$ iptables -A input -m ipv4options --ts -j DROP

timestamp Ç÷¡±×¸¦ »ìÆì ÆÐŶÀ» ¹ö¸³´Ï´Ù.

Bug ? --ts¿Í --rrÀ» Å×½ºÆ®ÇßÁö¸¸, ³»°¡ ±×´ÙÁö Àß ¾ËÁö ¸øÇÏ´Â ¼Ò½º ¶ó¿ìÆÃÀ̳ª router-alertÀº »ìÆ캸Áö ¸øÇß½À´Ï´Ù. ±×·¯´Ï, ±×·± °÷¿¡¼­ Á¦´ë·Î µ¿ÀÛÇÏ´ÂÁö Á¦°Ô ¾Ë·ÁÁֽøé.. :)

ipv6header.patch.ipv6

Status: Under development, please test it!

IPv6 ÆÐŶÀÇ Æ¯º°ÇÑ Çì´õ¸¦ ¦Áþ½À´Ï´Ù. match ¸ðµâÀÇ ÇïÇÁ ¸Þ½ÃÁö¿¡¼­ ¸®½ºÆ®¸¦ ãÀ» ¼ö ÀÖ½À´Ï´Ù.

ÀÌ ¸ðµâÀ» »ç¿ëÇÏ´Â ¹æ¹ýÀº(e.g.):

ip6tables -t filter -A INPUT -m ipv6header --header frag -j ACCEPT
ip6tables -t filter -A INPUT -m ipv6header --header 44 -j ACCEPT
ip6tables -t filter -A INPUT -m ipv6header --header route --soft -j ACCEPT

syntax: --header [!] headers --soft

Áö¿øÇÏ´Â Æ÷¸Ë: hop,dst,route,frag,auth,esp,none,prot hop-by-hop,ipv6-opts,ipv6-route,ipv6-frag,ah,esp,ipv6-nonxt,protocol 0,60,43,44,51,50,59 proto means that the packet has got a protocol payload.

The soft mode means that the packet contains the header.

Warning: ÂÉ°³Áø ÆÐŶ¿¡´Â ¹®Á¦°¡ ÀÖ½À´Ï´Ù! ºÐÀý Çì´õ ´ÙÀ½¿¡ È®Àå-Çì´õ°¡ ÀÖÀ¸¸é ù¹ø° ºÐÀý¸¸ ¸ÅĪÇÕ´Ï´Ù.

mport.patch

Status: It works for me.

¸ÖƼÆ÷Æ® ¸ÅÄ¡¸¦ Áö¿øÇÕ´Ï´Ù. ½Ì±ÛÆ÷Æ® ¸øÁö¾Ê°Ô ¹ÙÀÌÆ® ¹üÀ§µµ Àß ´Ù·ì´Ï´Ù.

Examples:

# iptables -A FORWARD -p tcp -m mport --ports 23:42,65

15Æ÷Æ®±îÁö Áö¿øÇÕ´Ï´Ù. Æ÷Æ®¹üÀ§´Â Äݷаú Æ÷Æ® °ª µÑÀ» »ç¿ëÇÕ´Ï´Ù.

nth.patch

Status: Works For Me.

N¹ø° ÆÐŶ¸¶´Ù ±ÔÄ¢À» Àû¿ëÇÏ´Â CONFIG_IP_NF_MATCH_NTH ¿É¼ÇÀ» Ãß°¡ÇÕ´Ï´Ù. ¿©·¯ºÐÀÌ »ç¿ëÇÒ ¼ö ÀÖ´Â ¿­ ¿©¼¸°¡Áö ¼­·Î ´Ù¸¦ Ä«¿îÅÍ°¡ ÀÖ½À´Ï´Ù.

´ÙÀ½ µÎ °¡Áö ¹æ¹ý °¡¿îµ¥ Çϳª¸¦ »ç¿ëÇÕ´Ï´Ù.

1) N¹ø° ÆÐŶ¸¶´Ù, N¹ø° ÆÐŶ¸¸À» ¸ÅÄ¡

example:

iptables -t mangle -A PREROUTING -m nth --every 10 -j DROP

¿­ ¹ø° ÆÐŶ¸¶´Ù ¹ö¸³´Ï´Ù.

2) ¸Å ÆÐŶ¸¶´Ù ´Ù¸¥ ·êÀ» Àû¿ëÇÕ´Ï´Ù. ÀÌ Æ®¸¯Àº Àιٿîµå¿Í ¾Æ¿ô¹Ù¿îµå ¾ç ÂÊ¿¡ ·Îµå¹ë·±½ÌÇÏ´Â ½±°íµµ °£´ÜÇÑ ¹æ¹ýÀÔ´Ï´Ù.

example:

iptables -t nat -A POSTROUTING -o eth0 -m nth --counter 7 --every 3 --packet 0 -j SNAT --to-source 10.0.0.5
iptables -t nat -A POSTROUTING -o eth0 -m nth --counter 7 --every 3 --packet 1 -j SNAT --to-source 10.0.0.6
iptables -t nat -A POSTROUTING -o eth0 -m nth --counter 7 --every 3 --packet 2 -j SNAT --to-source 10.0.0.7

ÀÌ ¿¹¹®¿¡¼­´Â SNAT ÁÖ¼Ò ¼Â »çÀÌ¿¡¼­ Á¢¼ÓµéÀ» ºÐ»êÇÕ´Ï´Ù.

mangle Å×À̺í°ú iproute2¸¦ ÀÌ¿ëÇÑ º¹ÀâÇÑ ·Îµå¹ë·±½ÌÀÌ ¸¹ÀÌ ¾Ë·ÁÁø ¹æ¹ýÀÔ´Ï´Ù. ´Ùµé ±×·¸°Ô ÇÏÁö¿ä. âÁ¶ÀûÀ¸·Î È°¿ëÇغ¸¼¼¿ä.

Áö¿øÇÏ´Â ¿É¼ÇÀº:

표 B-7. nth options:

optiondesc
--every Nth N¹ø° ÆÐŶ¸¶´Ù
[--counter] num 0ºÎÅÍ 15 »çÀÌ Ä«¿îÅ͸¦ »ç¿ëÇÕ´Ï´Ù.(default:0)
[--start] num 0 ´ë»ê ´Ù¸¥ ¼ýÀÚ·Î Ä«¿îÅ͸¦ ÃʱâÈ­ÇÕ´Ï´Ù. 0ºÎÅÍ N-1 »çÀÌ¿©¾ßÇÕ´Ï´Ù.
[--packet] num 'num' ÆÐŶÀ» ¸ÅÄ¡ÇÕ´Ï´Ù. 0 ºÎÅÍ N-1 »çÀÌ --packetÀÌ Ä«¿îÅÍ¿¡ ¾²À̸é 0ºÎÅÍ N-1 »çÀÌ °ªµéÀ» ¸ðµÎ ÅëƲ¾î Ä¿¹öÇÏ´Â N¹ø° --packet ·êÀÌ ¹Ýµå½Ã ÀÖ¾î¾ß ÇÕ´Ï´Ù.

opts6.patch.ipv6

Status: It works 4 me!

IPv6 ÆÐŶ¿¡¼­ ¿É¼Ç Çì´õ¿¡ ÀÖ´Â ÇʵåµéÀ» ±â¹ÝÀ¸·Î ÆÐŶÀ» ¼±ÅÃÇÕ´Ï´Ù.

표 B-8. HBH options:

optiondesc
--hbh-len [!] length Çì´õÀÇ ÃÑ ±æÀÌ
--hbh-opts TYPE[:LEN][,TYPE[:LEN]...] ¿É¼Çµé°ú ±× ±æÀÌ

표 B-9. DST options:

optiondesc
--dst-len [!] length total length of this header
--dst-opts TYPE[:LEN][,TYPE[:LEN]...] Options and its length (list, max: 16)

pool.patch

Status: Development: please tell me if and where I fucked up on the locks.

¾î¶² IP ÁÖ¼Ò ¹üÀ§·ÎºÎÅÍ ÁÖ¼Ò´ç ÇÑ ºñÆ®¾¿ ºñÆ®¸ÊÀ» »ç¿ëÇÒ ¼ö ÀÖ°Ô ÇÏ´Â ¸ÅÄ¡ÀÔ´Ï´Ù; Ç®(pool)¿¡ Ãâ¹ßÁö³ª ¸ñÀûÁö ºñÆ®°¡ µé¾î ÀÖ´ÂÁöÁö °Ë»çÇÕ´Ï´Ù. Ç®¿¡ ÆÐŶ ÁÖ¼Ò¸¦ º¸Å°ųª ¾ø¾Ù ¶§ »ç¿ëÇÏ´Â POOL Ÿ±êÀÌ Ãß°¡µË´Ï´Ù.

Ç®/Ç®ÀÇ ¹üÀ§¸¦ ±ÔÁ¤ÇÏ´Â ippool(8) ÇÁ·Î±×·¥µµ ÄÄÆÄÀÏÇØ ³Ö¾î¾ßÇÕ´Ï´Ù.

psd.patch

Status: Experimental

Æ÷Æ® ½ºÄµ ŽÁö(PSD:port scan detection) ¿É¼ÇÀ» Ãß°¡ÇÕ´Ï´Ù. TCP/UDP Æ÷Æ® ½ºÄµÀ» ŽÁöÇÕ´Ï´Ù. ÀÌ ¸ÅÄ¡´Â Solar DesignerÀÇ scanlogd·ÎºÎÅÍ ÆÄ»ýµÇ¾ú½À´Ï´Ù.

Áö¿øµÇ´Â ¿É¼ÇÀº:

표 B-10. psd options:

optiondesc
--psd-weight-threshold <threshold> ÃÖ±Ù TCP/UDP ÆÐŶ¿¡ ¸ðµç ºñÁßÀ» µÓ´Ï´Ù.
--psd-delay-threshold <delay> 100ÃÊ ´ÜÀ§·Î Áö¿¬½Ã°£À» µÓ´Ï´Ù.
--psd-lo-ports-weight <weight> 1024ÀÌÇÏ Æ÷Æ®(privileged destination port)¿¡ ºñÁßÀ» µÓ´Ï´Ù.
--psd-hi-ports-weight <weight> 1024º¸´Ù Å« Æ÷Æ®¿¡ ºñÁßÀ» µÓ´Ï´Ù.

quota.patch

Status: worksforme

ÆÐŶ¸¶´Ù ¹ÙÀÌÆ® Ä«¿îÅ͸¦ ÁÙ¿©°¡´Â ¹æ¹ýÀ¸·Î »ç¿ë·®À» ÇÒ´çÇÕ´Ï´Ù.

¿É¼ÇÀº:

--quota <bytes> ¹ÙÀÌÆ® ´ÜÀ§·Î

random.patch

Status: Works For Me.

ÁÖ¾îÁø È®·ü¿¡ µû¶ó µÇ´Â ´ë·Î ÆÐŶ¿¡ ±ÔÄ¢À» Àû¿ëÇÕ´Ï´Ù.

¿É¼ÇÀº:

[--average] percent È®·ü, ±âº»°ªÀº 50%

realm.patch

Status: Experimental

realm match: ÆÐŶ ºÐ·ùÇÏ´Â realm Å°¸¦ ÀÌ¿ëÇØ ¶ó¿ìÆÃÀ» °áÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.

/** ÆÐŶ ºÐ·ù ¹®¼­¿¡¼­ ¹ßÃé */

Y¸¦ ¼±ÅÃÇϸé realm Å°¿¡ µû¶ó ³ª°¡´Â ÆÐŶµéÀ» ºÐ·ùÇؼ­ Á¤ÇØÁø ±ÔÄ¢¿¡ µû¶ó ¶ó¿ìÆÃÇÕ´Ï´Ù. Àß ¸ð¸£°ÚÀ¸¸é Y

/** ³¡ **/

# Example
# ¶ó¿ìÆ® Ãß°¡
/sbin/ip route add 194.29.194.0/24 via 194.29.192.1 realm 10
# source realm is in realm with mask 0xFFFF0000,
# destination is in realm with mask 0x0000FFFF
# match destination realm
/usr/local/sbin/iptables -A OUTPUT -m realm --realm 10 -j LOG
# match realm of source, this is also determinated by routing,
/usr/local/sbin/iptables -A INPUT -m realm --realm 655360 -j LOG

CONFIG_NET_CLS_ROUTE°¡ ²À ÇÊ¿äÇÕ´Ï´Ù.

route6.patch.ipv6

Status: It works 4 me!

IPv6 ÆÐŶ¿¡¼­ ¶ó¿ìÆà Çì´õÀÇ Çʵ带 ±â¹ÝÀ¸·Î ÆÐŶÀ» ¼±ÅÃÇÏ´Â È®ÀåµÈ ¦Áþ±â('rt')¸¦ Áö¿øÇÕ´Ï´Ù.

표 B-11. RT options:

optiondesc
--rt-type [!] type match the type
--rt-segsleft [!] num[:num] match the Segments Left field (range)
--rt-len [!] length total length of this header
--rt-0-res check the reserved filed, too (type 0)
--rt-0-addrs ADDR[,ADDR...] Type=0 addresses (list, max: 16)
--rt-0-not-strict List of Type=0 addresses not a strict list

time.patch

Status: It Works For Me.

ÆÐŶÀÌ µµÂøÇϰųª Ãâ¹ßÇÑ ½Ã°£À» µûÁ®¼­ ÇÊÅ͸µÇÕ´Ï´Ù. (³ÝÇÊÅÍ°¡ µ¹°í ÀÖ´Â µ¿¾È ¸Ó½Å¿¡ µµÂøÇÑ ½Ã°£°ú ÆÐŶÀÌ ·ÎÄÿ¡¼­ »ý¼ºµÈ ½Ã°£)

¿É¼ÇÀº:

표 B-12. Time options:

optiondesc
--timestart HH:MM ¸ÅĪ ½ÃÀÛÁ¡
--timestop HH:MM ¸ØÃß´Â ½Ã°£
--days Tue,Mon... ºó Ä­ ¾øÀÌ ¿äÀÏÀ» ¾²¸ç, ½°Ç¥·Î ±¸ºÐÇÕ´Ï´Ù. (Sun,Mon,Tue,Wed,Thu,Fri,Sat)

Example:

-A INPUT -m time --timestart 8:00 --timestop 18:00 --days Mon,Tue,Wed,Thu,Fri

¿ù¿äÀϺÎÅÍ ±Ý¿äÀÏ »çÀÌ¿¡, 8:00->18:00 ¾È¿¡ µµÅ¹ÇÑ ÆÐŶµé¿¡ ±ÔÄ¢À» Àû¿ë

-A OUTPUT -m time --timestart 8:00 --timestop 18:00 --Days Mon

¿ù¿äÀÏ 8:00->18:00 »çÀÌ¿¡ ·ÎÄÿ¡¼­ »ý¼ºµÈ ÆÐŶµé¿¡ ±ÔÄ¢À» Àû¿ë

CONNMARK.patch

Status: working

Ä¿³Ø¼Ç¸¶´Ù Ç¥½Ã¸¦ ´Þ¾Æ CONNMARK Ÿ±ê¿¡¼­ ÀÌ¿ëÇÕ´Ï´Ù.

Usage:

표 B-13. CONNMARK options:

optiondesc
connmark Ä¿³Ø¼Ç°ú ¿¬°üµÈ netfilter mark Çʵ带 ÀÌ¿ëÇÕ´Ï´Ù (¾Æ·¡¿¡¼­ ¼³¸íÇÏ´Â CONNMARK Ÿ±êÀ» ÀÌ¿ëÇÒ ¼ö ÀÖµµ·Ï)
--mark value[/mask] ºÎÈ£ ¾ø´Â ¸¶Å© °ªÀ» ÀÌ¿ëÇØ Ä¿³Ø¼Çµé ¾È¿¡¼­ ÆÐŶÀ» ã¾Æ³À´Ï´Ù (¸Å½ºÅ©°¡ ÁöÁ¤µÇ¾ú´Ù¸é ³í¸®¿¬»ê AND¸¦ ¸ÕÀú Àû¿ëÇÕ´Ï´Ù)
CONNMARK mark °ªÀ» ÁöÁ¤Çϴµ¥ ÀÌ¿ëÇÕ´Ï´Ù.
--set-mark mark Ä¿³Ø¼Ç ¸¶Å©¸¦ ´ä´Ï´Ù
--save-mark Set connection mark to the same as the one on the packet
--restore-mark Ä¿³Ø¼Ç°ú °ü·ÃµÈ ÆÐŶ¿¡ ³ÝÇÊÅÍ Set the netfilter packet mark value to the one associated with the connection. This is only valid in the mangle table.

ROUTE.patch

Status: In Development/Works for me

ÀÌ ¿É¼ÇÀº ¹ÞÀº ÆÐŶÀ» ƯÁ¤ÇÑ ÀÎÅÍÆäÀ̽º·Î Á÷Á¢ Àç¹ß¼Û(resend)ÇÏ´Â 'ROUTE' Ÿ±êÀ» Ãß°¡ÇÕ´Ï´Ù. ÆÐŶ IP ÁÖ¼Ò°¡ ¶ó¿ìÅÍ ÀÚ½ÅÀÌ °¡Áø °Íµé °¡¿îµ¥ ÇϳªÀÌ´õ¶óµµ ÆÐŶÀ» ÁöÁ¤ÇÑ ÀÎÅÍÆäÀ̽º¸¦ ÅëÇØ Àç¹ß¼ÛÇÕ´Ï´Ù. ±×·± ÆÐŶµéÀº ·ÎÄÿ¡¼­ ¹ÞÀº ´ÙÀ½ ÀϹÝÀûÀÎ ¶ó¿ìÆà ¸ÞÄ¿´ÏÁòÀ» ÅëÇؼ­´Â ´Ù¸¥ ÄÄÇ»ÅÍ¿¡ Àü´Þ(forward)ÇÒ ¼ö ¾ø´Â °ÍµéÀÔ´Ï´Ù.

표 B-14. ROUTE options:

optiondesc
--iface name ÁöÁ¤ÇÑ À̸§À» °¡Áø ÀÎÅÍÆäÀ̽º·Î ÆÐŶÀ» Á÷Á¢ º¸³À´Ï´Ù
--ifindex index ÀÎÅÍÆäÀ̽º À妽º¸¦ ÅëÇØ ÆÐŶÀ» Á÷Á¢ º¸³À´Ï´Ù

Example : ¿©·¯ºÐ ³×Æ®¿öÅ© ¾ÈÂÊ¿¡ ssh ¼­¹ö¸¦ ¼³Ä¡ÇÏ°í ¶ó¿ìÅÍ¿¡ µÐ °Íó·³ º¸À̱⸦ ¿øÇÑ´Ù¸é ¶ó¿ìÅÍ¿Í °°Àº IP¿¡ ¸ñÀûÁö Æ÷Æ® 22¸¦ ÇâÇÏ´Â ÆÐŶµéÀ» ´Ü¼øÈ÷ reroute ÇÕ´Ï´Ù.

# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 22 -j ROUTE --iface tunl1
# iptables -A PREROUTING -t nat -i tunl1 --j ROUTE --iface eth0

eggdrop-conntrack.patch

Status: Development

eggdrop º¸Æ®¸¦ ÃßÀûÇÕ´Ï´Ù.

h323-conntrack-nat.patch

Status: Alpha

NAT ¾È¿¡¼­µµ H.323/netmeetingÀ» Áö¿øÇÕ´Ï´Ù. H.323Àº ´ÙÀ½ µ¥ÀÌÅÍ ½ºÆ®¸²À» »ç¿ëÇÕ´Ï´Ù:

표 B-15. H.323 data streams:

portdesc
389 Internet Locator Server (TCP)
522 User Location Server (TCP)
1503 T.120 Protocol (TCP)
1720 H.323 (H.225 call setup, TCP)
1731 Audio call control (TCP)
Dynamic H.245 call control (TCP)
Dynamic RTCP/RTP streaming (UDP)

H.323 conntrack/NAT ¸ðµâÀº ´ÙÀ̳ª¹Í Æ÷Æ®¸¦ ã´Â µ¥ÀÌÅÍ ½ºÆ®¸²À» ÃßÀûÇؼ­ ¿¬°áÇÕ´Ï´Ù. ÇïÆÛ´Â 2.2 Ä¿³Î ½Ã¸®ÁîÀÇ ip_masq_h323.c ¸ðµâ¿¡¼­ °Ë»ö/ġȯ ºÎºÐÀ» ÇØÅ©Çß½À´Ï´Ù.

ÃÖ¼ÒÇÑ H.323/netmeeting (video/audio)´Â 1720 Æ÷Æ®¸¦ ÅëÇØ ÅëÁ¦µÇ¸ç H.323 ¸ðµâÀ» ºÒ·¯µéÀÔ´Ï´Ù. At the very minimum,

H.323 conntrack/NAT ¸ðµâÀº H.245 tunnelling, H.225 RAS (gatekeepers)´Â Áö¿øÇÏÁö ¾Ê½À´Ï´Ù.

nfnetlink-ctnetlink-0.11.patch

Status: Under development, but stabilizing now.

..

pptp-conntrack-nat.patch

Status: Beta

NAT ¾È¿¡¼­ PPTP ¿¬°áÀ» ÃßÀûÇÕ´Ï´Ù.

PNS·ÎºÎÅÍ PAC·Î ÇâÇÏ´Â ¿¬°á¸¸ NATÇÒ ¼ö ÀÖÀ¸¸ç, ÇÑ ¼¼¼Ç ¾È¿¡¼­ ´ÙÁß È£ÃâÀº Áö¿øÇÏÁö ¾Ê½À´Ï´Ù.

recent.patch

Status: Tested locally, no problems so far.

ÃÖ±Ù¿¡ º¸¾Ò´ø IP ÁÖ¼Ò¿¡ ´ëÇØ Çϳª, ȤÀº ±× ÀÌ»ó ¸ñ·ÏÀ» ¸¸µé°í ±× ¸ñ·ÏÀ» ÀÌ¿ëÇØ ¸ÅĪÇÕ´Ï´Ù.

표 B-16. recent options:

optiondesc
--name ¸í·É¿¡¼­ »ç¿ëÇÒ ¸®½ºÆ®¸¦ ÁöÁ¤ÇÕ´Ï´Ù. ¾Æ¹« À̸§µµ ¾øÀ¸¸é 'DEFAULT'°¡ ¾²ÀÔ´Ï´Ù
--set '!'¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¸®½ºÆ®¿¡ ÆÐŶÀÇ Ãâ¹ßÁö ÁÖ¼Ò¸¦ Ãß°¡ÇÕ´Ï´Ù. Ãâ¹ßÁö ÁÖ¼Ò°¡ ÀÌ¹Ì ÀÖ´Ù¸é, ±× °ªÀ» »õ·Î °íĨ´Ï´Ù. µû¶ó¼­ Ç×»ó ¼º°ø°ªÀ» ¸®ÅÏÇÕ´Ï´Ù
--rcheck '!'¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ÆÐŶÀÇ Ãâ¹ßÁö ÁÖ¼Ò°¡ ÇöÀç ¸®½ºÆ®¿¡ µé¾î ÀÖ´Ù¸é true °ªÀ» ¸®ÅÏÇÏ°í, ¾Æ´Ï¶ó¸é false °ªÀ» ¸®ÅÏÇÕ´Ï´Ù.
--update '!'¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ÆÐŶÀÇ ¼Ò½º ÁÖ¼Ò°¡ ÇöÀç ¸®½ºÆ®¿¡ µé¾î ÀÖ´ÂÁö üũÇÕ´Ï´Ù. ¸®½ºÆ®¿¡ µé¾î ÀÖ´Ù¸é ¾÷µ¥ÀÌÆ®ÇÏ°í true °ªÀ» ¸®ÅÏÇÕ´Ï´Ù. Ãâ¹ßÁö ÁÖ¼Ò°¡ ¸®½ºÆ®¿¡ ¾ø´Ù¸é false °ªÀ» ¸®ÅÏÇÕ´Ï´Ù.
--remove '!'¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ÆÐŶÀÇ ¼Ò½º ÁÖ¼Ò°¡ ÇöÀç ¸®½ºÆ®¿¡ µé¾î ÀÖ´ÂÁö üũÇÕ´Ï´Ù. ¸®½ºÆ®¿¡ µé¾î ÀÖ´Ù¸é Áö¿ö¹ö¸³´Ï´Ù.
--seconds '!'¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. 'rcheck'³ª 'update' ¿Í Á¶ÇÕÇÏ¿© »ç¿ëÇØ¾ß ÇÕ´Ï´Ù. ¸®½ºÆ®¿¡ ±× ÁÖ¼Ò°¡ µé¾î ÀÖ°í ¸¶Áö¸·À¸·Î ÁÖ¾îÁø ÃÊ(seconds)°¡ °æ°úÇÏÁö ¾ÊÀ» ¶§¿¡¸¸ ¦Áþ½À´Ï´Ù.
--hitcount '!'¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. 'rcheck'³ª 'update' ¿Í Á¶ÇÕÇÏ¿© »ç¿ëÇØ¾ß ÇÕ´Ï´Ù. ±× ÁÖ¼Ò°¡ ¸®½ºÆ®¿¡ µé¾î ÀÖ°í, ¹ÞÀº ÆÐŶÀÌ ÁÖ¾îÁø °ªº¸´Ù Å©°Å³ª °°À» ¶§¿¡¸¸ ¦Áþ½À´Ï´Ù. ÀÌ ¿É¼ÇÀº 'seconds'°ú Á¶ÇÕÇÏ¿© Á¤ÇØÁø ½Ã°£ ¾È¿¡ Á¤È®ÇÏ°Ô ÇÊ¿äÇÑ È÷Æ® °ª¸¸Å­¸¸ ¦Áö¾î¼­, ´õ¿í Á¤¹ÐÇÏ°Ô Àû¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
--rttl '!'¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. 'rcheck'³ª 'update' ¿Í Á¶ÇÕÇÏ¿© »ç¿ëÇØ¾ß ÇÕ´Ï´Ù. ±× ÁÖ¼Ò°¡ ¸®½ºÆ®¿¡ µé¾î ÀÖ°í, ÇöÀç ÆÐŶÀÇ TTL °ªÀÌ --set ·ê¿¡¼­ ÁöÁ¤ÇÑ ÆÐŶ°ú ÀÏÄ¡ÇÒ ¶§¿¡¸¸ ¦Áþ½À´Ï´Ù. ¸¸¾à ¿©·¯ºÐÀÇ ¸Ó½ÅÀ» ÅëÇØ ´Ù¸¥ ´©±º°¡¸¦ DoS °ø°ÝÇÒ ¸ñÀûÀ¸·Î ÀÚ½ÅÀÇ Ãâ¹ßÁö ÁÖ¼Ò¸¦ ¼Ó¿©¼­ ¾ûÅ͸® ÆÐŶÀ» º¸³»´Â À̵éÀÌ ÀÖ´Ù¸é ÀÌ ¸ðµâ·Î º¸³»¹ö¸³½Ã´Ù.
--rsource recent ¸®½ºÆ® ÆäÀÌºí¿¡ ÀÖ´Â ÆÐŶ¸¶´Ù ¼Ò½º ÁÖ¼Ò¸¦ ÀúÀåÇÕ´Ï´Ù.
--rdest recent ¸®½ºÆ® ÆäÀÌºí¿¡ ÀÖ´Â ÆÐŶ¸¶´Ù ¸ñÀûÁö ÁÖ¼Ò¸¦ ÀúÀåÇÕ´Ï´Ù. /proc/net/ipt_recent´Â ÇöÀç È°¼ºÈ­µÈ ¸®½ºÆ®¸¦ ´ã°í ÀÖ´Â µð·ºÅ丮ÀÔ´Ï´Ù. /proc/net/ipt_recent/* ÇöÀç ÁÖ¼Ò¿Í °¢ ¸®½ºÆ®ÀÇ ¿£Æ®¸®¿¡ ´ëÇÑ Á¤º¸ ¸ñ·ÏÀÔ´Ï´Ù. /proc/net/ipt_recent/ ¾È¿¡ ÀÖ´Â °¢ ÆÄÀϵéÀº ÇöÀç ¸®½ºÆ®¸¦ º¸±âÀ§ÇØ Àаųª ¸ñ·ÏÀ» °íÄ¡±â À§ÇØ ´ÙÀ½ µÎ ¸í·ÉÀ» »ç¿ëÇØ ¾µ ¼ö ÀÖ½À´Ï´Ù: 'echo xx.xx.xx.xx > /proc/net/ipt_recent/DEFAULT'³ª 'echo +xx.xx.xx.xx > /proc/net/ipt_recent/DEFAULT' ´Â DEFAULT ¸®½ºÆ®¿¡ Ãß°¡ÇÏ´Â ¸í·ÉÀÔ´Ï´Ù. 'echo -xx.xx.xx.xx > /proc/net/ipt_recent/DEFAULT'Àº DEFAULT ¸®½ºÆ®·ÎºÎÅÍ Á¦°ÅÇÏ´Â ¸í·É, 'echo clear > /proc/net/ipt_recent/DEFAULT'´Â DEFAULT ¸®½ºÆ®¸¦ ºñ¿ö³»´Â ¸í·ÉÀÔ´Ï´Ù.

recent ¸ðµâÀº ½º½º·Î µÎ °¡Áö Æз¯¹ÌÅ͸¦ Çã¿ëÇÕ´Ï´Ù:

   ip_list_tot=100
   ip_pkt_list_tot=10
   ip_list_hash_size=0
   debug=0
   

À§ °ªµéÀº µðÆúÆ® °ªÀÔ´Ï´Ù. ip_list_tot´Â ±â¾ïÇÒ ÃÖ´ë ÁÖ¼Ò ¼öÀε¥, Å©±â¸¦ ÀûÀýÈ÷ Á¶ÀýÇØ¾ß ÇÕ´Ï´Ù. ¸®½ºÆ®´Â ¦ÁöÀ¸·Á ÇÒ ¶§¸¶´Ù Â÷·Ê·Î °Ë»öµË´Ï´Ù. ÀÌ °ªÀ» Áö³ªÄ¡°Ô ´ÃÀÌ¸é ¸®½ºÆ® µÚÁö´Âµ¥ ¸¹Àº ½Ã°£À» ÇãºñÇϹǷΠÁÁÁö ¾Ê½À´Ï´Ù.

ip_pkt_list_tot´Â °¢ ÁÖ¼Ò°¡ ±â¾ïµÉ ÆÐŶÀÇ ¼öÀÔ´Ï´Ù. ÀÌ ¸®½ºÆ®´Â '--hitcount'¿¡¼­¸¸ »ç¿ëµÇ¹Ç·Î ±»ÀÌ ÀÌ °ªÀ» ´ÃÀÌÁö ¾Ê´õ¶óµµ ±âº»°ªÀ¸·Î ÃæºÐÇÒ °ÍÀÔ´Ï´Ù.

ip_list_hash_size´Â Çؽà Å×À̺í Å©±âÀÔ´Ï´Ù(Å×À̺í À§Ä¡, ¹ÙÀÌÆ®°¡ ¾Æ´Ô).

debug´Â µð¹ö±ë ¸Þ½ÃÁö¸¦ º¸¿©ÁÖ±â À§ÇÑ ¼³Á¤ÀÔ´Ï´Ù. ¾ÆÁ÷ ¿©·¯ ·¹ºí·Î ¼¼ºÐµÇÁö ¾Ê¾ÒÀ¸¸ç, 0Àº ÀüÇô ¾øÀ½, 1Àº ¸ðµÎ ´Ù¸¦ ¶æÇÕ´Ï´Ù. »ó¿ë ¸Ó½Å¿¡¼­´Â 1À» »ç¿ëÇÏÁö ¸¶¼¼¿ä. °ð ·Î±×·Î ²Ë Â÷¹ö¸³´Ï´Ù.

Example #1:

# iptables -A FORWARD -m recent --rcheck --seconds 60 -j DROP
# iptables -A FORWARD -i eth0 -d 127.0.0.0/8 -m recent --set -j DROP

eth0 ÀÎÅÍÆäÀ̽º 127.0.0.0/8·Î µ¥ÀÌÅ͸¦ º¸³»·ÁÇÏ´Â (Á¤»óÀûÀÎ °æ¿ì Àý´ë ÀϾ ¼ö ¾ø´Â ÀÏÀÌÁö¿ä) ¾î¶² '³ª»Û ³à¼®'À» ¸ô¾Æ³»´Â ·êÀÔ´Ï´Ù. ù ÆÐŶÀÌ Ã¹¹ø° ·ê¿¡¼­ ¼ö»ó½Àº ³ðÀ¸·Î üũµÇ°í µÎ¹ø° ·ê¿¡¼­ ºÙµé·Á¼­ ±× ÁÖ¼Ò´Â recent ¸®½ºÆ®¿¡ µé¾î°£ ´ÙÀ½ ÆÐŶÀÌ µå¶øµË´Ï´Ù.

±× ÁּҷκÎÅÍ ´ÙÀ½ 60ÃÊ µ¿¾È µÚÀÌÀº ÆÐŶµéÀº ¸ñÀûÁö ÁÖ¼Ò³ª Æ÷Æ®, ±âŸ ¹«¾ù°úµµ »ó°ü¾øÀÌ ¸ðµÎ ¹ö·ÁÁý´Ï´Ù.

Example #2:

# iptables -A FORWARD -m recent --update --seconds 60 -j DROP
# iptables -A FORWARD -i eth0 -d 127.0.0.0/8 -m recent --set -j DROP

(±Û¾´ÀÌ°¡ °¡Àå ÁÁ¾ÆÇÏ´Â ·ê..)

ÀÌ ·êÀº ¸ðµç ÀÌ ¼Ò½º ÁּҷκÎÅÍ ¹ÞÀº ÈÄ¼Ó ÆÐŶµéÀÇ 'last seen' »óÅ°ªÀÌ Å×ÀÌºí¿¡¼­ ¾÷µ¥ÀÌÆ®µÇ´Â °ÍÀ» Á¦¿ÜÇÏ°í´Â ¿¹Á¦ #1°ú °°½À´Ï´Ù. ±×·¯¹Ç·Î ÀÌ ÁּҷκÎÅÍ ¿À´Â ÆÐŶµéÀº ¾Æ¹«¸® Áß¿äÇÑ °ÍµéÀ̶ó ÇÏ´õ¶óµµ 60ÃÊ°¡ Áö³ª±â Àü¿¡´Â 'ħ¹¬'ÇÒ °ÍÀÔ´Ï´Ù.

±Û¾´ÀÌÀÇ Àǵµ´Â ¸ðµç 'DROP'·êÀ»:

'-m recent --set -j DROP'

±×¸®°í:

'-m recent --update --seconds 60 -j DROP'

·ê·Î ¹Ù²Ù´Â °ÍÀÔ´Ï´Ù. ±× ÀÌÀü¿¡ ´ÙÀ½: rule be added very early on in the rule set, though following any:

'--match state --state ! NEW,INVALID -j ACCEPT'

·ê µîÀÌ ÀÖ´Ù ÇÏ´õ¶óµµ. '--update'·êÀÌ ! NEW,INVALID üũ¿¡ ¾Õ¼­¸é ESTABLISHED Ä¿³Ø¼ÇÀ̳ª ±×·± ESTABLISHED¿Í ¦ÀÎ ÇÁ·Î¼¼½ºµéÀÌ ÀÚ½ÅÀÇ ¼Ò½º ÁÖ¼Ò¸¦ Á¶ÀÛÇÒ ¼ö ÀÖ´Â ¾Ç´çµé¿¡ ÀÇÇØ ¾îÁö·´ÇôÁú ¼ö ÀÖ½À´Ï´Ù.

rsh.patch

Status: request for inclusion

RSH Ä¿³Ø¼ÇÀ» ÃßÀûÇÕ´Ï´Ù. ÁÖÀÇ: 2.4.18, 2.4.19 Ä¿³Î¿¡¼­ RSH ÆÐÄ¡¸¦ Æ÷ÇÔÇϸé ÄÄÆÄÀÏÇÒ ¶§ ¿À·ù°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù.

RSH Ä¿³Ø¼Ç Æ®·¡Ä¿´Â ÀϹÝÀûÀÎ RSH ¼¼¼Ç¿¡¼­ "Server to Client" Ä¿³Ø¼Ç µ¿Àû Ç¥ÁØ ¿¡·¯°¡ ¹ß»ýÇÏ¿´À» ¶§ ÇÊ¿äÇÕ´Ï´Ù. ÀüÇüÀûÀÎ ¼ö¼øÀº ´ÙÀ½°ú °°½À´Ï´Ù;

   Client 0:1023 --> Server 514    (stream 1 - stdin/stdout)
   Client 0:1023 <-- Server 0:1023 (stream 2 - stderr)
   

ÀÌ Ä¿³Ø¼Ç Æ®·¡Ä¿´Â »õ RSH ¼¼¼ÇÀ» ÀÎÁöÇÏ°í, ³ª°¡´Â ¼¼¼ÇÀ» »ó¼¼ÇÏ°Ô ÃßÃâÇؼ­, "°ü·Ã" ¼¼¼ÇÀ» ó¸®ÁßÀÎ ³ÝÇÊÅÍ¿¡°Ô ¾Ë¸³´Ï´Ù.

Usage:

´ÙÀ½ ·ê¼ÂÀº ÀÌ ¸ðµâ »ç¿ë¹ýÀ» ¼³¸íÇϱâ À§ÇÑ °ÍÀÔ´Ï´Ù;

# New session from client to server (stream 1)
-A PREROUTING -t nat -m state -i eth0 -p tcp -s ${client} --sport 0:1023 -d ${server} --dport 514 --state NEW,ESTABLISHED -j ACCEPT
# Continued session from server to client (stream 1)
-A PREROUTING -t nat -m state -i eth1 -p tcp -s ${server} --sport 514 -d ${client} --dport 0:1023 ! --syn --state ESTABLISHED -j ACCEPT
# New session from server to client (stream 2)
-A PREROUTING -t nat -m state -i eth1 -p tcp -s ${server} --sport 0:1023 -d ${client} --dport 0:1023 --state RELATED,ESTABLISHED -j ACCEPT
# Continued session from client to server (stream 2)
-A PREROUTING -t nat -m state -i eth0 -p tcp -s ${client} --sport 0:1023 -d ${server} --dport 0:1023 ! --syn --state ESTABLISHED -j ACCEPT

Warning:

ÀÌ ¸ðµâÀº À§ÇèÇÒ ¼ö ÀÖ½À´Ï´Ù.

string.patch

Status: Working, not with kernel 2.4.9

Àüü ÆÐŶ¿¡¼­ ¹®ÀÚ¿­À» °Ë»öÇÕ´Ï´Ù.

¿¹¹®:

${IPTABLES} -A INPUT -p tcp --tcp-flags ACK ACK --dport 80 -m string --string "/default.ida?" -j REJECT --reject-with tcp-reset

cod red ¿úÀ» °É·¯³»´Â ·êÀÔ´Ï´Ù.

Ä¿³Î 2.4.9¿¡¼­´Â µ¿ÀÛÇÏÁö ¾Ê½À´Ï´Ù !!!

talk-conntrack-nat.patch

Status: Alpha

NAT ¾È¿¡¼­ talk¸¦ Áö¿øÇÕ´Ï´Ù.

±âº»°ªÀ¸·Î talk (UDP port 517)¿Í ntalk/ntalk2 (UDP port 518)¸¦ µÑ ´Ù Áö¿øÇÕ´Ï´Ù. talk/ntalk/ntalk2´Â ip_conntrack_talk°ú ip_nat_talk ¸ðµâÀÇ Æз¯¹ÌÅ͸¦ Á¶Á¤Çؼ­ ¼±ÅÃÀûÀ¸·Î Áö¿øÇÒ ¼ö ÀÖ½À´Ï´Ù:

talk=0|1, ntalk=0|1, ntalk2=0|1

'0'Àº 'Áö¿øÇÏÁö ¾ÊÀ½', '1'Àº 'Áö¿øÇÔ'

tcp-window-tracking.patch

Status: proven to be quite stable, but still experimental Status: ported to newnat, needs testing.

Guido van Rooij [1]°¡ ¾´ 'Real Stateful TCP Packet Filtering in IP Filter' ±â»ç¿¡ µû¸¥ TCP ¿¬°á ÃßÀûÀ» À§ÇÑ ÆÐÄ¡ÀÔ´Ï´Ù. ÀÌ ÆÐÄ¡¿¡´Â ÀÌ¹Ì ¿¬°áÀÌ È®¸³µÈ Ä¿³Ø¼ÇÀ» ´Ù·ç±â À§ÇÑ »õ·Î¿î TCP ¿¬°á ÃßÀû Äڵ带 Æ÷ÇÔÇÏ°í ÀÖ½À´Ï´Ù. TCP À©µµ¿ì Å©±â Á¶Á¤µµ Áö¿øÇÕ´Ï´Ù.

³ÝÇÊÅÍ¿¡ µé¾î ÀÖ´Â vanilla TCP ¿¬°á ÃßÀû°ú ºñ±³Çؼ­ ´Ù¸¥ Á¡µéÀº:

- CLOSE_WAIT »óŸ¦ À§ÇÑ Å¸ÀӾƿô ±âº»°ªÀÌ 3ÀÏ·Î ´Ã¾î³µ½À´Ï´Ù.

- /proc/sys/net/ipv4/netfilter/ ¾Æ·¡ ¸¹Àº Æз¯¹ÌÅ͵é·Î ¿£ÁøÀ» ¼¼¼¼ÇÏ°Ô Á¶À²ÇÒ ¼ö ÀÖ½À´Ï´Ù:

표 B-17. tcp-window-tracking options:

optiondesc
ip_conntrack_*_timeout*ÃÊ´ÜÀ§·Î ÁöÁ¤ÇÏ´Â conntrack ŸÀӾƿô
ip_conntrack_maxÃÖ´ë conntrack ¿£Æ®¸® ¼ö
ip_conntrack_tcp_be_liberalÈ°¼ºÈ­µÇ¸é À©µµ¿ì ¸®¼Â (RST) ¼¼±×¸ÕÆ®¸¦ ¹þ¾î³­ ÆÐŶ¿¡¸¸ INVALID Ç¥½Ã¸¦ ´ä´Ï´Ù; ±âº»°ªÀº disableÀε¥, À©µµ¿ì Å©±â¸¦ ¹þ¾î³­ ¸ðµç ÆÐŶ¿¡ INVALID Ç¥½Ã¸¦ ´ä´Ï´Ù.
ip_conntrack_tcp_log_invalid_scale¹«È¿ÇÑ À©µµ¿ì ½ºÄÉÀϸµ °ªÀ» °¡Áø ÆÐŶÀ» ±â·ÏÇÕ´Ï´Ù(±âº»°ª enable)
ip_conntrack_tcp_log_out_of_windowÀ©µµ¿ì Å©±â¸¦ ¹þ¾î³­ ÆÐŶÀ» ±â·ÏÇÕ´Ï´Ù((±âº»°ª enable)
ip_conntrack_tcp_looseÀÌ °ªÀÌ 0À̸é(±âº»°ªÀº 3) ÀÌ¹Ì ¿¬°áµÈ Ä¿³Ø¼ÇÀ» ÇȾ÷ÇÒ ¼ö ¾ø½À´Ï´Ù.
ip_conntrack_max_retrans¸ñÀûÁö·ÎºÎÅÍ ACK ÆÐŶÀ» ¹ÞÁö ¸øÇÑ ÆÐŶµéÀ» ÀçÀü¼ÛÇϴ Ƚ¼ö¸¦ Á¤ÇÕ´Ï´Ù. ÀçÀü¼Û Ƚ¼ö°¡ ¿©±â¼­ ÁöÁ¤ÇÑ °ª¿¡ ´Ù´Ù¸£¸é(±âº»°ªÀº 3)
ip_conntrack_timeout_max_retransÀçÀü¼Û ŸÀӾƿôÀÔ´Ï´Ù. ±âº»°ªÀº 5ºÐ

- ÁÖÀÇ!!! /proc/sys/net/ipv4/ip_conntrack_max´Â /proc/sys/net/ipv4/netfilter/ip_conntrack_max·Î ¹Ù²î¾ú½À´Ï´Ù. ¿©·¯ºÐ ½ºÅ©¸³Æ®¸¦ ÀÌ Æз¯¹ÌÅÍ¿¡ ¸ÂÃß¾î ¼Õº¸¼¼¿ä!!!

[1] http://www.iae.nl/users/guido/papers/tcp_filtering.ps.gz

tftp-conntrack-nat.patch

The extra/tftp-conntrack-nat patch:

TFTP´Â NAT ¾È¿¡¼­ ¿¬°áÇÒ ¼ö ¾ø´Âµ¥ ÀÌ ¸ðµâÀ» ¾²¸é °¡´ÉÇÕ´Ï´Ù.

modprobe ip_conntrack_tftp ports=69,70 ¸í·ÉÀº tftp Ä¿³Ø¼Ç¿¡ Æ÷Æ® 69¿Í 70À» »ç¿ëÇÑ´Ù´Â ¶æÀÔ´Ï´Ù. Æз¯¹ÌÅÍ°¡ ¾øÀ¸¸é ±âº»°ªÀº 69ÀÔ´Ï´Ù.

If you have trouble please drop me a mail and I will help you.

¸ðµç ¼³Á¤À» ¸¶Ä¡¸é Rusty°¡ ȯ¿µ ¸Þ½ÃÁö¿Í ¿©·¯ºÐ ½Ã½ºÅÛ¿¡ ÆÐÄ¡µÈ ¸®½ºÆ®¸¦ ¸ðµÎ Ãâ·ÂÇÕ´Ï´Ù. ÀÌÁ¦ ¿£ÅÍÅ°¸¸ ´©¸£¸é ±æ°í Áö·çÇß´ø Patch-o-matic ÆÐÄ¡°¡ ³¡³³´Ï´Ù.

Welcome to Rusty's Patch-o-matic!

Each patch is a new feature: many have minimal impact, some do not. Almost every one has bugs, so I don't recommend applying them all!

Already applied: submitted/2.4.18
                 submitted/DSCP
                 submitted/ECN
                 submitted/REJECT-dont_fragment
                 submitted/REJECT_mark
                 submitted/TOS-oops-fix
                 submitted/ahesp-static
                 submitted/arptables
                 submitted/config-cleanup
                 submitted/conntrack+nat-helper-unregister
                 submitted/conntrack
                 submitted/dscp
                 submitted/ecn
                 submitted/helper
                 submitted/ip6tables-export-symbols
                 submitted/ip_conntrack_protocol_destroy
                 submitted/ip_conntrack_protocol_unregister
                 submitted/ip_nat_irc-srcaddr-fix
                 submitted/ipt_MIRROR-ttl
                 submitted/ipt_REJECT-checkentry
                 submitted/ipt_unclean-ecn
                 submitted/irc-dcc-mask
                 submitted/local-nat
                 submitted/macro-trailing-semicolon-fix
                 submitted/mangle5hooks
                 submitted/nat-export_symbols
                 submitted/nat-memoryleak-fix
                 submitted/netfilter-arp
                 submitted/ownercmd
                 submitted/pkttype
                 submitted/skb_clone_copy
                 submitted/ulog-module-unload
                 submitted/z-newnat16
                 base/IPV4OPTSSTRIP
                 base/NETLINK
                 base/NETMAP
                 base/SAME
                 base/TTL
                 base/iplimit
                 base/ipt_unclean-ubit
                 base/ipv4options
                 base/mport
                 base/nth
                 base/pool
                 base/psd
                 base/quota
                 base/random
                 base/realm
                 base/time
                 extra/ROUTE
                 extra/h323-conntrack-nat
                 extra/pptp-conntrack-nat
                 extra/recent
                 extra/rsh
                 extra/string
                 extra/talk-conntrack-nat
                 extra/tcp-window-tracking
                 extra/tftp-conntrack-nat
No more patches to apply! Q to Quit or ? for options [Q/a/r/b/?] 
Script done on Mon Sep  9 15:58:32 2002

ÆÐÄ¡¸¦ ¸¶Ä£ ´ÙÀ½¿¡´Â Ä¿³ÎÀ» »õ·Î ÄÄÆÄÀÏÇÏ°í, iptables ¼Ò½º µð·ºÅ丮¿¡¼­ make && make install ¸í·ÉÀ¸·Î iptables µµ±¸µéÀ» ¼³Ä¡ÇÕ´Ï´Ù.