iptables 정책설정 우선순위 관련 질문요!

imjh2368의 이미지

리눅스 공부한지 얼마안된 초보입니다ㅠㅠ
iptables 정책관련해서 질문하나만 할께요!

Q. 내부서버에서 방화벽으로 ssh 접속이 가능하도록 설정하며, ssh 허용했을 때 로그를 "ssh_accept"로 설정하시오.

이런 문제였는데요.(기억이 잘 안나서 정확하진 않은듯요;;)

$IPTABLES -A INPUT -s $INT_NET -p tcp --dport 22 -j ACCEPT
$PTABLES -A INPUT -s $INT_NET -p tcp --dport 22 -j LOG --log-prefix "ssh_accept "

이렇게 설정했는데, 안되네요;;
그래서

$PTABLES -A INPUT -s $INT_NET -p tcp --dport 22 -j LOG --log-prefix "ssh_accept "
$IPTABLES -A INPUT -s $INT_NET -p tcp --dport 22 -j ACCEPT

이렇게 자리를 바꿔봤는데 되네요;;;

일단 22번 포트의 tcp를 허용하고(ssh) 로그를 받는거 아닌가요??
왜 로그 허용이 먼저와야되죠??

shint의 이미지

저라면...
GUI로 된 리눅스 방화벽'에 포트만 적어줄텐데 말입니다. ㅇ_ㅇ;;;

아니면. 보안 프로그램이나 공유기에서 설정을 하던가요...

----------------------------------------------------------------------------
젊음'은 모든것을 가능하게 만든다.

매일 1억명이 사용하는 프로그램을 함께 만들어보고 싶습니다.
정규 근로 시간을 지키는. 야근 없는 회사와 거래합니다.

각 분야별. 좋은 책'이나 사이트' 블로그' 링크 소개 받습니다. shintx@naver.com

imjh2368의 이미지

학교에서 iptables를 공부하고 있어서 iptables로 정책설정하는 연습하려고 했습니다ㅎㅎ
GUI환경에서 하니깐 편하고 좋네요ㅎㅎ

익명 사용자의 이미지

$ man iptable-extensions
...
 LOG (IPv4-specific)
       Turn on kernel logging of matching packets.  When this option is set for a rule, the Linux kernel will print some information  on  all
       matching packets (like most IP header fields) via the kernel log (where it can be read with dmesg or syslogd(8)).  This is a "non-ter-
       minating target", i.e. rule traversal continues at the next rule.  So if you want to LOG the packets  you  refuse,  use  two  separate
       rules with the same matching criteria, first using target LOG then DROP (or REJECT).
...

맨페이지에는 DROP, REJECT에 대해서 말하고 있지만, ACCEPT도 해당되는 사항인 듯합니다.
imjh2368의 이미지

맨페이지 확인할 생각을 못했네요...
이게자꾸 머릿속에 맴돌아서 다른것도 못하고있었는데ㅜㅜ
정말 감사합니다~~

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.