IP masquerading 질문입니다 -_-

urmajest의 이미지

IP masquerading 질문하는 건 참 싫었는데 -_- 안되니 할 수 없군요

초보에게 도움을 주시면 감사하겠습니다 ^^

리눅스는 젠투(버젼은 기억나지 않는데 최신이군요 -_-)입니다.

필요한 모듈은 insmod로 잘 올려진 것 같네요

Module                  Size  Used by    Not tainted
ipt_MASQUERADE          1496   1  (autoclean)
iptable_filter          1740   1  (autoclean)
ip_nat_ftp              3408   0  (unused)
iptable_nat            18520   2  [ipt_MASQUERADE ip_nat_ftp]
ip_conntrack_ftp        4432   1 
ip_conntrack           22528   2  [ipt_MASQUERADE ip_nat_ftp iptable_nat ip_conntrack_ftp]
ip_tables              12768   5  [ipt_MASQUERADE iptable_filter iptable_nat]

구성은 아래와 같습니다

       linux                             windows
eth0:192.168.0.1
eth1:192.168.1.1 <-------> 192.168.1.2
ppp0:adsl

linux에서 인터넷 잘 되구요, 윈도에서 eth0,1 ppp0 로 핑 잘 나가네요
역으로도 잘 되구요

윈도우로 멀티부팅 했을 때나, 예전에 래드햇 사용했을 때에는

잘 되었던 구성이라, 구성에는 문제가 없는 듯해요

그런데 역시나 클라이언트(192.168.1.2) 쪽에서 외부로 핑이 안 되네요

왜그럴까요? -_-

아래는 iptables -t nat -L 했을 때의 화면입니다

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  anywhere             anywhere           

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

아래는 iptables -L 했을 때의 화면입니다

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

아래는 netstat -rn입니다 -_-

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
211.216.20.1    0.0.0.0         255.255.255.255 UH       40 0          0 ppp0
192.168.1.0     0.0.0.0         255.255.255.0   U        40 0          0 eth1
192.168.0.0     0.0.0.0         255.255.255.0   U        40 0          0 eth0
0.0.0.0         211.216.20.1    0.0.0.0         UG       40 0          0 ppp0

/sbin/depmod -a
/sbin/insmod ip_tables
/sbin/insmod ip_conntrack
/sbin/insmod ip_conntrack_ftp
/sbin/insmod iptable_nat
/sbin/insmod ip_nat_ftp

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
처음엔 위처럼 설정해줬는데 안 되길래

iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD ACCEPT
iptables -F FORWARD

를 붙였는데 그래도 안 되네요 -_-

도와주세요~

Necromancer의 이미지

저같은 경우는 사내망에서 컴터 2대를 마스커레이딩으로 공유하는데
이렇게 되어 있습니다. (모듈 안쓰고 커널에 몽땅 집어넣음)

잘 돕니다
iptables -L의 INPUT란 끝 2개는 FTP를 위해 열어둔겁니다

[root@robocop root]# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED 
ACCEPT     all  --  anywhere             anywhere           state NEW 
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:ftp-data 
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:ftp 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere           reject-with icmp-port-unreachable 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

[root@robocop root]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
SNAT       all  --  anywhere             anywhere           to:10.2.9.18 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination     

Written By the Black Knight of Destruction

댓글 달기

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