LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2008, 10:18 PM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
I got a fundamental question about ip addresses


I have some computers behind a router at my apartment. I understand some fundamentals about ip addresses. I setup a web server on one of those computers. I unfiltered port 80 on that computer and on the router, I port forwarded http requests on port 80 to the internal ip address of that computer that's running the web server.

My question is.

I noticed that in order to view that web page outside of the network, I'd put in the external ip address of the router, which would forward the http request to port 80 on that computer running a web server. So are the external ip addresses for the router and the computers behind the router the same? I mean, I went to www.whatismyip.com on each of those computers behind the router at my apartment and they all had the same external ip address as the router.

For instance, let's say the internal ip address of one computer is 192.168.1.103

How would I get to that computer from outside the network without having the router port forward the request?

Would the external ip address of that computer with the internal ip address of 192.168.1.103 be something like 34.83.42.11 (external ip address of router, fake btw) plus something appended to it. Maybe like
34.83.42.11 3321 ?

How do I find out the distinct external ip address of that computer? Does it depend on the netmask or something?

Could somebody explain this?
 
Old 05-29-2008, 10:27 PM   #2
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,155

Rep: Reputation: Disabled
Quote:
How would I get to that computer from outside the network without having the router port forward the request?
You cannot.

http://en.wikipedia.org/wiki/Network...ss_translation
 
Old 05-29-2008, 10:57 PM   #3
centralb
LQ Newbie
 
Registered: Jan 2007
Distribution: Redhat, Debian, "Custom"
Posts: 27

Rep: Reputation: 15
In your situation, your ISP is effectively giving 1 public IP address to your router.

That is the only public IP address involved here.


All the computers INSIDE your network (behind the router) have *private* IP addresses used for local networking. Those addresses only work inside the router.


Forwarding allows outside systems to start communications with only the inside computers that have router ports forwarded to them.
 
Old 05-30-2008, 09:52 AM   #4
gzunk
Member
 
Registered: Sep 2006
Posts: 89

Rep: Reputation: 20
Also, if packets addressed to private IP addresses are encountered by routers on the internet, they are supposed to drop them. See http://www.faqs.org/rfcs/rfc1918.html, Section 3 for more details.
 
Old 05-30-2008, 08:11 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,706
Blog Entries: 4

Rep: Reputation: 3030Reputation: 3030Reputation: 3030Reputation: 3030Reputation: 3030Reputation: 3030Reputation: 3030Reputation: 3030Reputation: 3030Reputation: 3030Reputation: 3030
Consider for a moment what a router actually does, and how it does it.

You've got three or four computers on one side of the router, all talking to the Internet through one cable that hooks into your cable-modem or DSL line. You have one IP-address as seen by the Internet: all three or four computers are all using the same (Internet-facing) IP.

How does this work? In exactly the same way that a gigantic company can have just one external phone number. When you want to talk to Joe Schmedly, you call that number and ask for extension 12345, Joe answers.

In TCP/IP parlance, that "extension" is called a port number. The various outbound packets that are sent by the various computers inside your shop are seen as coming from (and being directed to) specific port-numbers. All of this magic is handled invisibly by the Router.

On the inward-facing side, the Router can route packets directly from one computer to another, if those addresses are "inside." Various addresses, like "192.168.x.x," are by-convention defined to be "inside only." It also defines one internal IP-address for the so-called "gateway." That's how outward-bound traffic gets delivered to the Internet.
 
Old 05-31-2008, 05:06 AM   #6
culaterout
Member
 
