Getting public ip address for a lan

hello is their a way to some how retrieve the public ip address of a lan? When i use the standard java get host method from a pc that's in a lan, all i get is the private lan ip address such has 192.x.x.x. this is useless to me if i want to make a connection to this computer from outside the lan.
i want to be able to get the public ip so that i can transform my instant messenger program (LAN based) into the internet so that it clients can talk to eachother from all around the world like msn messanger.
would they be a problem if say 5 users from the same LAN where logged into the program and one person from outside the lan wanted to talk to one of the people from the lan? seeing as all 5 lan users will have the exact same public ip address, is their a way to talk to teh correct user?
The current state is that as soon as a user longs into the system, their ip address from the pc that they are using, is stored temporaily into a server so that if User A whats to talk to User B, User query the server to first find out if the user is online and than get their IP address and join User B,s listening socket using the ip address retieved from the server..

import java.net.URL;
import java.net.HttpURLConnection;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.InputStream;
String publicIP = null;
            try {
                URL tempURL = new URL("http://www.whatismyip.org/");
                HttpURLConnection tempConn = (HttpURLConnection)tempURL.openConnection();
                InputStream tempInStream = tempConn.getInputStream();
                InputStreamReader tempIsr = new InputStreamReader(tempInStream);
                BufferedReader tempBr = new BufferedReader(tempIsr);
                publicIP = tempBr.readLine();
                tempBr.close();
                tempInStream.close();
            } catch (Exception ex) {
                publicIP = "<Could-Not-Resolve-Public-IP-Address>";
            }

Similar Messages

  • Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iPhone (if you're using iOS 7), then sign back in with the ID you wish to use.  If you don't know the password for your old ID, or if it isn't accepted, go to https//appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Tap edit next to the primary email account, tap Edit, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https//appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • Customer wants a public IP address for RDP after VPN Tunnel

    I have a customer that wants to set up a VPN tunnel with me with a Public IP address and a Public address for the host. I am completely at a loss as to how to accomplish this. The customer states that it against his company policy to have a remote host to connect to that is not in the public address space. I have given him a public Peer address to connect to for the establishment of the VPN Tunnel. However he states that he needs the host to be in the public address space as well.
    What is my customer asking for? Surely he does not want me to put RDP on a public address?

    The motive of your customer is not very clear. If the motive is to hide the remote (RDP) addressess then we can do it by natting (Static or Dynamic). We can allow the natted IP as interested traffic over the VPN tunnel.  Because if we are getting the local IP into the public pool then it we don't need VPN tunnel. We can access it directly over internet too.

  • How to get the Delivery address for PO

    I have a problem.
    I am working on a SAP Script , which is for PO(Zmedruck_po) , which is a copy of
    MEDRUCK.
    I am asked to print the delivery adress in a window .
    The scenario is like this .
    In ME23N , under item details , there is a tab called DELIVERY ADDRESS
    this has option to enter the adress details or a delivery number in the  address text box .
    If the address number is present i have to print that address , else i have to print the address which is entered in the delivery address tab.
    If the delivey address number is there i have no problem in printing it ,But if address number is not there ,I need to know how to get the delivery address,
    is it the plant address, company code address ... ?
    I debuged ,but could not find out.
    Can anyone help please .

    Hi,
    try using the below method:
    Goto TWLAD table with storage location (EKPO-LGORT) as key to get address number (ADDRNUMBER).  then goto ADRC table to get the address of the delivery
    Regards
    Shiva

  • How to get Unique IP address for my Mac

    Hello - I agree with several of the posts I've read that Linksys products are very Windows-centric and information for Mac users is sketchy.
    Our household uses both Windows and Macs. It took a long time to get my Mac going via customer service on the telephone (and they take about an hour to answer). But we finally did get the job done and customer service was very diligent in helping solve the problem.
    My question is: customer service gave me an IP number to enter for my Mac - I'm not sure how they came up with that number. I now have two more Macs in the household I'd like to get setup for our network.
    Where or how do I get unique IP numbers for those two machines? I tried using the same one that I was given by LInksys, but then of course, those two machines cannot be ON at the same time - you are told the IP# xxxxx is already in use.
    How does each Mac get its own IP number for the purposes of being on our wireless system?
    Thanks a bunch...

    It would be easier if you simply posted the IP address they gave you and which router model and version (check the label underneath the router) you have. Also the firmware version you are running would be helpful.
    Some of the later WRT54G versions (e.g. v6) had some issues assigning Macs dynamic IP addresses. I guess that was your problem why the support assigned a static IP address instead.
    For your other Macs you simply use the exact same settings exact for the IP address of the computer. A default Linksys routers uses the network 192.168.1.0/255.255.255.0. The router itself is 192.168.1.1. The DHCP server on the router assigns the addresses 192.168.1.100-149. All addresses 192.168.1.2-99 and 150-254 are available.
    The Mac that is already setup should have an address in this range. You can choose any other address in this range for the other Macs. There is no rule whatsoever how you are supposed to assign them. You can use 2,3,4 or 10,20,30, or 13, 26, 39, or ... ;-)

  • Public IP address for ERP system

    Hi,
    A SAP BC consultant gives me a small system landscape for ERP 6.0 and its info. as following:
      a. 1 Sol Man system, 1 ERP system for DEV, 1 ERP system for PRO.
      b. The Sol Man Server is for the ENTIRE SAP TECHNICAL LANDSCAPE in the single company.
      c. The entire SAP Landscape needs to be on a different SUBNET on a different Gigabit switch for optimum performance. The broadcast between 2 subnets will be handled via a router.
      d. A router with VPN Capabilities and 2-3 static public IP addresses (THIS IS A MUST).
    I don't know why I need 2-3 static public IP addresses if I don't public anything to Internet. Somebody tell me why?
    Thanks,
    Toan Do

    Hi,
    Its most prob for saprouter/connection to oss etc.
    Regards

  • Public ip address for asa

    HI.......
    We have Cisco router 2851 and asa firewall. We configured on he router for IP phones and ISP connected. The ISP directly connected on the router and asa firewall connected to the router. We have plan to configure VPN on the router. We have available public ip address. if i configure the VPN on the firewall we need to configure firewall local ip address to public ip address. SO how to configure firewall local ip to public ip ? Where we can configure , mean on the router or firewall. please see my firewall and router configuration ...
    Please help .....

    The ASA would typically be where you setup your public IP Address(es). The firewall normally needs to have a public IP on the outside interface for that to work. Once it does, you can perform dynamic NAT for outbound connections ("global (Outside) 1 xxx.xxx.xxx.185 netmask 255.255.255.255" does this).
    However on the config you attached your outside interface has a private (RFC 1918) address:
    interface Ethernet0/3
    speed 100
    duplex full
    nameif Outside
    security-level 0
    ip address 192.168.255.2 255.255.255.252
    Plus it being a /30 only gives you two addresses - one for the ASA and one for the router's Gi0/0 (per that config which you also attached). This is a bit odd setup but it seems to have been hacked together to work using the routing statement on the router "ip route xxx.xxx.xxx.184 255.255.255.248 192.168.255.2".
    It's really a bit of a mess and extending it further may be possible but will make it even more complicated. I'd advise having someone sit down and re-work how the public IPs are routed to make it look like a more typical setup.

  • HT1551 how do i get an IP address for my AppleTV?

    I am having trouble reconnecting my Apple TV with my internet. What can I do?

    Hello kaseychatila. Welcome to the Apple Discussions!
    How do I reserve an IP address for my XBOX 360 based on it’s MAC settings??
    Here is how to reserve a DHCP-IP address for your Xbox 360 using the AirPort Utility.
    Make sure you are connected (by wire or wirelessly) to the AirPort Extreme Base Station (AEBS), and then, open the AirPort Utility. Select the AEBS, and then, select Manual Setup.
    Internet > DHCP tab
    o On the DHCP tab, click the "+" (Add) button to enter DHCP Reservations.
    o Description: <enter the desired description of the host device, like Xbox 360>
    o Reserve address by: MAC Address
    o Click Continue.
    o MAC Address: <enter the MAC hardware address of the XBox 360>
    o IPv4 Address: <enter the desired IP address that you want the XBox 360 to get from the AEBS>
    o Click Done.

  • Can't Get the email address for new HP 3525 printer..

    Hello, today I received my HP Deskjet 3525. Although I am using a 3G dongle to connect my PC to internet but still I am not getting an email id for my printer on printing report page. My question is whether the printer must be connected to router to get an email id and if the answer is yes is their anyway I can get an email id for my printer without using router as I do not have a router. Please explain in simple language.Thank you
    This question was solved.
    View Solution.

    Hello Bhujang,
    Welcome to the HP Support forums. I understand that you are trying to setup the ePrint feature of your Deskjet Ink Advantage 3525 printer.
    The printer must be connected to a wireless network that has internet access to be able to use the ePrint feature of the printer (as shown on the home page of HP’s ePrintCenter).  If the 3G dongle you are using broadcasts a wireless network then you should be able to connect the printer to that network.  However, if the 3G dongle travels with you then the printer’s wireless connection would be lost and the web services would stop until the printer is connected to a wireless network with internet access again. 
    If you connect the printer to a wireless network with internet access you can find the printer’s ePrint email address by following the steps in Getting the Printer Claim Code.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • Getting Public IP address of a machine

    Hi,
    I have a console based application to get the ip address of a machine. I have tried the following code to retrieve the ip address of the local machine.
    IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
    string IPAddress = string.Empty;
    foreach (IPAddress ip in host.AddressList)
    if (ip.AddressFamily == AddressFamily.InterNetwork)
    IPAddress = ip.ToString();
    break;
    Console.WriteLine(IPAddress);
    Console.ReadKey();
    This gives me both Public IP as well as Private IP of the machine in
    host.AddressList
     I am unable to distinguish them and retrieve only Public IP of the machine.
    Please let me know how to go about obtaining only Public IP of a machine.
    Sid

    Hi,
    Try the following links
    http://www.codeproject.com/KB/cs/network.aspx
    http://social.msdn.microsoft.com/forums/en-us/winforms/thread/E5FE11C4-7F0C-4AC6-80D1-7B8DFB374416
    Regards,
    A.Murugan
    If it solved your problem,Please click "Mark As Answer" on that post and "Mark as Helpful". Happy Programming!

  • Public IP Address for DA Teredo Edge Config

    Hi,
    We are configuring Direct Access for the first time on server 2012 R2.  We have setup and tested it fine on the single adapter ‘basic’ configuration but would like to configure it to use Teredo as it’s supposed to be faster.
    I have read that this requires two network adapters on the DA server, one configured for the intranet and the other configured for the public internet with two consecutive public IP addresses.
    My question is if i point the public DNS record to the first public IP address (E.g. DirectAccess.mydomain.com) what do I need to do with the second public IP?  I’m not clear what the second IP is used for?
    I have read the second IP could be something to do with certificates but it wasn’t very clear.  We will be using Direct Access with Windows 7 clients so already have an internal PKI installed for the DA single adapter setup.
    Also, I have read that even with the IP-HTTPS performance improvements in 2012 Teredo is still considerably faster (assuming the internet connection itself is fast enough).  Can anyone advice on speed differences between IP-HTTPS and Teredo?
    Thanks
    Alex

    Hi
    Since Windows Server 2012, you are allowed to deploy DirectAccess in multiple scenarios. I your situation, you have a single network interface. In this scenario, your DirectAccess Server have a single private IP address. Teredo can only be used in two network
    interface scenario. This is the only scenario you need two ipv4 public addresses.
    IPHTTPS performance is available since Windows Server 2012 but require at least Windows 8 to be used.
    Best regards.
    BenoitS - Simple by Design http://danstoncloud.com/blogs/simplebydesign/default.aspx

  • Outlook Add-In Mail Item Address How to get the email address for Receipents & Sender?

    Hello,
    I am developing an outlook add-in and unable to retrieve the email address from the To,CC,BCC field & the "Sender".
    I have written the below code - 
    //Prepare list of receipients.
    List<string> emailIds = new List<string>();
    foreach (Outlook.Recipient recipient in mailItem.Recipients)
    { emailIds.Add(recipient.Address); }
    emailIds.Add(mailItem.SenderEmailAddress);
    In the code above, if the receipient/sender address is saved in the address book, I get the details else "null".
    Could someone please help me in fetching the correct email address irrespective of it been saved in the address book or not?
    Thanks!
    -Vinay Pugalia
    If a post answers your question, please click "Mark As Answer" on that post or
    "Vote as Helpful".
    Web : Inkey Solutions
    Blog : My Blog
    Email : Vinay Pugalia

    Hello Starain,
    I am sorry but I do not understand why this is happening as I get proper results.
    Coming to the recipient from the address book, I just want to re-confirm what we mean by "recipient
    from the address book". By this, I mean that whether my recipient is a contact in the outlook address book or not, I get proper email address.
    Please confirm are we on the same page? As other than this, I do not see any difference.
    Thanks!
    -Vinay Pugalia
    If a post answers your question, please click "Mark As Answer" on that post or
    "Vote as Helpful".
    Web : Inkey Solutions
    Blog : My Blog
    Email : Vinay Pugalia

  • What are the public IP addresses for Apple Update servers?

    I work for a school district and we would like to create a NAT rule in our firewall to make all traffic going out for Apple updates to use the same public IP (iPhones, iPads, Macs, etc). Does anyone know what Apple IP addresses I would need for that?
    This will be used to make all devices in our district go to the same Apple Caching Server.
    Thanks in advance.

    Hi,
    which book from the chapter you are refering to?
    If possible can you post the entire question so that we help you in identificying the correct address.
    Best to use the ip subnet calculator.
    http://www.vlsm-calc.net/
    http://www.subnet-calculator.com/cidr.php
    Regards
    Inayath

  • To check the entire List to get the email address for a Workflow.

    Hi
    For a Service Request workflow i need to check the entire user list where the department is 'abc ' and then take that persons email address and send the mail to that particular user.
    Is there any way in which this is possible.
    Thanks in advance
    Meena

    hi
    we have a requirement where in when a SR is to be transferred to a particular dept an email has to be sent atleast to one user in that dept.
    We have a department field in the SR page and also in the User page. so say i select department in SR page as 'abc' then email has to be sent to the user who has dept as 'abc'.
    Thank you.

  • Getting IP address for 2nd hand HP LaserJet 6MP?

    We don’t have the user manual, because the printer is 2nd hand and did not come with one. I had read that the IP address might be on the back, but there are no IP-like numbers there.
    We are trying to get this printer running with an old clamshell iBook (OS 9.2) and an Asante bridge. Some posts in other threads say the Asante won’t work with this, but if we can get an IP address for the printer then perhaps we can be sure.
    I have read threads about running this printer, which is extolled as a workhorse, with 10.6 and we might try that next but it means buying another piece of equipment & maybe a new cable. We’ve already bought a used Apple Laserwriter 16/600 that turned out not to function (printed a test sheet fine then always reported a paper jam though there was none). And we bought the Asante bridge.
    All this in aid of occasional use for artistic purposes, using the printer to fuse (commercial) colored lettering onto regular black lettering printed onto gold-leafed paper. We did this for many years with our Apple Laserwriter that we raised from a pup, until it just finally wore out. Other modern printers either don’t get hot enough or aren’t forgiving enough to accept paper with gold leaf.
    I felt I had to mention this because so many of the other threads had replies like “Get a new printer, they’re faster and sweller“ etc. but there is not a one that will last for 15 years of regular use as our Apple Laserwriters did, and as many peoples’ old HP 6MPs seem to be doing. We threw away a Kodak printer, cheap thing clacked and vibrated like a rube goldberg machine.
    Anyway, suggestions on finding IP address for this printer?

    Cynthia Cheney wrote:
    Thank you, Greg. I tried the reconfiguration you suggested. In the Appletalk control panel I turned Appletalk off, then in that same panel chose “Connect via:” Ethernet. It then says below “no zones available” . When I try to print I get an error message, “Laserwwriter 8 cannot be used because of an internal error, -43” (I remember error #43!) Laserwriter 8 requires Appletalk, and I turned it off but it shows as active in the Chhoser when Laserwriter 8 is selected. When I went back to the Appletalk control panel Appletalk had been reactivated, though the pulldown menu still showed “Connect via:” Ethernet and “no zones available” . Appletalk address reads Node 128 and Network 65280, which either I chose many years ago or it was automatically chosen. After checking all this, still got the same error message when trying to print.
    You must have AppleTalk turned on to print to that printer _from a Mac running OS 9.2_. You must have AppleTalk turned off to print from a Mac running OS X 10.6.5.
    We’re only using the clamshell iBook because we thought it would work without buying additional equipment; we got the Asante box to go with the old Apple Laserwriter purchased previously (had mechanical problems). My husband would use the HP Printer perhaps twice a month, for a few copies of fairly short text each time onto goldleafed paper, so the iBook would be adequate.
    If the printer has an Ethernet port, either built in or using a DirectJet card, you should be able to print to it without the Asante Talk device. You can print to it from OS X using IPP. You can print to it from OS 9 using AppleTalk.
    I had read that 10.6 ended Apple support for certain old printers, but recent reading of threads has shown me that’s not so in this case. The old HP JetDirect things are on eBay but there’s quite a variety.
    Yes. And not all of them work with OS X 10.6 (or Windows 7). That would be why some of them are on eBay: the owners can't get them to work anymore and are making them someone else's problem.
    One there now, is: HP JetDirect 200M LIO Internal Print Server (J6039B) Feature
    Serves Ethernet and Fast Ethernet 802.3, 10BaseT and 10/100 BaseTX network types
    Supports any LIO-based printer
    [http://cgi.ebay.com/HP-JetDirect-200M-Print-server-/250742520371?pt=LHDefaultDomain_0&hash=item3a616b3a33#ht_485wt1158]
    Anyone know if this would work with the HP LaserJet 6MP and my husband’s iMac running 10.6?
    I'd look at HP's site.

Maybe you are looking for

  • Delimit button not working in table maintainance generator

    Hi Gurus,                i created table maintenance generator for the view.in this view i hide one field i.e. sequence no. and when ever user entering the values, this sequence no. automatically increased for each record. I just included the code in

  • I can't download PDF's from website that uses Adobe Reader on my Windows 8 phone?

    For work I need to be able to download PDF's from a particular website.  It utilizes the Adobe Reader but when I try to download a PDF, it doesn't do anything.  I tried to download the "Adobe Reader" from the website but it says that I do not hav the

  • Audio: Snap, Crackle & Pop when running Vista.

    Hi Everyone, I have searched the forums and read a lot about the common problem of audio crackling when running Vista via Bootcamp. However, most of the searches pertain to Macbook Pro's as opposed to iMac, which is what I'm running. I've read the th

  • Lightroom 3.4 LR 3.4 and CS3 - Raw Converter 6.4 ?

    Just upgraded to LR 3.4 and I use Photoshop CS3 - ( Canon 5D MII )  it appears that I need Raw Converter 6.4 , which I do not believe is available for CS3  - Can I get this combination of LR 3.4 and CS3 to work ?  Is there a good work around without

  • Trouble sending images over sms

    Anyone having trouble sending images over txt messages?