LinuxQuestions.org
Review your favorite Linux distribution.
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 01-26-2006, 09:14 AM   #1
mengsk
LQ Newbie
 
Registered: Jan 2006
Location: Alberta, Canada
Distribution: Slackware
Posts: 16

Rep: Reputation: 0
Static IP help


I dont know if my computer already has a static ip or what; im a big noob.
Anyways i know my local ip (maybe thats not what its called) is 192.168.0.105
but i thikn thats assigned by my dlink router.
I want to be able to contact my computer from outside of my lan and therefore need to know what its ip is. I connect through a dlink router and then through a pretty secure cable connection (shaw if anyone lives in canada.)
So if someone could please quickly help me to figure out my ip so i can connect to my comptuer remotely that woudl be great.
 
Old 01-26-2006, 09:56 AM   #2
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
The only way you can access your Lan from the internet is via the Public ip address that is assigned to the internet interface of your dlink router. 192.168.x.x addresses don't exist as far as the internet is concerned.

Once you know your public ip you will need to configure your router to forward connections to the ports you want to access to an internal host address.
 
Old 01-26-2006, 01:15 PM   #3
mengsk
LQ Newbie
 
Registered: Jan 2006
Location: Alberta, Canada
Distribution: Slackware
Posts: 16

Original Poster
Rep: Reputation: 0
so basically my router gets assigned an ip which is like 72.139.x.x and then all my computers on my lan communicate thorugh that ip adress and the router is just a gateway for information..?
 
Old 01-26-2006, 03:09 PM   #4
Sir_Limpalot
LQ Newbie
 
Registered: Jan 2006
Location: Norway
Distribution: Debian
Posts: 18

Rep: Reputation: 0
Correct, the only ip visible on the outside is the outside-ip of the router.
So if you want to connect from the outside in you'll have to set up your router to forward the specified port (22 for ssh for example) to the ip of the inside-machine you want to connect too...
 
Old 01-26-2006, 03:34 PM   #5
Jelle
Member
 
Registered: Feb 2004
Location: Utrecht, The Netherlands
Distribution: Debian
Posts: 79

Rep: Reputation: 15
And indeed you will probably need a static IP on the lan for that. Probably your computer gets it's ip with dhcp, how you can change that depends on your distro. It looks like your router already assigns ip's above 192.168.0.100. Make sure the address you pick below that (like 192.168.0.3) is not used before you assign it with your distributions intended tool. Als make sure that your /etc/resolv.conf is not empty, but usually after switching to static it will not be wiped. Otherwise put two nameserver ip's in there like nameserver 192.168.0.1 \n nameserver 11.22.33.44
 
Old 01-26-2006, 10:47 PM   #6
mengsk
LQ Newbie
 
Registered: Jan 2006
Location: Alberta, Canada
Distribution: Slackware
Posts: 16

Original Poster
Rep: Reputation: 0
whoa im a noob can we take two steps backward
whats a name server?
what is the purpose of /etc/resolve.conf?
how do i assign an ip to my server (slackware) right now it seems to be keeping 192.168.0.105 everytime i start up however i do remember configuring my network to use a dhcp host (my router)
thanks a lot for help
 
Old 01-27-2006, 09:52 AM   #7
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Ok lets reitterate -

Your router has two networks attached to it. One is the network connecting you to your ISP and has a public ip address. i.e. one that is recognised by any host on the internet.
The other connects to your LAN which is using the network 192.168.0.x. This is a network in the reserved range of 192.168.0.0 to 192.168.255.255. Any networks in this range do nt exist as far as the internet is concerned. This allows you to use these addresses in your private network and still connect out to internet hosts without fear of address conflicts.

Now obviously for outgoing connections from your PC to the internet, the internet must perceive them as coming from your public address not your private one, or return packets will never get to you. Remember 192.168.0.x doesn't exist on the internet.

This function of pretending that your outgoing connection is comming from your public address is called Network Address Translation or NAT and is performed on on the router. All outgoing packets are edited to show the public address as source. All incomming packets are edited to show the private address as destination.

To make configuring your LAN easier your router is acting as a DHCP server. This allows your PC's to dynamically configure themselves with address info from the server when they boot up. The router will probably be handing out addresses in the range .100 to .254 or something like that. If you want to fix your PC's IP address you need to disable DHCP on the PC and manually configure an address into it. If you pick something in the .50 to .99 range you won't risk any conflict with a DHCP configured device

Another peice of info that your dhcp server will be handing out is a DNS server or nameserver. DNS is the system by which your PC converts names into IP addresses for you, allowing you to type www.google.com and actually connecting to 219.132.6.45 or whatever.

If you switch DHCP off then your PC's will no longer learn the nameservers to use at bootup from the DHCP server. So like the IP address this needs to be manually configured on the PC and resolv.conf is where this information is kept.

How exactly you configure IP addresses and nameservers is dependant on your distribution. If it has configuration tools, like Suse's YaST then use them. If not you will need to edit config files with vi or something.
 
Old 01-27-2006, 11:15 AM   #8
mengsk
LQ Newbie
 
Registered: Jan 2006
Location: Alberta, Canada
Distribution: Slackware
Posts: 16

Original Poster
Rep: Reputation: 0
thanks a lot for the explanation it all makes sense now
So I need to add lines to resolv.conf that will tell my computer its ip and what nameservers to use. Ok I'll look into that when I get home.
Is there any other file i need to modify to tell my computer not to use DHCP or is it all in resolv.conf?
Also what nameservers do I need to configure my computer to use and how would these lines look in resolv.conf.
I really appreciate all the help. Thanks.
 
Old 01-27-2006, 11:24 AM   #9
Jelle
Member
 
Registered: Feb 2004
Location: Utrecht, The Netherlands
Distribution: Debian
Posts: 79

Rep: Reputation: 15
No, resolv.conf is for resolving domain names into ip numbers. Where you can set your network settings depends on your distibution(fedora, SUSE, Debian, etc...). Use the tools of your distro to do that. As I don't know what distro you have, I cannot tell you how to proceed, but if your distro is Debian or Debian-based, you can find and edit your network settings in /etc/networking/interfaces.
So: post your distro and maybe some kind soul will tell you how to change your network settings.
 
Old 01-27-2006, 11:51 AM   #10
Plauderer
LQ Newbie
 
Registered: Sep 2004
Posts: 6

Rep: Reputation: 0
You started the thread by asking how to determine your external IP. In that case you might find this link usefull www . whatismyip . com It will tell you your IP.

Plauderer

P.S.: Stupid board won't let me post URLs for i haven't posted more than 5 posts yet.
 
  


Reply



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
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
C++: difference between static method variable and static class variable? Thinking Programming 3 01-16-2006 10:08 AM
Is there any static ARP for static IP network? linux_lover2005 Linux - Networking 2 05-18-2005 12:01 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM
Qt static Zig Programming 1 07-09-2003 11:23 PM

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

All times are GMT -5. The time now is 11: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