애매해서 죄송)) 다시 network 프로그램관련 질문합니다.

익명 사용자의 이미지

두 대의 컴퓨터에서 서로 통신이 가능하게 socket프로그램을 하려고 합
니다. 그각각의 두대에는 Lan card가 두개씩 꼽혀있어서 하나는 인터넷이
되고 나머지는 cable로 연결이 되어 있습니다.

그런데 궁금한것은 socket프로그래밍을 하기 전에 IP setting이나
gateway설정등도 연관이 있나하는겁니다.
저는 지금 한대는 201.100.200.20 , 나머지 하나는 201.100.200.50
으로 임의로 설정하였고, 다른것은 건드린게 없거든요.
그리고 ping은 또 되더라구요..

제가 해도 좀 에매한것 같네요..
이런 상태에서 소켓프로그램을 시작하면 되는것인가요??
답변주시면 감사하겠네요.

익명 사용자의 이미지


망 구성도를 간략한 그림이라도 그려주셔야 이해가 갈 것 같군요.
더불어 각 lan card에 할당된 네트워크 환경도 써주셔야
대답이 가능할 것 같군요....

그럼..

익명 사용자의 이미지

네트웍 환경이 제대로 갖추어지지 않은 상태인거 같군요.
그럼에도 네트웍 프로그래밍을 하기 위한 것이라면
굳이 2대를 쓸 필요까지 없습니다.
1대만으로도 서버, 클라이언트 같이 돌려가며
데이터 주고 받을 수 있으니까요.

목적지 주소를 127.0.0.1로 하시면 되겠습니다.

익명 사용자의 이미지

질문 다시 정정하겠습니다.

두대의 컴퓨터를 Lan cable만을 이용해 통신하는 socket프로그램을 만들고
자 합니다. 프로그램을 만들기전 환경설정(IP, gateway등등) 은 어떻게
되어야 하는건지요..
두대의 컴은 Lan card가 2개씩 있고, 하나는 ADSL을 이용해서 Internet이
가능한 상태이고요, 나머지 Lan card로 프로그램을 해서 통신하고자 합니
다.

익명 사용자의 이미지

허브를 써서 연결하거나
adsl/cable modem-nic1-pc1-nic2-크로스케이블-nic3-pc3

nic2와 nic3은 private address로 지정합니다.
예를 들어 class c 에서 nic2는 192.168.1.2 nic3은 192.168.1.3
netmask 255.255.255.0, gateway는 필요 없음

익명 사용자의 이미지

프로그램과는 관계가 많이 떨어지는 질문이네요...

+-------------+
| ADSL MODEM |
+-------------+
|
|
+-------------+ lan 1 --> 외부 ip ex(211.xxx.xxx.xxx)
| PC 1 | ipfowerd nat or iptable(ipchains)....
+-------------+ lan 2 --> 내부 ip(192.168.1.1)
|
|
+-------------+
| HUB |
+-------------+
|
|
+-------------+ lan 1 --> 내부 ip(192.168.1.2) GW(192.168.1.1)
| PC2(pc들) |
+-------------+

이렇게 하면 pc2도 인터넷이 가능하고 pc2가 pc1에 접속도 가능하지요.

댓글 달기

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