>> Read No. 49852 article  
매스쿼레이딩과 포트포워딩 질문입니다.

등록 2002-05-27 18:04:00     조회 1
이름 Julian    

		Linux를 설치하고 두개의 랜카드를 달아서
하나는 공인IP를 설정하고, 다른 하나는 10.10.11.7이라는
IP를 설정했습니다.
리눅스서버에 매스쿼레이딩을 설정하구..
포트포워딩을 통해 내부의 또다른 컴에 win2000을 설치해서
웹서비를 이용하려고 합니다.
공인IP하나를 받아서 사용하는건 아니고 C Class의 IP가 있는데..
NAT라고 하는게 맞나요?? 그걸 이요해 보려고 하는 중입니다..
아래는rc.local 파일 내용입니다.
#!/bin/sh
#
  if [ -f /etc/wow-release ]; then
    R=$(cat /etc/redhat-release)
     arch=$(uname -m)
    a="a"
    case "_$arch" in
            _a*) a="an";;
            _i*) a="an";;
    esac
     NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
    if [ "$NUMPROC" -gt "1" ]; then
        SMP="$NUMPROC-processor "
        if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
            a="an"
        else
            a="a"
        fi
    fi
     echo "" > /etc/issue
    echo "$R" >> /etc/issue
    echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue
     # This will make issue.net in a more secure way
    echo "" > /etc/issue.net
    echo "$R" >> /etc/issue.net
fi
 # keyboard speed setting
KBD_BIN=/sbin/kbdrate
if [ -f $KBD_BIN ]; then
   $KBD_BIN -s -r 30.0 -d 250
fi
 if [ -f /etc/rc.d/rc.local.mine ]; then
    . /etc/rc.d/rc.local.mine
fi
  #rc.firewall script - Start IPMASQ and the firewall
/etc/rc.d/rc.firewall
 아래는 rc.firewall 파일입니다.
#!/bin/sh
 #
 # rc.firewall - Initial SIMPLE IP Masquerade test for 2.1.x and 2.2.x kernels us
ing IPCHAINS
 #
 # Load all required IP MASQ modules
 #
 #   NOTE:  Only load the IP MASQ modules you need.  All current IP MASQ modules
 #          are shown below but are commented out from loading.
   # Needed to initially load modules
 #
 /sbin/depmod -a
   # Supports the proper masquerading of FTP file transfers using the PORT method
 #
 /sbin/modprobe ip_masq_ftp
   # Supports the masquerading of RealAudio over UDP.  Without this module,
 #       RealAudio WILL function but in TCP mode.  This can cause a reduction
 #       in sound quality
 #
 #/sbin/modprobe ip_masq_raudio
   # Supports the masquerading of IRC DCC file transfers
 #
 #/sbin/modprobe ip_masq_irc
  # Supports the masquerading of Quake and QuakeWorld by default.  This modules is
 #   for for multiple users behind the Linux MASQ server.  If you are going to pl
ay
 #   Quake I, II, and III, use the second example.
 #
 #Quake I / QuakeWorld (ports 26000 and 27000)
 #/sbin/modprobe ip_masq_quake
 #
 #Quake I/II/III / QuakeWorld (ports 26000, 27000, 27910, 27960)
 #/sbin/modprobe ip_masq_quake ports=26000,27000,27910,27960
     # Supports the masquerading of the CuSeeme video conferencing software
 #
 #/sbin/modprobe ip_masq_cuseeme
   #Supports the masquerading of the VDO-live video conferencing software
 #
 #/sbin/modprobe ip_masq_vdolive
     #CRITICAL:  Enable IP forwarding since it is disabled by default since
 #
 #           Redhat Users:  you may try changing the options in /etc/sysconfig/ne
twork from:
 #
#
 #                       FORWARD_IPV4=false
 #                             to
 #                       FORWARD_IPV4=true
 #
 echo "1" > /proc/sys/net/ipv4/ip_forward
     # Dynamic IP users:
 #
 #   If you get your IP address dynamically from SLIP, PPP, or DHCP, enable this
following
 #       option.  This enables dynamic-ip address hacking in IP MASQ, making the
life
 #       with Diald and similar programs much easier.
 #
 #echo "1" > /proc/sys/net/ipv4/ip_dynaddr
     # MASQ timeouts
 #
 #   2 hrs timeout for TCP session timeouts
 #  10 sec timeout for traffic after the TCP/IP "FIN" packet is received
 #  160 sec timeout for UDP traffic (Important for MASQ'ed ICQ users)
 #
 /sbin/ipchains -M -S 7200 10 160
    # DHCP:  For people who receive their external IP address from either DHCP or BO
OTP
 #        such as ADSL or Cablemodem users, it is necessary to use the following
 #        before the deny command.  The "bootp_client_net_if_name" should be repl
aced
 #        the name of the link that the DHCP/BOOTP server will put an address on
to?
 #        This will be something like "eth0", "eth1", etc.
 #
 #        This example is currently commented out.
 #
 #
 #/sbin/ipchains -A input -j ACCEPT -i bootp_clients_net_if_name -s 0/0 67 -d 0/0
 68 -p udp
   # Enable simple IP forwarding and Masquerading
 #
 #  NOTE:  The following is an example for an internal LAN address in the 192.168
.0.x
 #         network with a 255.255.255.0 or a "24" bit subnet mask.
 #
 #         Please change this network number and subnet mask to match your intern
al LAN setup
 #
 #/sbin/ipchains -P forward DENY
 /sbin/ipchains -A forward -s 10.10.11.0/24 -j MASQ
 #/sbin/ipchains -A forward -i eth1 -d 10.10.11.0/24
 #/sbin/ipchains -A forward -j MASQ -i eth0 -s 10.10.11.0/24 -d 0.0.0.0/0
 #echo "Enabling IPPORTFW Redirection on the external LAN.."
#
#/usr/sbin/ipmasqadm portfw -f
  /usr/sbin/ipmasqadm portfw -a -P tcp -L 21*.20*.4*.78 80 -R 10.10.11.78 80
 위와 같이 두개의 파일을 설정했습니다.
내부 컴에서 외부로의 접속이나 인터넷연결엔 아무문제가 없습니다.
문제는 포트포워딩을 한 부분이 되질 않습니다.
아래내용은 ifconfig -a의 결과입니다.
 eth0      Link encap:Ethernet  HWaddr 00:A0:C9:A3:6C:71
          inet addr:21*.20*.4*.11  Bcast:211.202.42.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8649 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4916 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          Interrupt:11 Base address:0xfcc0
 eth1      Link encap:Ethernet  HWaddr 00:A0:C9:D9:23:D2
          inet addr:10.10.11.1  Bcast:10.10.11.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2358 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          Interrupt:9 Base address:0xfce0
 lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.255.255.0
          UP LOOPBACK RUNNING  MTU:3924  Metric:1
          RX packets:26 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
 아래는 netstat -rn의 결과입니다.
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
21*.20*.4*.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.255.255.0   U         0 0          0 lo
10.10.11.0      0.0.0.0         255.255.255.0   U         0 0          0 eth1
0.0.0.0         21*.20*.4*.1    0.0.0.0         UG        0 0          0 eth0
0.0.0.0         21*.20*.4*.1    0.0.0.0         UG        0 0          0 eth0
0.0.0.0         21*.20*.4*.1    0.0.0.0         UG        0 0          0 eth0
 아래는 ipchains -L의 결과입니다.
Chain input (policy ACCEPT):
Chain forward (policy ACCEPT):
target     prot opt     source                destination           ports
MASQ       all  ------  10.10.11.0/24        anywhere              n/a
Chain output (policy ACCEPT):
 아래는 /usr/sbin/ipmasqadm portfw -l의 결과입니다.
prot localaddr            rediraddr               lport    rport  pcnt  pref
TCP  21*.20*.4*.78           10.10.11.78               www      www    10    10
 리눅스가 셋팅되어 있는 컴의 eth0에 포워딩을 사용할 내부컴의
공인IP(웹서비스를 이용할)를 가상으로 잡아줘야 된다고 해서 eth0:0를
설정하고 21*.20*.4*.78의 IP를 잡아서 해봤는데도 되지 않습니다.
이유를 아시는분 설명 부탁드립니다.
지난 토요일부터 잠도 제대로 못 자고 하고 있는데 도무지 뭐가 문제인지
아직 초보수준이라 잘 모르겠습니다.
답변 부탁드립니다.
이름
암호


>> 관련글
49852 매스쿼레이딩과 포트포워딩 질문입니다.  Julian  2002.05.27  ....
  답장 RE: 매스쿼레이딩과 포트포워딩 질문입니다.  야야  2002.05.27  ....
Register [ localhost 목록보기 윗글 아랫글
글쓰기
답장쓰기 수정 삭제
정규표현식 [ 상세 검색 ]
페이지로딩: [ 0.86 초 ] 작업시간: [ 0.25 초 ]

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved
[TOP]

적수네 동네
+
| 적수네 동네
| 공부방
| 리눅스 잡지 서고
| LSN 소스
| 링크 모음
+---+
게시판
+
| 떠들어보세!
| 질문과 답변
| 새소식과 정보
| 1원짜리 팁?
| 대화방
+---+
칼럼?
+
| 세하 훔쳐보기
| Welcome2nite
| 혜진의 염장판
+---+
리눅스 상표권
+
| 반대 서명란
| 토론 게시판
+---+
GNU
+
| GNU 선언문
| GNU GPL
| GNU 미러 목록
+---+
프로젝트?
+
| 리눅스카운터
| RC5DES
| 실질헌법 제작
+---+
커널 소식
+
| 안정 버젼: 2.4.14
+---+
테마 선택
+
LSN 방송국?
+
| OFF AIR
+---+
회원
+
| 로그인
+---+
[ 적수네 동네 ] [ 리눅스 상표권 독점 반대 ] [ 한글 리눅스 문서 프로젝트 ] [ KrLine ] [ 사랑넷 ] [ Valid HTML 4.0! ] [ SlashDot ] [ Freshmeat ]
Copyleft (C) 1998-2001 Byeong-Chan Kim . License
TIME: 1791489928
System by WYZsoft, HDD by I.O.Linux, Mizi Research, Embryo, WOWLINUX, Domain by SarangNet, Network by KrLine.