0

What is the IP address of my home computer from the perspective of the outside world? I need this in order to grant myself permissions to connect to a mysql database on a work server. I'm working on an Ubuntu 14.04 computer. Here is my output from the command ifconfig

selah@selah-Aspire-5745:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 60:eb:69:9d:38:86  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10062 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10062 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1005650 (1.0 MB)  TX bytes:1005650 (1.0 MB)

wlan0     Link encap:Ethernet  HWaddr 4c:xx:xx:xx:xx:xx  
          inet addr:192.168.1.6  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::4e0f:6eff:fe92:41f5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:191106 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92154 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:235057203 (235.0 MB)  TX bytes:14859361 (14.8 MB)
Selah
  • 121

3 Answers3

5

You can use curl or dig but even wget

     curl -s icanhazip.com    # or
     curl -s ident.me

     dig +short myip.opendns.com @resolver1.opendns.com

There are many site that offer this kind of services. If you need to know it often you can add in your alias file (usually ~/.bash_alias) or on .bashrc the following alias

     alias getmyip='dig +short myip.opendns.com @resolver1.opendns.com'
     # or alias getmyip='curl -s icanhazip.com'

and after invoke it with your new command getmyip.
It works too

     wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'
Hastur
  • 19,483
  • 9
  • 55
  • 99
2

You can find your public IP address by browsing to the site http://www.whatismyip.com from the computer that you want to find the IP address for

SOSidb
  • 533
2

Even easier, you can type "What's my IP address?" into Google

Tetsujin
  • 50,917