LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-24-2008, 03:27 PM   #1
Kratosaurion7
LQ Newbie
 
Registered: Dec 2008
Distribution: Fedora/Ubuntu
Posts: 18

Rep: Reputation: 0
To find the public IP (on Ubuntu Server 8.10)


Hi, how can I check what is my public ip? I want people to connect to my site but I only have my private IP for my other computers at home. And I'm running Ubuntu Server so I don't have any kind of GUI to browse the net.
 
Old 12-24-2008, 03:35 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
lynx -dump http://www.formyip.com/ | awk '/IP is/{print $NF}'
or
wget -O- http://cfaj.freeshell.org/ipaddr.cgi 2>/dev/null
or
perl -MLWP::Simple -le '$_=get q(http://www.formyip.com/); print $1 if /IP is ((\d{1,3}\.){3}\d{1,3})/'

Last edited by repo; 12-24-2008 at 03:37 PM.
 
Old 12-24-2008, 03:40 PM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
To mail the IP to you:
wget -O- http://cfaj.freeshell.org/ipaddr.cgi 2>/dev/null | mail -s "IP SERVER" you@you.com
 
Old 12-26-2008, 03:21 PM   #4
alexhwest
Member
 
Registered: Dec 2008
Location: Cleveland, OH
Distribution: Ubuntu
Posts: 30

Rep: Reputation: 15
To make this easier on you you will probably want to run ddclient and use dyndns.org to get a hostname that you can use from the internet to connect to your dynamic IP. Of course, if you have a static address just ignore this If you want to see the ip addresses assigned to the interfaces just use ifconfig -a

Last edited by alexhwest; 12-26-2008 at 03:22 PM.
 
Old 12-27-2008, 03:57 PM   #5
geek745
Member
 
Registered: Jul 2004
Location: Alton, IL
Distribution: Linux Mint; Slackware; Ubuntu; Slax
Posts: 172
Blog Entries: 2

Rep: Reputation: 34
or if you have your own website that's public, the IP of the requesting machine (you) is sent to the page, so PHP or ASP can return that from the headers - I have that on my site: http://pnguyen.net/getmyip.php
 
  


Reply

Tags
ip, network, public, ubuntu



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find and configure a sound driver for Ubuntu server (no desktop) lumix Linux - Hardware 1 04-28-2008 07:54 PM
1 public server, 1 private server with a Cisco ASA5505 inbetween, is this hard to do? abefroman Linux - Networking 12 04-10-2008 09:39 AM
Ubuntu Server and Fedora 8, neither find my internet connection via my AN35N Ultra. mtlhd Linux - Server 3 12-22-2007 06:39 PM
VPN Server: need help setting up a public server accessible by win xp clients hamish Linux - Networking 6 09-20-2006 02:39 AM
Cannot find public key. codedv Linux - General 2 10-11-2004 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration