InetAddress question


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: InetAddress question

Hybrid View

  1. #1
    Wayne Liu Guest

    InetAddress question


    Hello,

    My PC has ethernet card installed and assigned an IP address by myself. It
    also has dial up networking to Earthlink configured as Service assigns IP
    address.

    Now, I have a Java pgm to retrieve the local host IP address by using
    "System.out.println(InetAddress.getLocalHost().getHostAddress());", which
    displays the one I assigned to NIC even I dial up to Earthlink.

    My question is how can I check out the IP address assigned by Earthlink?
    Outside Java and Inside Java.

    thks,
    wayne




  2. #2
    Ghozt Guest

    Re: InetAddress question


    Don't know how to do determine the IP address assigned by Earthlink from within
    Java
    but to determine the IP Address assigned by Earthlink outside java is easy

    I assume you are running on a windows box?

    execute the following command:

    tracert ibm.com

    this will display the servers that your machine goes through to
    access the ibm server.

    the first ip address will either be your nic or the one
    assigned by earthlink. If it is the ip of your nic then the second
    ip address is the one assigned by earthlink

    Hope this helps

    Cheers Ghozt




    "Wayne Liu" <liuwayne@earthlink.net> wrote:
    >
    >Hello,
    >
    >My PC has ethernet card installed and assigned an IP address by myself.

    It
    >also has dial up networking to Earthlink configured as Service assigns IP
    >address.
    >
    >Now, I have a Java pgm to retrieve the local host IP address by using
    >"System.out.println(InetAddress.getLocalHost().getHostAddress());", which
    >displays the one I assigned to NIC even I dial up to Earthlink.
    >
    >My question is how can I check out the IP address assigned by Earthlink?
    >Outside Java and Inside Java.
    >
    >thks,
    >wayne
    >
    >
    >



  3. #3
    Wayne Liu Guest

    Re: InetAddress question


    Thks, I haven't tried at home. But I have tried in the office. The first ip
    address shown is the default gateway address, not my pc address.


    "Ghozt" <ghozt@mailexcite.com> wrote:
    >
    >Don't know how to do determine the IP address assigned by Earthlink from

    within
    >Java
    >but to determine the IP Address assigned by Earthlink outside java is easy
    >
    >I assume you are running on a windows box?
    >
    >execute the following command:
    >
    >tracert ibm.com
    >
    >this will display the servers that your machine goes through to
    >access the ibm server.
    >
    >the first ip address will either be your nic or the one
    >assigned by earthlink. If it is the ip of your nic then the second
    >ip address is the one assigned by earthlink
    >
    >Hope this helps
    >
    >Cheers Ghozt
    >
    >
    >
    >
    >"Wayne Liu" <liuwayne@earthlink.net> wrote:
    >>
    >>Hello,
    >>
    >>My PC has ethernet card installed and assigned an IP address by myself.

    >It
    >>also has dial up networking to Earthlink configured as Service assigns

    IP
    >>address.
    >>
    >>Now, I have a Java pgm to retrieve the local host IP address by using
    >>"System.out.println(InetAddress.getLocalHost().getHostAddress());", which
    >>displays the one I assigned to NIC even I dial up to Earthlink.
    >>
    >>My question is how can I check out the IP address assigned by Earthlink?
    >>Outside Java and Inside Java.
    >>
    >>thks,
    >>wayne
    >>
    >>
    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center