Thread: How can I get the ip address of http server's external interface?

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    7

    How can I get the ip address of http server's external interface?

    Hi,

    I have a webserver (a router, to be precise, that can be accessed from internal severs, using its internal ip address). The router has an adsl modem connected to it, so it has two interfaces, adsl modem to the internet, and several ports to the internal clients/servers.

    Now, I would like one of the internal server to get the ip address of the router's exterenal interface. Are there any c APIs/utilities that can be used to get the external ip address of the router, using the http connection to it through its internal address.

    I am using Linux, any pointers would be highly appreciated.

    My apology in advance, if this has gone bit OT from C.

    Damar

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    7

    How to get the remote-host ip address?

    Hi,

    Further to my earlier posting titled 'How can I get the ip address of http server's external interface?', I would like to add one more.

    Is there any thing like REMOTE_ADDR variable of perl in c?

    Thanks again.

    Damar

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Don't know if this would work for you, but can you do it through DNS call like gethostbyname() ?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux raw socket programming
    By cnb in forum Networking/Device Communication
    Replies: 17
    Last Post: 11-08-2010, 08:56 AM
  2. IP address configuration Files?
    By Matus in forum Tech Board
    Replies: 3
    Last Post: 01-29-2009, 04:35 PM
  3. Im so lost at . .
    By hermit in forum C Programming
    Replies: 18
    Last Post: 05-15-2002, 01:26 AM
  4. MSN Vital Information
    By iain in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 09-22-2001, 08:55 PM