Fedora Linux Support Community & Resources Center
  #1  
Old 20th December 2005, 12:13 AM
lindan's Avatar
lindan Offline
Registered User
 
Join Date: Dec 2005
Posts: 11
Question How to get my dynamic IP?

Hi!

I want to know my external dynamic IP, but I just can't figure out how it works. I am a newbie in networking, but I know how to handle bash, vi and I have even spent some time learning Perl and shell-scripting.

Now, since I have inet access, I wanted to learn more about networking. I just wanted to play a little with ssh, maybe an ftp server and so on. But in order to use ssh I must know my IP adress. I got it managed two ways: Browse my router configuration (192.168.2.1 at the time), which also shows my dyn IP, or look it up at some sites probably made for nopes like me.

But there has to be a better solution. Locking at some faq's I found the following quite handy:

myip=$(ifconfig ppp0 | grep 'inet adr' | sed ... [regex to filter IP])

but it wouldn't work because in my case ifconfig output looks like this:

Quote:
eth0 Link encap:Ethernet Hardware Adresse 00:0AD:0B:45:05
inet Adresse:192.168.2.32 Bcast:192.168.2.255 Maske:255.255.255.0
inet6 Adresse: fe80::20a:cdff:fe0b:4505/64 Gültigkeitsbereich:Verbindung
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:767514 errors:0 dropped:0 overruns:0 frame:0
TX packets:849144 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX bytes:326367276 (311.2 MiB) TX bytes:698669669 (666.3 MiB)
Interrupt:11 Basisadresse:0xe800

lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
inet6 Adresse: ::1/128 Gültigkeitsbereich:Maschine
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2865 errors:0 dropped:0 overruns:0 frame:0
TX packets:2865 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX bytes:4065794 (3.8 MiB) TX bytes:4065794 (3.8 MiB)
I hope you don't mind the output being german, suppose you still get it.

As you can see it just shows the local network adress (192.168.2.32). I got the tip above from an Debian faq, but I think that's not the problem.

Maybe someone could please help me?
Reply With Quote
  #2  
Old 20th December 2005, 12:41 AM
w5set Offline
Registered User
 
