{"id":878,"date":"2018-04-22T14:37:06","date_gmt":"2018-04-22T23:37:06","guid":{"rendered":"\/blog\/?p=878"},"modified":"2023-09-21T09:37:34","modified_gmt":"2023-09-21T00:37:34","slug":"iptables-%ed%85%8c%ec%9d%b4%eb%b8%94-table-filter-table-nat-table-mangle-table","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=878","title":{"rendered":"iptables - \ud14c\uc774\ube14 (table) (Filter table, NAT table, Mangle table)"},"content":{"rendered":"\n<div style=\"\"><span style=\"font-size: 12px;\">\ucd9c\ucc98:&nbsp;http:\/\/marcof.tistory.com\/35<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">@ \ud14c\uc774\ube14(table)<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ubc29\ud654\ubcbd\uc5d0\uc11c \ud2b9\uc815\ud55c \uae30\ub2a5\uc744 \uc81c\uacf5<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- filter, nat, mangle \uc774\ub807\uac8c 3\uac1c\uac00 \uc788\uc73c\uba70, \uac01\uac01\uc740 \ubcc4\ub3c4\uc758 \uae30\ub2a5\uc744 \uac00\uc9c0\uace0 \uc788\uc74c<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">@ Filter table<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ubc29\ud654\ubcbd\uc758 \uac00\uc7a5 \ud575\uc2ec\uc801\uc778 \ud14c\uc774\ube14\ub85c\uc11c \ud2b9\uc815 \ub8f0\uc5d0 \ub530\ub77c \ud328\ud0b7\uc744 \ud544\ud130\ub9c1\ud558\uac70\ub098 \ud5c8\uc6a9\ud558\ub294 \uc5ed\ud560\uc744 \ud568<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- filter \ud14c\uc774\ube14\uc5d0\ub294 \uae30\ubcf8\uc801\uc73c\ub85c 3\uac1c\uc758 chain\uc774 \uc788\uc74c<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">1. INPUT chain<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \uc678\ubd80\uc5d0\uc11c \ubc29\ud654\ubcbd \uc790\uccb4\ub85c \ud5a5\ud558\ub294 \ud328\ud0b7\uc5d0 \ub300\ud55c \ud544\ud130\ub9c1\uc744 \ub2f4\ub2f9<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">2. FORWARD chain<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ubc29\ud654\ubcbd\uc744 \ud1b5\uacfc\ud558\uc5ec \ubc29\ud654\ubcbd\uc774 \ubcf4\ud638\ud558\ub294 \ub2e4\ub978 \uc11c\ubc84\ub4f1\uc73c\ub85c \ud5a5\ud558\ub294 \uacbd\uc6b0<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ub0b4\ubd80\uc758 \ub2e4\ub978 \uc11c\ubc84\uc5d0\uc11c \ubc29\ud654\ubcbd\uc744 \ud1b5\ud574 \uc678\ubd80\ub85c \ub098\uac00\ub294 \ud328\ud0b7\uc5d0 \ub300\ud55c \ud544\ud130\ub9c1\uc744 \ud558\ub294 \uacbd\uc6b0<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">3. OUTPUT chain<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ubc29\ud654\ubcbd \uc790\uccb4\uc5d0\uc11c \uc678\ubd80\ub85c \ub098\uac00\ub294 \ud328\ud0b7\uc5d0 \ub300\ud55c \ud544\ud130\ub9c1\uc744 \ub2f4\ub2f9\ud568<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">ex) \ud55c\ub300\uc758 \ub9ac\ub205\uc2a4\uc11c\ubc84 \uc790\uccb4\ub0b4\uc5d0\uc11c \uc6f9\uc11c\ube44\uc2a4 \ub4f1 \uc77c\ubc18 \uc11c\ube44\uc2a4\uc640 \ud568\uaed8 \ud328\ud0b7 \ud544\ud130\ub9c1\uc744 \uc81c\uacf5\ud558\uace0\uc790 \ud560 \uacbd\uc6b0 FORWARD\ub294 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0, INPUT\uacfc OUTPUT chain\ub9cc \uc0ac\uc6a9, \ub9ac\ub205\uc2a4\ub97c \uc804\uc6a9 \ubc29\ud654\ubcbd \uc7a5\ube44\ub85c \uc124\uc815\ud558\uc5ec \ubcf4\ud638 \ud558\uace0\uc790 \ud558\ub294 \uc11c\ubc84\uc758 \uc55e\ub2e8\uc5d0 \uc124\uce58\ud560 \uacbd\uc6b0\uc5d0\ub294<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">FORWARD chain\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub0b4\ubd80\uc758 \uc11c\ubc84\ub4e4\uc5d0 \ub300\ud55c \ud328\ud0b7 \ud544\ud130\ub9c1 \uc815\ucc45\uc744 \uc124\uc815<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">@ NAT table<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ud328\ud0b7\uc744 \ud544\ud130\ub9c1\ud558\ub294 \uae30\ub2a5\uc740 \uc5c6\uc74c<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ubc29\ud654\ubcbd\uc73c\ub85c \ud5a5\ud558\ub294 \ud328\ud0b7\uc744 \ubc29\ud654\ubcbd\uc774 \ubcf4\ud638\ud558\ub294 \ub0b4\ubd80 \ub124\ud2b8\uc6cc\ud06c\uc758 \ub2e4\ub978 \uc8fc\uc18c\ub85c \ud3ec\uc6cc\ub529<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ubc29\ud654\ubcbd \ub0b4\ubd80 \ub124\ud2b8\uc6cc\ud06c\uc5d0\uc11c \ubc29\ud654\ubcbd\uc744 \ud1b5\ud574 \uc678\ubd80 \ub124\ud2b8\uc6cc\ud06c\ub85c \ub098\uac08 \ub54c \ub2e4\ub978 ip\uc8fc\uc18c\ub85c \ubcc0\ud658\ud558\ub294 \uc5ed\ud560\uc744 \ud568<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">1. POSTROUTING chain<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- Source NAT (SNAT) \ud0c0\uac9f\uacfc \ub9e4\uce6d\ub418\uc5b4 \ub0b4\ubd80 \ub124\ud2b8\uc6cc\ud06c\uc5d0\uc11c \ubc29\ud654\ubcbd\uc744 \ud1b5\ud574 \uc678\ubd80\ub85c \ub098\uac08 \ub584 \uc0ac\uc6a9<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- POSTROUTING\uc740 \uc0ac\ubb34\uc2e4 \ub4f1\uc5d0\uc11c \uc0ac\uc124 ip\ub97c \uc0ac\uc6a9\ud558\uba74\uc11c \ud558\ub098\uc758 \uacf5\uc778 ip\ub85c \uc778\ud130\ub137\uc744 \uacf5\uc720\ud558\uace0\uc790 \ud560\ub54c \uc989, \uacf5\uc720\uae30\uc758 \uc6a9\ub3c4\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc74c<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">2. PREROUTING chain<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- Destination NAT (DNAT) \ud0c0\uac9f\uacfc \ub9e4\uce6d\ub418\uc5b4 \uc8fc\ub85c \uc678\ubd80\uc5d0\uc11c \ubc29\ud654\ubcbd \ub0b4\ubd80 \uc11c\ubc84\ub85c \ud5a5\ud558\ub294 \ud328\ud0b7\uc744 \ubc29\ud654\ubcbd\uc774 \ubcf4\ud638\ud558\ub294 \ub0b4\ubd80 \uc11c\ubc84\ub85c \ud3ec\uc6cc\ub529\ud560 \ub54c \uc0ac\uc6a9<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- PREROUTING\uc740 \uc0ac\uc124 ip\ub85c \uc11c\ubc84\ub97c \uc6b4\uc601\ud558\uba74\uc11c \uc678\ubd80\ub85c \uc11c\ube44\uc2a4\ub97c \ud558\uace0\uc790 \ud560\ub54c \uc0ac\uc6a9<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">@ Mangle \ud14c\uc774\ube14<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \uadf8\ub9ac \uc790\uc8fc \uc0ac\uc6a9\ub418\uc9c0\ub294 \uc54a\uc74c<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ud328\ud0b7\uc758 TTL\uc774\ub098 TOS(type of service : \ud328\ud0b7\uc804\uc1a1\uc758 \uc6b0\uc120\uc21c\uc704)\uac12\uc744 \ubcc0\uacbd\ud558\uac70\ub098 \ub9e4\uce6d\ud560 \ub54c \uc0ac\uc6a9<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">1. PREROUTING chain<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ub77c\uc6b0\ud305 \uacbd\ub85c\uac00 \uacb0\uc815\ub418\uae30 \uc804\uc5d0 \ubc29\ud654\ubcbd\uc73c\ub85c \ub4e4\uc5b4\uc624\ub294 \ud328\ud0b7\uc5d0 \ub300\ud574 \ubcc0\uacbd\ud558\uac70\ub098 \ub9e4\uce6d\uc744 \ud568<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">2. OUTPUT chain<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\">- \ub0b4\ubd80\uc5d0\uc11c \uc0dd\uc131\ub41c \ud328\ud0b7\uc774 \ubc29\ud654\ubcbd\uc744 \ud1b5\ud574 \ub098\uac08 \ub54c \ubcc0\uacbd\ud558\uac70\ub098 \ub9e4\uce6d\ud568<\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><br \/><\/span><\/div><div style=\"font-size: 12px;\"><span style=\"font-size: 12px;\"><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/cms_xe\/img0184.gif\" alt=\"Iptables.gif\" width=\"543\" height=\"760\" editor_component=\"image_link\" \/><br \/><\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\ucd9c\ucc98:&nbsp;http:\/\/marcof.tistory.com\/35 @ \ud14c\uc774\ube14(table) &#8211; \ubc29\ud654\ubcbd\uc5d0\uc11c \ud2b9\uc815\ud55c \uae30\ub2a5\uc744 \uc81c\uacf5 &#8211; filter, nat, mangle \uc774\ub807\uac8c 3\uac1c\uac00 \uc788\uc73c\uba70, \uac01\uac01\uc740 \ubcc4\ub3c4\uc758 \uae30\ub2a5\uc744 \uac00\uc9c0\uace0 \uc788\uc74c @ Filter table &#8211; \ubc29\ud654\ubcbd\uc758 \uac00\uc7a5 \ud575\uc2ec\uc801\uc778 \ud14c\uc774\ube14\ub85c\uc11c \ud2b9\uc815 \ub8f0\uc5d0 \ub530\ub77c \ud328\ud0b7\uc744 \ud544\ud130\ub9c1\ud558\uac70\ub098 \ud5c8\uc6a9\ud558\ub294 \uc5ed\ud560\uc744 \ud568 &#8211; filter \ud14c\uc774\ube14\uc5d0\ub294 \uae30\ubcf8\uc801\uc73c\ub85c 3\uac1c\uc758 chain\uc774 \uc788\uc74c 1. INPUT chain &#8211; \uc678\ubd80\uc5d0\uc11c \ubc29\ud654\ubcbd \uc790\uccb4\ub85c \ud5a5\ud558\ub294 \ud328\ud0b7\uc5d0 \ub300\ud55c \ud544\ud130\ub9c1\uc744 \ub2f4\ub2f9 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[],"class_list":["post-878","post","type-post","status-publish","format-standard","hentry","category-computing_security"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=878"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/878\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}