공인IP로 웹서버구성시 내부 사설IP로 접속하는법.???

hijaeking의 이미지

내부에서 NAT를 사용해서 인터넷을 쓰고 있고 공인IP하나를 부여 받아서 웹과 e-mail서버를 돌리고 있습니다.(unix)

서버는 내부 ip를 가지고 있고 NAT를 사용하는 장비에 공인IP가 부여 되 있고 이 장비가 사설IP를 사용하는 서버를 연결해 주는 방식입니다.

내부에서 웹서버에 접속할때 한번 밖으로 나갔다가 다시 내부로 돌아 오는 방식입니다. 그런데 어차피 서버는 내부 사설 IP를 사용하고 있기 때문에 내부에서 웹으로 접속시 외부로 나가지 않고 바로 접속할 수 있는 방법이 있을 것 같은데요....

그러면 조금 빠르지 않을까요??

정태영의 이미지

내부용 dns 를 돌리거나 hosts 파일을 수정해주면 되지 않을까요?

(윈도우에서도 hosts 파일은 있습니다... unix 계열에서와 포멧도 동일하구요 )

오랫동안 꿈을 그리는 사람은 그 꿈을 닮아간다...

http://mytears.org ~(~_~)~
나 한줄기 바람처럼..

kuaaan의 이미지

만약 관리하시는 PC에만 한정된 얘기라면...
방법 1. url로 접속하지 말고 사설IP로 접속한다.
방법 2. 사용하시는 PC의 hosts파일에 사설IP를 박은 뒤 url로 접속한다. (1번과 마찬가지 얘기)
만약 내부망 사용자가 여러명이라면...
방법 3. 네트워크 장비에서 static routing을 잡아준다.
방법 4. 내부 전용 DNS가 있다면... 이 DNS에서 사설IP로 잡아준다.
등등등...

결국 그얘기가 그얘기죠 모... :D

----------------------------------------------
한번뿐인 인생....
미친듯이 살아보자!
----------------------------------------------

wfellow의 이미지

한가지가 더 있습니다. DNAT을 지원한다면 서비스 네트웍으로 웹서버를 옮기신 후, 서비스 네트웍을 가지고 있는 공유기의 내부망에서 접속하는 인터페이스에 DNAT을 걸어 주는 것이지요. 그럼 내부망에서 오는 패킷의 목적지가 웹서버의 공인일 경우에는 서비스 네트웍의 웹서버로 포워딩 됩니다.

-----[꼬릿말 절취선 시작]-----
삽질전에 먼저 구글신께 기도하자.
-----[꼬릿말 절취선 끝]-----

사랑천사의 이미지

그 면에서 속도 차이는 없습니다. 단지 게이트웨이로 쓰일 뿐이죠 라우트를 해 주는 NAT장비의 경우.
아래 결과를 보세요.
-- Windows쪽 정보 --

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>
E:\Documents and Settings\사랑천사>tracert l1004net.pe.kr

Tracing route to l1004net.pe.kr [211.216.25.131]
over a maximum of 30 hops:

  1     1 ms    <1 ms     1 ms  211.216.25.131

Trace complete.

E:\Documents and Settings\사랑천사>ipconfig

Windows IP Configuration


Ethernet adapter VMware Network Adapter VMnet8:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.233.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet1:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.142.1
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . :

Ethernet adapter 로컬 영역 연결:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 192.168.1.2
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.254

E:\Documents and Settings\사랑천사>

-- 리눅스 섭버쪽 상황 --
root@lanet:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0B:6A:6D:45:00
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20b:6aff:fe6d:4500/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9169961 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10658304 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2824528807 (2.6 GiB)  TX bytes:1381012579 (1.2 GiB)
          Interrupt:169 Base address:0xdc00

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6194 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6194 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:707648 (691.0 KiB)  TX bytes:707648 (691.0 KiB)

root@lanet:~# 

음... 결론적으로 trace되는 과정에서 거치는 것은 192.168.1.254(저의 경우 라우터/게이트웨이)을 거쳐 바로 데이터가 나라온다는 것입니다. 이전에 리눅스 머신으로 NAT를 구성 했을 때도 이와 같았습니다. 결론적으로, 밖으로 나가는 것 같으면서도 알아서 내부 처리 해 준다는 말씀... 제가 텔넷에서 l1004net.pe.kr(이야기 멀티 씀)로 접속(옆의 서버)하면 로컬에서 데이터 전송 하는것과 같은 속도가 나옵니다.
192.168.1.1로 접속 하나 l1004net.pe.kr로 접속 하나 같다는 이야기 입니다. 위의 tracert로 보셔서 아시겠지만, l1004net.pe.kr에 지정된 IP 주소는 공인된 IP입니다.(물론 유동)

음.. 뭐 그리 걱정 하실것은 없겠네요 속도 면에서.. 담, DNS쿼리 시간이 많이 걸린다 싶으시면 위의 분들 말씀처럼 해 보세요.

행복하세요 모두.
이여송 사도요한 드림.

사람천사

댓글 달기

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