Registered: Jul 2006
Location: colorado
Distribution: Debian, Arch Linux, Linux Mint, Ubuntu, Fedora, Suse, Mepis, Redhat, Sayabon, mandrake and android (
Posts: 189

Rep: Reputation: 29
Quote:
Originally Posted by sundialsvcs View Post
Consider for a moment what a router actually does, and how it does it.

You've got three or four computers on one side of the router, all talking to the Internet through one cable that hooks into your cable-modem or DSL line. You have one IP-address as seen by the Internet: all three or four computers are all using the same (Internet-facing) IP.

How does this work? In exactly the same way that a gigantic company can have just one external phone number. When you want to talk to Joe Schmedly, you call that number and ask for extension 12345, Joe answers.

In TCP/IP parlance, that "extension" is called a port number. The various outbound packets that are sent by the various computers inside your shop are seen as coming from (and being directed to) specific port-numbers. All of this magic is handled invisibly by the Router.

On the inward-facing side, the Router can route packets directly from one computer to another, if those addresses are "inside." Various addresses, like "192.168.x.x," are by-convention defined to be "inside only." It also defines one internal IP-address for the so-called "gateway." That's how outward-bound traffic gets delivered to the Internet.

Like that simple explanation


I still like to use Airport explanation

meaning The tower controls the airplanes from landing so u wouldn't want two airplanes to land on same run way or you have crash.... same idea two packets addressed to two different computers cant land on the same computer or a crash session...


But I like that........ great idea
 
Old 05-31-2008, 05:42 AM   #7
seraphim172
Member
 
Registered: May 2008
Posts: 101

Rep: Reputation: 15
IP addresses starting with 192.168 are always private. There is also a range below 172 that is private (can't remember now). 127.0.0.1 is also private, it's the current machine.

You need port forwarding because everything from the outside is addressed to your public address, and you have to direct it to the proper PC on your private network. In your case a public web server, due to port 80.

Linux Archive

Last edited by seraphim172; 06-25-2008 at 05:49 AM.
 
Old 05-31-2008, 05:50 AM   #8
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by seraphim172 View Post
There is also a range below 172 that is private (can't remember now)
10.x.y.z .
 
Old 05-31-2008, 08:59 AM   #9
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Original Poster
Rep: Reputation: 69
What would happen if you're on a computer that is outside my network and you receive packets from one of the computers in my internal network?

Let's say the computer from outside the network receives packets from computer A in my internal network trying to view a web server on the computer outside the network on it's port 80. In the packet logs, it'll show that the packet came from the router's public address.

However, what if the computer from outside the network receives another packet from computer B in my internal network trying to view a web server on the computer outside the network on it's port 80. In the packet logs, it'll show the packet came from the router's public address right? Would the source ip look any different at all?

Cause I think I remember seeing some number appended to the end of the source ip address specifying that private computer.

I'd test it out, but I don't have an external computer to use atm.

Last edited by trist007; 05-31-2008 at 09:01 AM.
 
Old 05-31-2008, 09:17 AM   #10
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,155

Rep: Reputation: Disabled
I see you didn't bother to read the Wiki article I linked to.
 
Old 05-31-2008, 10:15 PM   #11
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Original Poster
Rep: Reputation: 69
Had only scanned, but I just read it right now. Might get rid of my router and replace it with a firewall with ips.
 
Old 06-02-2008, 01:38 AM   #12
culaterout
Member
 
Registered: Jul 2006
Location: colorado
Distribution: Debian, Arch Linux, Linux Mint, Ubuntu, Fedora, Suse, Mepis, Redhat, Sayabon, mandrake and android (
Posts: 189

Rep: Reputation: 29
lol keep the router


later....
 
  


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
Binding 2 NICs (MAC addresses) to 2 IP Addresses in same Subnet RedHat EL4.0 skhira Linux - Networking 13 02-24-2008 09:16 PM
A fundamental .... expatCM Linux - Server 3 06-09-2007 09:35 PM
[Question] Round-robin with multiple IP addresses? DukeLeto Linux - Networking 1 09-08-2006 12:25 PM
fundamental open-mosix question TomalakBORG Linux - General 2 08-04-2006 06:28 PM
Fundamental Question in C and C++ linux_ub Programming 5 07-28-2004 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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