Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:40:22+00:00 2026-05-31T22:40:22+00:00

I have a server coded in C. After the accept() , I want to

  • 0

I have a server coded in C. After the accept(), I want to get the IP address from the sockaddr.
But the IP address I get is the one from the VM I’m on : 10.0.x.x, not the internet IP. The VM is hosted on a computer that has a real IP, which is the one I would like to get.

The port forwarding has been done.
Example : I have 2 computers running the same VM, so they have the same VM local IP (10.0.x.x). The first VM launches the server, the second uses telnet to connect using the real server’s IP (147.x.x.x). The connection is established correctly, but the IP I get in the sockaddr is the VM one.

Do you know how to resolve it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:40:24+00:00Added an answer on May 31, 2026 at 10:40 pm

    You’ll need a “third party” outside, e.g. a (web) server that will just return/print the remote IP of the active connection. That way you’re able to get your “internet ip” when behind a local NAT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my php coded page on one server that returns a json result.
I have to implement an HTTP server for a class in C++, but after
I have extended a server control (not a user control) and put the code
I have a WCF web service that works perfectly with an http address, but
I have two simple programmes, server and client, both at localhost. What I want
I have a windows service act as a server. And I run one windows
I have a Groovy server and Flex client. When i try to connect from
I have developed a screen in swings to download a file from the server.
I have declared an enum in my server code, and would like my client
If I have pages having server-side code in code-behind, then I know that the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.