LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
 
Search this Thread
Old 05-25-2008, 09:40 AM   #1
mickeyboa
Senior Member
 
Registered: May 2004
Location: Indianapolis, Indiana
Distribution: FC-KDE, 32 and 64 bit
Posts: 1,402

Rep: Reputation: 55
ddclient getting IP from AP


FC 8
I'm using a 2WIRE783 router/modem AP from AT&T and I want ddclient to be able to get the Internet IP for my network
so it can forward it to dyndns.com.
The other methods i'm using like "getip.com" and so on is not working, I think they are shutting me out.
Is there a HowTo someplace to explain howto get it from the AP.

Thanks
Jim
 
Old 05-26-2008, 03:32 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Just to make sure we're not talking about different things:

1. Your modem gets a dynamic IP from the ISP
2. Your modem gives your computer a "private" IP (like 192.168.0.2)

If that's the case then, can you use the modem as a 'bridge'?

If you can't use it as a bridge, then:
1. The modem has to treat your computer as a 'DMZ' and set up so that all traffic destined for the modem goes to your computer. On some modems it is not possible to configure things this way.
2. You need to extract the modem's assigned IP via http requests (your modem DOES use http for configuration, doesn't it?) A tool like 'curl' may help to retrieve the text from the modem, and you can use any scripting language you can imagine to process that text and get the IP address.

The remaining challenge:
Your ISP may be nasty and set the DHCP lease to expire, say, every 3 hours. In such a case you need to run a script every few minutes to check the modem's IP, compare it to the previous value, and update as necessary. Now that would be very mean - with the refresh rates of dyndns, that could leave you with only 1 hour up time every 3 hours... To make matters worse, that can be a security issue because someone out there may just be logging all traffic which happens to be sent to them, and people may be attempting to log into your system (current IP from dyndns) when in fact they're connected to some nasty person's machine. Just hope that the authentication mechanism for what they're trying to do relies on sending a hash of some sort rather than ever sending the actual password.
 
Old 05-26-2008, 11:48 AM   #3
mickeyboa
Senior Member
 
Registered: May 2004
Location: Indianapolis, Indiana
Distribution: FC-KDE, 32 and 64 bit
Posts: 1,402

Original Poster
Rep: Reputation: 55
1. Your modem gets a dynamic IP from the ISP
2. Your modem gives your computer a "private" IP (like 192.168.0.2)

That is exactly what is happening , It is giving me 172.16.1.37


Below is the settings in the "Local LAN Settings in 2WIRE783 modem/router"

Bridge Network
Bridge Address: 76.240.4.98
Subnet Mask: 255.255.255.248

What can I do to get the Internet IP from Modem/Router
 
Old 05-28-2008, 04:39 AM   #4
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
"What can I do to get the Internet IP from Modem/Router"

If your router won't act as a proper bridge, use a tool like 'curl' to request the router's page which has the WAN IP and process the result to get the IP. (Unfortunately you may also have to send a user/password form before you can get access to that page.)
 
Old 05-28-2008, 08:29 AM   #5
mickeyboa
Senior Member
 
Registered: May 2004
Location: Indianapolis, Indiana
Distribution: FC-KDE, 32 and 64 bit
Posts: 1,402

Original Poster
Rep: Reputation: 55
How do I run the command curl to achieve this ?
 
Old 05-29-2008, 03:32 AM   #6
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
"How do I run the command curl to achieve this ?"

You need to read the curl docs: http://curl.haxx.se/docs/manpage.html

You also need to poke around a little. For example, point your browser at the router's configuration page:
1. Bring up the login page and copy down the URL
2. Right-click and 'view page source'
You want to look at the source to find out what happens when you enter a username, password, and click on the 'login' button. You will probably find a POST request will be sent. So, to log in (assuming you hadn't logged into the router yet), you need to use curl to send a similar POST. Of course you only need to automate this login if you are required to log in before you can be served the page with the WAN IP.

3. Go to the page with the WAN IP
Copy the URL. Also right-click and select 'view page source'. This time you're looking for the entry which has the WAN IP. You can then figure out the best way to parse that file and get exactly what you want. You can request the URL via a script using curl.

Other bits:
You may need to read up a bit on how to do a POST request, but odds are you just ape what you see in the router's web page source (what's executed when you click 'log in') and play with curl until you get that POST right.

If you do need to log in first, then you need to develop some trick to determine whether you are already logged into the router or not. Usually this is by sending a URL request and looking at the return value. For example, try selecting 'log out' of the router (from your 'admin' session, not from the ISP!), then typing in the URL that you copied and seeing what the router response is - for example, if it's "you need admin privileges" then you look at the source for the URL presented to you and see how it can be used to your advantage.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ddclient ?? mickeyboa Fedora 6 01-31-2008 09:12 AM
ddclient hirts123 Slackware 1 08-31-2005 04:29 AM
ddclient socks Linux - Software 5 10-17-2004 02:36 AM
ddclient doralsoral Linux - Software 3 04-19-2004 09:14 AM
I need help with 'ddclient' hecresper *BSD 3 05-06-2003 05:20 PM


All times are GMT -5. The time now is 05:14 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration