iptables OUTPUT에 대해서..

bss20213의 이미지

iptables에서 -A 옵션뒤에 OUTPUT에대해 언제써야할지 궁금합니다.

INPUT은 들어오는패킷을조사하고 OUTPUT은 나가는패킷을 조사하는것으로알구있습니다

근데 요기서헷갈리는게 iptables -A INPUT -p icmp -d 192.168.1.2 -j DROP

이렇게하면 pc1(192.168.1.1)에서 ping 192.168.1.2를 하면 핑이가질않고 pc2(192.168.1.2)에서도 ping 192.168.1.1을하면 역시핑이 가

질않습니다

아직 개념이 잘잡히지않은거같거든요.. 쉽게 설명좀해주세요

bss20213의 이미지

OUTPUT으로 설정했을때도 양쪽에서 핑이안가네요~~

한쪽만 핑이가는설정은 없을까요?..

김정균의 이미지

iptables -A OUTPUT -p tcp -m state --state NEW -j DROP

외와 같이 룰을 만들면 reverse connection 에 대한 관리가 가능하겠죠. 예를 들면 reverse connection 을 시도하는 포트가 대부분 80또는 22번과 같이 방화벽에서 막지 못하는 well known port 를 이용하는데, 서버에서 위와 같이 막는다면 외부로의 reverse connection 을 방지할 수 있고, worn 에 의해서 숙주가 되는 것을 방지할 수 있습니다.

물론 위의 룰을 그냥 사용한다면 상당히 불편하겠죠. 나름대로의 ACL 관리를 해 주셔야 합니다. ^^; 위의 룰은 OUTPUT 제어에 대한 명확한 예로 든 것 뿐입니다. (너무 명확한 룰이라서 문제일 수 있습니다.)

검객의 이미지

ping은 서로간에 통신이 되어야 이루어 짐니다.
즉 패킷이 나가기도하고 들어오기도 해야 합니다.

INPUT으로하면 들어오는 패킷이 차단되므로 ping이 안되는 거고
OUTPUT으로하면 나가는 패킷이 차단되므로 ping이 안되는 겁니다.

궁금하시면
INPUT, OUTPUT 각각 설정해 보고

nmap으로 패킷을 캡쳐해 보세요
아니면 로그를 추가해서 보셔도 룰이 적용되는걸 확인이 가능할 겁니다.

우리 항시 웃고 살아요 ^^

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.