LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 06-30-2003, 10:10 AM   #1
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Rep: Reputation: 35
Simple Network Setup -- 2 Routers


This is not a Linux question per se. I am trying to set up a simple network with 3 Linux boxes and two routers.

One box is a server and will be exposed to the internet. The other two boxes are workstations. I want the two workstations to have access to the internet, each other, and to the server box, but they will be behind their own router/firewall for security.

Here is a simple diagram:

...........Internet
................|
...........Router 1
.........../............\
Server Box............Router 2
........................./............\
..............Workstn 1......Workstn 2

I realize there are other configurations to accomplish the same thing, but this is the one I want to set up (2 subnets).

I do not have much knowledge of subnetting. Please help.

Router 1 acts as a DHCP server assigning internal IP addresses to the Server Box and Router 2.

Questions:
- Subnet Mask at Router 1 needs to be 255.255.255.192, right?.
- Do I set the subnet mask at Router 2 to 255.255.255.0?
- Do I set Router 2 acts as a DHCP server assigning its own internal IP addresses to the two Workstations?
- I'm a little confused about what all the IP addressed will be. Specifically, if I'm at one of the Workstations, what is the IP address of the Server Box? (ie, is it the same internal IP address that Router 1 assigned it?)

Note: I don't really want to run a DNS server if I can avoid it.

If you know of a link where I can see this exact example, please provide it.

Thanks in advance.
Apollo
 
Old 06-30-2003, 10:47 AM   #2
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
* The netmask at router 2 can be whatever you want it to
be.
* I think you're right that dhcp would have to reside on the second router.
* yes the server box will have the same address as the router1 assigns to it. No the server box will not necessarily have an ip equivalent to the workstations.

Router1 could contain a subnet of lets say 192.168.1.0 w/ netmask 255.255.255.128.

then server1 would have ip 192.168.1.1 and router2 would have ip 192.168.1.2

then router2 could contain a subnet of 192.168.5.0 w/ netmask 255.255.255.0
and workstation1 could be 192.168.5.1
w/ workstation2 = 192.168.5.2

hth
jpbarto
 
Old 06-30-2003, 11:25 AM   #3
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
Thanks for the quick response.

Ok, you say "No the server box will not necessarily have an ip equivalent to the workstations."

Here's my main dilemma:
I'm running an email server (SMTP, IMAP, and POP3) on the Server Box. When accessing email from the workstations, I would prefer all the traffic stayed local (internal to Router 1 -- much faster and more secure). Can I access the Server Box from the workstations without using my external public IP address? Ideally, using your example, this would be 192.168.1.1 (Server Box). But, if I understand this correctly, anything like 192.168.xxx.xxx can't get from the workstations to outside of Router 2. Am I right? Or from the workstations would 192.168.1.xxx be a valid address external to Router 2, but not 192.168.5.xxx? (again using your example addresses).

I'm just trying to pin down a way to keep SMTP, POP3, and IMAP traffic between the workstations and the Server Box internal.

Many thanks,
Apollo
 
Old 06-30-2003, 12:41 PM   #4
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Here's one way, if's and but's mind you.


Note: Subnet mask stays the same for everything 255.255.255.192

First subnet goes from 192.168.1.65-192.168.1.126 (useable)
Network address 192.168.1.64
Broadcast address 192.168.1.127



Second subnet goes from 192.168.1.129-190 (useable)
Network Address 192.168.1.128
Broadcast address 192.168.1.191


Router 1 Internal 192.168.1.65 (Gateway)

Server 192.168.1.66



Router 2 External 192.168.1.67
Internal 192.168.1.129 (Gateway)

IP's for workstations 192.168.1.130-190
 
Old 06-30-2003, 01:53 PM   #5
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
Thanks Looking_Lost. I think that's exactly what I need.

Here's a more simple configuration I have tried. Please tell me what's wrong with it:


