Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Networking > trying to get my external ip

Forgot Password?
 Linux Networking   Hardware/Software related, Modems, Internet connection sharing, IPTables etc.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Closed Thread
 
Thread Tools Display Modes
Old 01-28-2005   #1 (permalink)
Just Joined!
 
Join Date: Nov 2004
Posts: 39
trying to get my external ip

greetings,

I am attempting to use a service like dyndns so that I can access my Debian (woody) box from the outside world. To do so, I need to find out what my external ip address is. I thought running

#ifconfig

would give me this info but all I can see is the static ip I have assigned it for my LAN, 192.168.1.161.

Quote:
eth0 Link encap:Ethernet HWaddr 00:30:BD:71:8B:14
inet addr:192.168.1.161 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:32127 errors:0 dropped:0 overruns:0 frame:0
TX packets:21782 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:41490509 (39.5 MiB) TX bytes:8850771 (8.4 MiB)
Interrupt:10 Base address:0x9000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1038 errors:0 dropped:0 overruns:0 frame:0
TX packets:1038 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:117728 (114.9 KiB) TX bytes:117728 (114.9 KiB)
I have a cable internet connection that uses dhcp. The connection hooks directly to a router with an internal ip of 192.168.1.1, which I set as the gateway for my Debian box. Please let me know if more info is needed about my configuration.

Thanks,

-dave
davepass is offline  


Old 01-28-2005   #2 (permalink)
Linux Guru
 
loft306's Avatar
 
Join Date: Oct 2003
Location: The DairyLand
Posts: 1,666
look in the routers setup for the public ip ! in that setup it is the router that holds the lease with your isp.
__________________
~Mike ~~~ Forum Rules
Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. ~ Linus Torvalds
http://loft306.org
loft306 is offline  
Old 01-28-2005   #3 (permalink)
Just Joined!
 
Join Date: Jan 2005
Location: Toronto, ON, Canada
Posts: 79
Here is your external IP.

But one way to do it is using trace route to some external host and looking in the list returned by trace route for the first public IP. This work fine except for some ISPs working with public IPs in their internal network segment.


afrolinux
afrolinux is offline  
Old 01-29-2005   #4 (permalink)
Just Joined!
 
Join Date: Nov 2004
Posts: 39
thanks to both of you.

Unfortunately all I am able to get is the IP of my router (which is what the little penguin told me).

I may not have read through enough of dyndns's documentation, but I think there is a way to point a dyndns host directly to a specific machine...

any thoughts?
davepass is offline  
Old 01-29-2005   #5 (permalink)
Linux Guru
 
dylunio's Avatar
 
Join Date: Aug 2004
Location: Cymru
Posts: 4,157
You will have to point the dns to the router's IP, and then set the router to forard the port used to the specific computer;

dylunio
__________________
Registered Linux User #371543!
Get force-get May The Source Be With You
/dev/null
/dev/null2
dylunio is offline  
Old 01-29-2005   #6 (permalink)
Just Joined!
 
Join Date: Nov 2004
Posts: 39
ok now it's making sense.

My problem is that one machine on my network already has port 22 (ssh) forwarding to its internal, static ip (under a different dyndns host name). Does this mean that no other machines on the LAN can use this port?
davepass is offline  
Old 01-29-2005   #7 (permalink)
Just Joined!
 
Join Date: Jan 2005
Location: Toronto, ON, Canada
Posts: 79
As you can specify to the ssh client the port number

Quote:
sshclient [-r] [-p port] [-u user] [-h host] [profile.ssh2]

You can dedicate arbitary port on the external IP to be forewarded to your internal host at port 22. The only thing is when you connect you have to do it to the external host and have to specify the external port number.

afrolinux
afrolinux is offline  
Old 01-29-2005   #8 (permalink)
Just Joined!
 
Join Date: Nov 2004
Posts: 39
now i'm confused again

do you mean something like

$ssh -p 55 me@myhost.dyndns.com


Tried this w/port 55 forwarded to 22 and my machine's ip and the connection was refused
davepass is offline  
Old 01-29-2005   #9 (permalink)
Just Joined!
 
Join Date: Nov 2004
Posts: 39
my bad. I was forwarding the port incorrectly within the router. fixed it and same line now works.

Thanks for all the help
davepass is offline  
Old 01-29-2005   #10 (permalink)
Just Joined!
 
Join Date: Jan 2005
Location: Toronto, ON, Canada
Posts: 79
I do not know if is used port 55 for anything else but using some port like 55555 will be safe and may be some day a well known port of you@myhost.dyndns.com.

Regards,

afrolinux
afrolinux is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 05:58 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2