Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What I'm going to ask may be trivial but I really need to understand cause my teacher is confusing me!

That's the problem. I got 2 private networks

  • The first is a class C network and the address is 192.168.1.0/24 (I'll call this C1)

  • The second is a class A network which I divided in two subnets: 10.1.0.0/16 (A1) and 10.2.0.0/16 (A2)

Now I got one router between A1 and A2, and another between A2 and C1. I've configured the routing so that packets can go from A1 to A2 and from A2 to C1. Then teacher told me: "Router between A1 and A2 is ok, but A2 and C1 can't communicate cause they are different networks! You need to set up NAT in that router."

And here is the question: why do I have to use NAT here? I can't figure out why NAT is needed between two private networks!

Thanks for your help

share|improve this question

migrated from stackoverflow.com Nov 13 '10 at 1:37

This question came from our site for professional and enthusiast programmers.

1  
This really isn't programming-related... but at any rate if your teacher is just trying to convey concepts, I'm almost positive that those addresses aren't routable by the standards. –  San Jacinto Nov 11 '10 at 18:33
2  
@San Jacinto: Actually, they are not routable outside of the organization (enterprise is the wording on RFC 1918), but they are perfectly routable inside the organization. –  ninjalj Nov 11 '10 at 19:10
    
@ninjali In my poor wording, that's what I was getting at. Thanks. –  San Jacinto Nov 11 '10 at 19:11
1  
So if they're "perfectly routable inside my organization", there is no reason it can't work without NAT. Am i right? –  synasius Nov 11 '10 at 20:33
2  
@Synasius, correct you don't need NAT at all; also try your hardest to forget the Classes, they were antiquated 16 years ago by CIDR. –  Chris S Nov 13 '10 at 1:56
add comment

4 Answers

up vote 4 down vote accepted

To start, your teacher is wrong. On a side note: S/He should be reprimanded for even teaching Classed Networking, that was antiquated 16 years ago. It should not be taught, period (except in History class).

You do not need NAT in this case at all. Your three networks do not interface with the public Internet, and they are all using internal IP ranges.

NAT would be necessary if your networks were communicating with the Internet because your Internal IP ranges will not work on the Internet. Only non-Internal IPs work on the Internet. The NAT device takes a single (usually) Internet IP and allows the computers with Internal IPs to "fake" it (communications to the Internet will use the valid IP, and the NAT device keeps everything straight).

share|improve this answer
    
Thanks a lot Chris! I felt something was wrong in what teacher told! Now I have no more doubt, and i'll do my best to forget Classes! actually i'm reading "O'Reilly - TCP IP Network Administration 3rd Ed.". Is it good? –  synasius Nov 13 '10 at 11:25
    
I don't think I have that particular book, but I do have several book shelves dedicated to O'Reilly animal books because it seems they're always good. TCP/IP has been around for so long now that most of the books out there are really good references. –  Chris S Nov 13 '10 at 23:52
add comment

Hai synasius,

I would like to suggest you to go through the following urls which may give a clear idea why your teacher had told like that?

http://192-168-1-2.org/how-nat-works.html

http://technet.microsoft.com/en-us/library/cc756722%28WS.10%29.aspx

http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094831.shtml

share|improve this answer
    
THanks a lot for your links! Now i'm reading the RFC but still can't understand what my teacher told. –  synasius Nov 11 '10 at 20:37
    
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Mark Henderson May 21 '12 at 6:06
add comment

I think you need to use NAT just if want to access from private network to public one,

and you can use it to access resources of a private network from other private one.

share|improve this answer
    
I know I "can" use it between private networks, but I do not understand why he says "I must use NAT" otherwise it doesn't work between two different private networks.... but it works without NAT between two subnets on the same network. –  synasius Nov 11 '10 at 20:25
1  
Yep, you're right, that's exactly what I meant with "can", in your scenario and to make the connection up(between this two networks) there's no need to use NAT, routing will suffice. –  Prograministrator Nov 11 '10 at 22:34
add comment

Prograministrator was mostly right in his response, but let me be a bit more verbose...

Private addresses like 192.168.x.x and 10.x.x.x are only meant to be used within a local area network, not anywhere else. This is because they're highly overloaded. Millions of computers right now are simultaneously using the address 192.168.1.100. But that's okay, since NAT lets them do that. They only use that address when talking inside their own LAN. But when you talk outside the LAN, you have to use a public address.

While, strictly speaking, it's POSSIBLE to have two different network expose their internal addresses to one another and communicate that way, it's a very bad way to set it all up. Always assume that private IP's should not be seen anywhere outside their network.

What you should do instead is attach all the hosts in a network to a router and have them all NAT to one single public IP address.

share|improve this answer
    
It's only possible to use expose Internal IPs across the Internet when they are encapsulated or otherwise obfuscated by some sort of translation mechanism. I don't think it's even worth mentioning to someone who's learning IP still. –  Chris S Nov 13 '10 at 1:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.