....................Internet
.........................|
....................Router 1
................... (192.168.0.1, sn Mask 255.255.255.0)
...................../......................\
.........(192.168.0.2)..........(192.168.0.3)
...........Server Box..............Router 2
.........................................(192.168.1.1, sn mask 255.255.255.0)
............................................/............................\
...............................(192.168.1.2)................(192.168.1.3)
...............................Workstation 1...............Workstation 2

The workstations cannot access anything external to Router 2, including the internet and the Server Box. Any ideas why?

Thanks for the help,
Apollo
 
Old 06-30-2003, 02:23 PM   #6
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
if you're hard coding these IPs into the machines are you remembering to plugin addresses like DNS and gateways?
 
Old 06-30-2003, 02:53 PM   #7
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
I hard coded nothing. All addresses shown in my last example were assigned by the routers with DHCP.

Here's some info from Router 2 configuration page:

"INTERNET"
WAN IP: 192.168.0.3
Gateway: 192.168.0.1
subnet mask: 255.255.255.0
Both primary and secondary DNS entries appear and look fine.

"GATEWAY"
IP address: 192.168.1.1
subnet mask: 255.255.255.0

Everything looks ok to me. Unless I am not understanding the effect of subnet mask 255.255.255.0. Please confirm. This subnet mask will keep 192.168.1.xxx traffic internal to Router 2's network. All other traffic, including 192.168.0.xxx will be passed to Router 1 to handle.

Disabling Router 2's firewall makes no differenct. Can you see where I have gone wrong?

Thanks! I am learning a lot today.
Apollo
 
Old 06-30-2003, 03:09 PM   #8
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
Or does subnet mask 255.255.255.0 on Router 2 apply to the WAN address 192.168.0.3 and not Router 2's internal address 192.168.1.1? That could be my problem. Is that it?
 
Old 06-30-2003, 03:28 PM   #9
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
no that looks right to me. router2 when it recieves a packet from .1.3 destined for .0.2 should route it out to its gateway (.0.1). looking_lost?
 
Old 06-30-2003, 07:24 PM   #10
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
I guess my way falls in it's face too yah?

If so I've a feeling it's cos when it's 192.168.0 tries to respond to 192.168.1 then cos it's on a different network it's firing it out it's gateway into oblivion,probably same thing will happen with mine. What happens if you connect them using one of the normal presumably switched ports instead of the uplink one ? Just curious, going to catch a plane soon so I won't be around for a while.
 
Old 06-30-2003, 08:18 PM   #11
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Forget what I said about gateways and stuff as I single handedly take it upon myself to rewrite NAT All we know it ain't working...I must holiday.
 
Old 06-30-2003, 09:55 PM   #12
Apollo77
Member
 
Registered: Feb 2003
Location: Toronto
Distribution: RH8 / FC1 / Gentoo / Debian / FreeBSD / Centos / Ubuntu
Posts: 182

Original Poster
Rep: Reputation: 35
jpbarto and Looking_Lost. Guess what? I started thinking there is no reason this shouldn't work. Hardware? So, I reset Router 2 to factory settings and rebooted it. Arggghhhh! Hardware!

The network functions flawlessly now.

If it's any consolation, I learned a lot today. I very much appreciate your input on this.

Apollo
 
Old 07-01-2003, 10:14 AM   #13
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
networks can be a lot of fun to play with. and you're right you always learn alot when messing with em. I just started playing with wireless networks about a month ago. Fun part is securing em.

jpbarto
 
  


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
simple network setup nenyo Linux - Software 2 02-12-2005 08:39 PM
How do I setup a simple name server? jrbush82 Linux - Networking 4 07-18-2004 09:14 PM
Simple network setup filburt1 Linux - Wireless Networking 12 03-15-2004 09:44 PM
ADSL Routers Setup- Microsom Deskporte router 100 and Planet ADSL modem router mabonline Linux - Hardware 1 02-27-2004 06:36 PM
Questions on routers and network ZhiYi Linux - Networking 1 05-20-2003 11:19 AM


All times are GMT -5. The time now is 02:55 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration