모든 포트포워딩은 == DMZ ? (DMZ 구현 문제)

hjsong2234의 이미지

현재 이더넷 카드 두개로 DMZ(모든 포트 몰아주기)를 구성하려고 합니다.

all 포트 포워딩은 = DMZ 가 맞는 논리 인지요? 일단 찾아본대로 iptables setting 하다보니 몇가지 문제점이 생기더라구요.

여튼 궁국적으로 이루고자 하는 목표는 pc1의 eth1로 들어온 모든 데이타(포트)를 eth2로 전달해서 pc2의 eth1에서 서버프로그램을 돌릴수 있게 하는 것입니다.

<---> 랜선 연결 표시 ===== =====pc1================== =====pc2============== =wan= <---> = eth1 : 192.168.147.164 = = = ===== = eth2 : 192.168.1.1 = <----> = eth1 : 192.168.1.2 = ========================== ======================

pc2에서 ftp 등등 서버 프로그램 구동시 client 들이 pc1의 eth1 : 192.168.147.164로 원할하게 접속 되고 pc2가 인터넷도 가능한 상태 구현이 최종 목표

현재 iptable 설정 상태 (pc 두대다 인터넷이 원할하게 가능하고 pc2에서 ftp 프로그램 돌릴 경우 외부에서 192.168.147.164로 접속시 원할하게 잘 동작합니다.

아래처럼 1개의 포트만 포워딩 되는 것이 아니라 모든 포트가 한꺼번에 포워딩 되도록 하고 싶습니다. 내공이 부족해서 쉽지 않네요.

pc1의 iptable 셋팅 상태 입니다.
iptables -A FORWARD -o eth1 -j ACCEPT
iptables -A FORWARD -o eth2 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to 192.168.1.2:21

고수님들의 답변 기다리겠습니다. 감사합니다.

hjsong2234의 이미지

진짜 간단한거 였는데.. 질문 올리기 전에 좀만더 해볼걸 그랬네요. 그래도 비슷한 문제를 격으시는 분이 있을까 해서 자체 답변 달아 둡니다.

정답은 아래와 같습니다. 질문 올린 그림이 그리고 다 깨졌네요. 바보 같이 ...

<---> 랜선 연결 표시 ===== =====pc1================== =====pc2============== =wan= <---> = eth1 : 192.168.147.164 = = = ===== = eth2 : 192.168.1.1 = <----> = eth1 : 192.168.1.2 = ========================== ======================

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.147.164 --dport 1:65535 -j DNAT --to-dest 192.168.1.2

댓글 달기

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