Join Date: Feb 2005
Location: ark n saw out in the sticks
Posts: 2,316
well you could surf to
https://www.grc.com/x/ne.dll?bh0bkyd2
and look at the botom of the page and see just what your IP is--while you are there...
do the test (Sheild's UP) and see if ya are secure nuff......
don't worry about what Steve Gibson says about IP addresses--everyone on the net has one if they are connected online..he's in the Security business and likes to sell his stuff--it's very good stuff--but if ya mask/do away with your IP--where is the returning info you are surfing for gonna go to? He used to be good at saying some of the stuff offered for "home/small business" use was hyped--but it seems he has started a little of that too..But he IS one of the old timers in the security feild and does KNOW his stuff--read a lot there..
Reply With Quote
  #3  
Old 20th December 2005, 12:59 AM
lindan's Avatar
lindan Offline
Registered User
 
Join Date: Dec 2005
Posts: 11
Quote:
and look at the botom of the page and see just what your IP is--while you are there...
Well, thank you. The site is really interesting, I didn't know anything about reversed DNS and stuff, or about my ISP being told to almost everyone. I just read the first page, but I'll dig in.

But 'till now It just didn't help me out. As I have written, I do already know some sites that show my IP. That's not the problem. I just don't know why I can't see it by myself using ifconfig or something like that. Maybe I have set up something wrong?

I don't even know why it's eth0 for me and ppp0 in the Debian faq! (But I guess that would be ok if I could just see the external adress)

Just a beginner in networking...
Reply With Quote
  #4  
Old 20th December 2005, 01:14 AM
Spoon! Offline
Registered User
 
Join Date: Aug 2005
Location: Hell
Posts: 758
So since you are behind a router you have to either look at your router config or go to sites like http://www.whatismyip.com/ to find your public IP address.

If you want to always be able to SSH into your computer or something like that, you can sign up for one of many free dynamic DNS services, like DynDNS.org and many others. Then you get one of many update clients that will automatically update your IP to the service. I use ddclient, which has many features including looking at your router config or the web to find the IP address, and updates it automatically.
Reply With Quote
  #5  
Old 20th December 2005, 01:15 AM
lindan's Avatar
lindan Offline
Registered User
 
Join Date: Dec 2005
Posts: 11
Nice site, anyway. Now, knowing that my machine is 100% stealth, I'll sleep much better ;-)
Reply With Quote
  #6  
Old 20th December 2005, 01:21 AM
IronWolf Offline
Registered User
 
Join Date: Dec 2005
Posts: 198
Nothing is setup wrong. Your router is what handles your public ip address, so your local interfaces on your linux box don't know anything about it.

It sounds like you just need some way to keep a friendly host name up to date with your current public IP address so you can have some fun with SSH and FTP. Head to DynDNS and take a look at some of the free services they offer. Then get ddclient and you should be able to keep everything up to date and be able to access your host with a friendly host name whenever you want.
Reply With Quote
  #7  
Old 20th December 2005, 01:23 AM
funchords's Avatar
funchords Offline
Registered User
 
Join Date: Jul 2004
Location: Hillsboro, Oregon USA
Posts: 91
Quote:
But 'till now It just didn't help me out. As I have written, I do already know some sites that show my IP. That's not the problem. I just don't know why I can't see it by myself using ifconfig or something like that. Maybe I have set up something wrong?

I don't even know why it's eth0 for me and ppp0 in the Debian faq! (But I guess that would be ok if I could just see the external adress)
You haven't set up anything wrong. The issue is that your computer doesn't know the public IP. So the common strategies are to:
1. Go to some place on the net that will tell you, such as http://checkip.dyndns.org/
2. Interrogate your gateway using its configuration method (usually http and/or UPnP, telnet, and etcetera)
3. Get a static IP address

Your ifconfig correctly reflects your private IP address info: inet Adresse:192.168.2.32 Bcast:192.168.2.255 Maske:255.255.255.0

Here is a Dynamic DNS Update Perl script that is pretty easy to follow. You'll see how it works:

http://cvs.sourceforge.net/viewcvs.p...14&view=markup
... this is part of the http://sourceforge.net/projects/ddclient/ project.
__________________
Robb Topolski
www.funchords.com
Networks/Wi-Fi: Expert, Windows/DOS: Expert, Linux: Shell User, some config skills
Reply With Quote
  #8  
Old 20th December 2005, 01:27 AM
lindan's Avatar
lindan Offline
Registered User
 
Join Date: Dec 2005
Posts: 11
Thanx Spoon!

I have read about ddclient and already installed it via yum. There are also pretty good faqs and howtos that deal with it. I think that's what I'm going to do.

But the question remains: Is there no way to get my IP via a simple shell command; I mean without using an external site somehow? I mean, DynDNS and ddclient are definetely the right thing for what I wanted to do (If I got it right I have to get an adress like foo.baar.quux in DynDNS and then ddclient will post my new dyn IP's to their site everytime it changes - so I can access my computer via foo.baar.quux).

But I tought I had seen people's ifconfig output showing the dyn IP's, or was I wrong? Can't I have that too?
Reply With Quote
  #9  
Old 20th December 2005, 01:34 AM
lindan's Avatar
lindan Offline
Registered User
 
Join Date: Dec 2005
Posts: 11
Well thank you guy's a lot. It's already 2:33am over here and I've got to get up at 5am. I see you all tell me to use DynDNS, so it's maybe best to follow your advice!

funcords: Thank you very much, I will check that script after a few hours of sleep!

Keep posting, ill be back tomorrow!
Reply With Quote
Reply

Tags
dynamic

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic DNS is it possible? rh10023 Using Fedora 2 30th December 2007 06:17 AM
Dynamic DNS & me lovswr Servers & Networking 1 16th May 2007 12:39 AM
How do I set up a dynamic DNS on my LAN? Renich Servers & Networking 1 19th January 2007 08:26 PM
About dynamic IP satimis Servers & Networking 1 23rd October 2006 07:09 PM


Current GMT-time: 20:28 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat