Find cell phone's public IP address for purpose of SSH'ing into EC2 server












0















Background: when I'm on call, I need to be able to quickly SSH into an AWS production server from my cell phone (e.g., if I don't have a laptop handy and there is cell coverage but no wifi). SSH access is only allowed from a small number of IP addresses, and before I can SSH I need to add my cell phone's public IP address to that list. I'm using Prompt 2 and AWS Mobile Console.



Question: how can I find my cell phone's public IP address that I need to add to the AWS security group? (please read the entire question before you close it as a duplicate)



It does sound easy, right? Except I cannot find an easy way to determine my cell phone's actual public IP address. For example, while accessing the internet via the cell phone network, whatismyip.com reports my public IP address as 107.77.xxx.xxx. Adding that address to the security group does not work. ipchicken.com and some other sites report the same address.



Next, I figured that there is probably all sorts of NAT in between, and that maybe some smarter web tools can handle that. Indeed, ifconfig.me and checkip.dyndns.org report a different public IP address, 166.170.xx.xx, in my case. Adding that address to the security group, also does not allow me to SSH into the server.



Now, as my last resort, I ssh'ed from my cell phone into another server that does not contain production data and allows ssh access from any address:



$ netstat -an|grep ":22 .* ESTABLISHED"
tcp 0 0 172.31.14.173:22 107.72.xx.xx:23255 ESTABLISHED
$


Per netstat, my ssh session is coming from IP address 107.72.xx.xx (full address redacted). Now, if I add that address to my AWS security group, I can finally ssh from my cell phone into the production server. So, this last method does yield the correct address that I need, but it's somewhat difficult to obtain, especially if I don't have access to another server that allows SSH from any address.



So, in short: is there a website like whatismyip.com or ifconfig.me that would give me access to my cell phone's "true" public IP address, as determined by netstat.



I'm using an iPhone so I cannot run local UNIX commands. My cell service provider is AT&T, if that helps. I also put my phone into field test mode, but it gives me only AT&Ts non-routable internal 10.x.x.x address.










share|improve this question


















  • 1





    Have you found that the netstat method returns a different address over time or from different locations? It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method. Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address.

    – John Rotenstein
    Nov 22 '18 at 3:50











  • @JohnRotenstein Hats off to you! You nailed it. I hat to download the ISC dig utility first, but using dig indeed produced the correct result! Please add as an official answer if you care for the credits. Thanks so much!

    – user1932890
    Nov 26 '18 at 20:12
















0















Background: when I'm on call, I need to be able to quickly SSH into an AWS production server from my cell phone (e.g., if I don't have a laptop handy and there is cell coverage but no wifi). SSH access is only allowed from a small number of IP addresses, and before I can SSH I need to add my cell phone's public IP address to that list. I'm using Prompt 2 and AWS Mobile Console.



Question: how can I find my cell phone's public IP address that I need to add to the AWS security group? (please read the entire question before you close it as a duplicate)



It does sound easy, right? Except I cannot find an easy way to determine my cell phone's actual public IP address. For example, while accessing the internet via the cell phone network, whatismyip.com reports my public IP address as 107.77.xxx.xxx. Adding that address to the security group does not work. ipchicken.com and some other sites report the same address.



Next, I figured that there is probably all sorts of NAT in between, and that maybe some smarter web tools can handle that. Indeed, ifconfig.me and checkip.dyndns.org report a different public IP address, 166.170.xx.xx, in my case. Adding that address to the security group, also does not allow me to SSH into the server.



Now, as my last resort, I ssh'ed from my cell phone into another server that does not contain production data and allows ssh access from any address:



$ netstat -an|grep ":22 .* ESTABLISHED"
tcp 0 0 172.31.14.173:22 107.72.xx.xx:23255 ESTABLISHED
$


Per netstat, my ssh session is coming from IP address 107.72.xx.xx (full address redacted). Now, if I add that address to my AWS security group, I can finally ssh from my cell phone into the production server. So, this last method does yield the correct address that I need, but it's somewhat difficult to obtain, especially if I don't have access to another server that allows SSH from any address.



So, in short: is there a website like whatismyip.com or ifconfig.me that would give me access to my cell phone's "true" public IP address, as determined by netstat.



I'm using an iPhone so I cannot run local UNIX commands. My cell service provider is AT&T, if that helps. I also put my phone into field test mode, but it gives me only AT&Ts non-routable internal 10.x.x.x address.










share|improve this question


















  • 1





    Have you found that the netstat method returns a different address over time or from different locations? It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method. Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address.

    – John Rotenstein
    Nov 22 '18 at 3:50











  • @JohnRotenstein Hats off to you! You nailed it. I hat to download the ISC dig utility first, but using dig indeed produced the correct result! Please add as an official answer if you care for the credits. Thanks so much!

    – user1932890
    Nov 26 '18 at 20:12














0












0








0








Background: when I'm on call, I need to be able to quickly SSH into an AWS production server from my cell phone (e.g., if I don't have a laptop handy and there is cell coverage but no wifi). SSH access is only allowed from a small number of IP addresses, and before I can SSH I need to add my cell phone's public IP address to that list. I'm using Prompt 2 and AWS Mobile Console.



Question: how can I find my cell phone's public IP address that I need to add to the AWS security group? (please read the entire question before you close it as a duplicate)



It does sound easy, right? Except I cannot find an easy way to determine my cell phone's actual public IP address. For example, while accessing the internet via the cell phone network, whatismyip.com reports my public IP address as 107.77.xxx.xxx. Adding that address to the security group does not work. ipchicken.com and some other sites report the same address.



Next, I figured that there is probably all sorts of NAT in between, and that maybe some smarter web tools can handle that. Indeed, ifconfig.me and checkip.dyndns.org report a different public IP address, 166.170.xx.xx, in my case. Adding that address to the security group, also does not allow me to SSH into the server.



Now, as my last resort, I ssh'ed from my cell phone into another server that does not contain production data and allows ssh access from any address:



$ netstat -an|grep ":22 .* ESTABLISHED"
tcp 0 0 172.31.14.173:22 107.72.xx.xx:23255 ESTABLISHED
$


Per netstat, my ssh session is coming from IP address 107.72.xx.xx (full address redacted). Now, if I add that address to my AWS security group, I can finally ssh from my cell phone into the production server. So, this last method does yield the correct address that I need, but it's somewhat difficult to obtain, especially if I don't have access to another server that allows SSH from any address.



So, in short: is there a website like whatismyip.com or ifconfig.me that would give me access to my cell phone's "true" public IP address, as determined by netstat.



I'm using an iPhone so I cannot run local UNIX commands. My cell service provider is AT&T, if that helps. I also put my phone into field test mode, but it gives me only AT&Ts non-routable internal 10.x.x.x address.










share|improve this question














Background: when I'm on call, I need to be able to quickly SSH into an AWS production server from my cell phone (e.g., if I don't have a laptop handy and there is cell coverage but no wifi). SSH access is only allowed from a small number of IP addresses, and before I can SSH I need to add my cell phone's public IP address to that list. I'm using Prompt 2 and AWS Mobile Console.



Question: how can I find my cell phone's public IP address that I need to add to the AWS security group? (please read the entire question before you close it as a duplicate)



It does sound easy, right? Except I cannot find an easy way to determine my cell phone's actual public IP address. For example, while accessing the internet via the cell phone network, whatismyip.com reports my public IP address as 107.77.xxx.xxx. Adding that address to the security group does not work. ipchicken.com and some other sites report the same address.



Next, I figured that there is probably all sorts of NAT in between, and that maybe some smarter web tools can handle that. Indeed, ifconfig.me and checkip.dyndns.org report a different public IP address, 166.170.xx.xx, in my case. Adding that address to the security group, also does not allow me to SSH into the server.



Now, as my last resort, I ssh'ed from my cell phone into another server that does not contain production data and allows ssh access from any address:



$ netstat -an|grep ":22 .* ESTABLISHED"
tcp 0 0 172.31.14.173:22 107.72.xx.xx:23255 ESTABLISHED
$


Per netstat, my ssh session is coming from IP address 107.72.xx.xx (full address redacted). Now, if I add that address to my AWS security group, I can finally ssh from my cell phone into the production server. So, this last method does yield the correct address that I need, but it's somewhat difficult to obtain, especially if I don't have access to another server that allows SSH from any address.



So, in short: is there a website like whatismyip.com or ifconfig.me that would give me access to my cell phone's "true" public IP address, as determined by netstat.



I'm using an iPhone so I cannot run local UNIX commands. My cell service provider is AT&T, if that helps. I also put my phone into field test mode, but it gives me only AT&Ts non-routable internal 10.x.x.x address.







ios mobile amazon-ec2 ssh ip-address






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 '18 at 2:55









user1932890user1932890

1419




1419








  • 1





    Have you found that the netstat method returns a different address over time or from different locations? It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method. Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address.

    – John Rotenstein
    Nov 22 '18 at 3:50











  • @JohnRotenstein Hats off to you! You nailed it. I hat to download the ISC dig utility first, but using dig indeed produced the correct result! Please add as an official answer if you care for the credits. Thanks so much!

    – user1932890
    Nov 26 '18 at 20:12














  • 1





    Have you found that the netstat method returns a different address over time or from different locations? It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method. Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address.

    – John Rotenstein
    Nov 22 '18 at 3:50











  • @JohnRotenstein Hats off to you! You nailed it. I hat to download the ISC dig utility first, but using dig indeed produced the correct result! Please add as an official answer if you care for the credits. Thanks so much!

    – user1932890
    Nov 26 '18 at 20:12








1




1





Have you found that the netstat method returns a different address over time or from different locations? It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method. Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address.

– John Rotenstein
Nov 22 '18 at 3:50





Have you found that the netstat method returns a different address over time or from different locations? It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method. Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address.

– John Rotenstein
Nov 22 '18 at 3:50













@JohnRotenstein Hats off to you! You nailed it. I hat to download the ISC dig utility first, but using dig indeed produced the correct result! Please add as an official answer if you care for the credits. Thanks so much!

– user1932890
Nov 26 '18 at 20:12





@JohnRotenstein Hats off to you! You nailed it. I hat to download the ISC dig utility first, but using dig indeed produced the correct result! Please add as an official answer if you care for the credits. Thanks so much!

– user1932890
Nov 26 '18 at 20:12












1 Answer
1






active

oldest

votes


















1














It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method.



Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address, which would avoid the proxy.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423237%2ffind-cell-phones-public-ip-address-for-purpose-of-sshing-into-ec2-server%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method.



    Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address, which would avoid the proxy.






    share|improve this answer




























      1














      It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method.



      Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address, which would avoid the proxy.






      share|improve this answer


























        1












        1








        1







        It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method.



        Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address, which would avoid the proxy.






        share|improve this answer













        It sounds like web traffic gets proxied, so you would need to check the address via a non-HTTP method.



        Getting a public IP without access to a browser? - Networking - Spiceworks suggests using a DNS lookup to obtain the address, which would avoid the proxy.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 26 '18 at 23:14









        John RotensteinJohn Rotenstein

        75.5k785136




        75.5k785136
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423237%2ffind-cell-phones-public-ip-address-for-purpose-of-sshing-into-ec2-server%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini