WAN --- °øÀ¯±â ---- ¼¹öÄÄ1 (192.168.0.10)
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¤¤--- ¼¹öÄÄ2 (192.168.0.20)
ÀÌ·¸°Ô °øÀ¯±â ÇϴܺΠ»ç¼³¸Á¿¡ ¼¹öÄÄ2´ë°¡ ¿¬°áµÇ¾î ÀÖ°í
°øÀ¯±â ÀÚü³» DMZ ¼³Á¤À¸·Î ¿ÜºÎ¿¡¼ Á¢±ÙÇÒ ½Ã ¼¹öÄÄ1¿¡ ¸ðµç Æ÷Æ®¸¦ ¸ô¾ÆÁØ »óÅÂÀÔ´Ï´Ù.
µÑ ´Ù centos 5.3 32bitÀÌ ¼³Ä¡ µÈ »óÅÂÀÔ´Ï´Ù.
°¢°¢ ÀÌ´õ³ÝÄ«µå´Â 1°³¸¸ ¼³Ä¡µÇ¾î ÀÖ½À´Ï´Ù.
°¢°¢ ftp¼¹ö°¡ ¼³Ä¡ µÇ¾î ÀÖ°í, °¢ Æ÷Æ®´Â 21 Æ÷Æ®¸¦ »ç¿ëÇÕ´Ï´Ù.
ddns¸¦ ÀÌ¿ëÇÏ¿© °³ÀÎ µµ¸ÞÀÎ(exam.net)¿¡ ¿¬°áµÇ¾î ÀÖ½À´Ï´Ù.
¿ø°Ý¿¡¼ »ç¿ëÀÚ°¡ ftp client¸¦ »ç¿ëÇÏ¿© exam.netÀ¸·Î Á¢¼ÓÀ» ½ÃµµÇÏ¸é ¼¹öÄÄ1(192.168.0.10:21)·Î Àß Á¢¼ÓÀÌ µÇ´Âµ¥
¸¸ÀÏ exam.net:7000À¸·Î Á¢¼ÓÀ» ½ÃµµÇÒ °æ¿ì À̶§µµ ¼¹öÄÄ1·Î Á¢¼ÓÀÌ µé¾î¿À´Âµ¥,
¼¹öÄÄ1ÀÌ iptables ±ÔÄ¢À» »ç¿ëÇÏ¿© ¼¹öÄÄ2ÀÇ 21Æ÷Æ®(192.168.0.20:21)·Î ³Ñ±æ ¼ö ÀÖ´Â ¹æ¹ýÀ» ¾Ë°í ½Í½À´Ï´Ù.
*¹°·Ð °øÀ¯±â ³»ÀÇ Æ÷Æ®Æ÷¿öµù ¼³Á¤À» Çصµ ÇØ°áµÈ´Ù´Â °ÍÀº ¾Ë°í ÀÖ½À´Ï´Ù
ÇöÀç ¼¹öÄÄ1ÀÇ iptables ±¸¼ºÀº ´ÙÀ½°ú °°½À´Ï´Ù.
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 7000 -j DNAT --to-destination 192.168.0.20:21
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [565:40050]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p esp -j ACCEPT
-A RH-Firewall-1-INPUT -p ah -j ACCEPT
-A RH-Firewall-1-INPUT -d 224.0.0.251 -p udp -m udp --dport 5353 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 20 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 23 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
¿©±â¼ ¹» ´õ ¾î¶»°Ô ¼öÁ¤ÇؾßÇÒ±î¿ä...
ÇöÀç´Â ftp¸¸ ¼³Á¤µÇ¾îÀÖÁö¸¸ ssh¿Ü ±âŸµîµîµµ ¸ðµÎ Àú·±½ÄÀ¸·Î ÇØ°áÇÒ ¿¹Á¤ÀÔ´Ï´Ù.
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
¸¦ ¾Æ·¡¿Í °°ÀÌ º¯°æÇϼ¼¿ä
-A RH-Firewall-1-INPUT -p tcp --dport 1024:65535 -m state --state ESTABLISHED,RELATED -j ACCEPT
±×¸®°í °øÀ¯±â ¹Ù·Î ÇÏ´Ü¿¡ L2 ½ºÀ§Ä¡ Çϳª ¹°·Á¼ ³»ºÎ ¼¹ö°£¿¡ ¹ß»ýÇÏ´Â Æ®·¡ÇÈÀÌ °øÀ¯±â¿¡ ¿µÇâÀ» ¹ÌÄ¡Áö ¾Ê°Ô ÇØÁÖ´Â °ÍÀÌ ÁÁ½À´Ï´Ù.
¸¸¾à ¼¹ö1¿¡¼ ¹ÞÀº Æ®·¡ÇÈÀ» 2·Î ³Ñ°Ü¾ß ÇÑ´Ù¸é 2¹ø ¼¹öÀÇ °ÔÀÌÆ®¿þÀÌ ÁÖ¼Ò´Â 1¹ø¼¹ö ¾ÆÀÌÇÇ·Î ³Ö¾îÁà¾ß °¡´ÉÇÕ´Ï´Ù. ¸®´ª½º´Â À߸ð¸£Áö¸¸ À©µµ¿ì´Â Àú·¸°Ô ÇؾßÇÏ°ÚÁÒ.
¸ðµç Á¢¼ÓÀ» ¼¹ö1À» °æÀ¯Çؼ ¼¹ö2·Î °¡°Ô ÇÒ·Á´Â ¸ñÀûÀ̶ó¸é ¹°¸®ÀûÀÎ ±¸¼ºÀ» ¹Ù²Ù´Â°Ô ÁÁ½À´Ï´Ù.
°øÀ¯±â¿¡´Â ¼¹ö1¸¸ ¹°¸®°í, ¼¹ö1¿¡ NIC(eth1) Ãß°¡Çؼ ¼¹ö1(eth1)---¼¹ö2(eth0)À¸·Î ¹Ù·Î ¼±À» ¿¬°áÇØÁÖ¸é ÁÁ°ÚÁÒ
/¹Ú»óÁØ´Ô
zio °øÀ¯±â »ç¿ëÇÕ´Ï´Ù. ZIO INB5140SR
/±èÀ±¼ú´Ô
DMZ ÇØÁ¦Çß½À´Ï´Ù.
±×·¡µµ ÀüÇô ¾ÈµË´Ï´Ù....
/±èÇöÈ£´Ô
ù¹ø° ´ñ±Û¿¡ ´ëÇؼ±..
¾ÖÃÊ¿¡ ftp´Â active¸ðµå ¼³Á¤À¸·Î Ç؇J½À´Ï´Ù.
vsftpd¸¦ »ç¿ëÇϴµ¥ passive¼³Á¤À¸·Î..»ç¿ë ÆнúêÆ÷Æ®´Â 5000~5005 ÀÌ·¸°Ô ±¸¼ºÇؼ iptables¿¡ filter ACCEPTÇسöµµ ÀüÇô ¾ÈµÇ´õ±º¿ä...±×·¡¼ active
µÎ¹ø° ´ñ±Û¿¡ ´ëÇؼ±...
¸»¾¸ÇϽŴë·Î ±×·¸°Ô ÇÏ¸é ½±°Ô ±¸¼ºÀÌ µÇ´Âµ¥ ¼¹ö1(eth1)¿¡ ¿¬°áµÇ´Â ÄÄÅÍ°¡ 1´ë¶ó´Â °¡Á¤(Á÷Á¢ ¿¬°á)¿¡¼¸¸ Åë¿ëµÉ °Í °°³×¿ä.
¼¹ö1ÀÇ eth1À» ½ºÀ§Ä¡¿¡ ¿¬°áÇؼ ±× ¹Ø¿¡ ¼¹ö2/ ¼¹ö3/ ¼¹ö4. . . .ÀÌ·±½ÄÀ¸·Î Æ÷Æ®Æ÷¿öµùÇÑ´Ù¸é ¾ÈµÉ °Í °°³×¿ä.
°øÀ¯±âÀÇ DMZ ÇØÁ¦ÇÑ »óÅ¿¡¼µµ ¾ÈµÇ´Â °É·Î º¸¾Æ ¸»ÀÔ´Ï´Ù..
¾Æ..°è¼Ó °ü·Ã À¥¹®¼/ ¸Å´º¾óµé µÚÁ®º¸°í »ðÁúÇغ¸°ï Àִµ¥..
µµÅë ÇØ°áµÉ ±â»öÀÌ ¾Èº¸À̳׿ä..
Âü,
»ç½Ç ¿¹¸¦ ftp·Î µé¾ú´ø °Çµ¥, ftpÀÏ °æ¿ì´Â Æ÷Æ®¸¦ 2°³ ¾²´Ï..Á» º¹ÀâÇØÁú ¼ö µµÀְٳ׿ä.
ÀÌ ÀÌÈÄ¿¡µµ ´äº¯ ´Þ¾ÆÁÖ½Ç ºÐÀÌ °è½Ã¸é..
ftp°¡ ¾Æ´Ñ ssh¶ó°í °¡Á¤ÇØÁÖ½Ã°í ´Þ¾ÆÁÖ¼ÌÀ¸¸é ÁÁ°Ú½À´Ï´Ù.
±×·³ PREROUTING ÂÊÀÌ 21Æ÷Æ®°¡ ¾Æ´Ñ 22Æ÷Æ®°¡ µÇ°ÙÁÒ
-A PREROUTING -i eth0 -p tcp -m tcp --dport 7000 -j DNAT --to-destination 192.168.0.20:22
±èÀ±¼ú´ÔÀÇ ¸»¾¸Ã³·³ DMZ ÇØÁ¦ÇÏ°í, Æ÷Æ®Æ÷¿öµù ÇØÁÖ¸é µÅ¾ßÇÒµí Çѵ¥¿ä.
±èÇöÈ£´Ô ¸»¾¸Ã³·³ ·£Ä«µå Çϳª ´õ ´Þ¾Æ¼ Æ÷¿öµùÇØÁִ°͵µ ±¦ÂúÀ»µíÇϱ¸¿ä.