LinuxQuestions.org
Help answer threads with 0 replies.
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 07-22-2004, 02:49 PM   #1
ctrylace
LQ Newbie
 
Registered: Jul 2004
Location: Missouri
Posts: 1

Rep: Reputation: 0
Question Setting up Static Route for two Networks


I am running a closed network which is connected to another closed network. I am trying to create a static route or some other way to get thru gateway to other network and other network can get back to mine. If I could draw a picture, it would be easier to explain, but let me try.

My Internal network say has static IPs in 999.16.21.XXX
(not my real IPs obviously)

I have a 'netrouter' set up with two NIC cards

eth0 999.16.21.7

eth1 888.16.24.10

Both connected to a switch which is linked to external connection.


My gateways are 999.16.21.1 for internal network and 888.16.24.1 for external network

So how do I set up my netrouter so my internal network computers when they go to internal gateway get static routed to the external gateway and vice versa, so I can get to systems outside my network and they can get into mine?

Right now for that to happen, I have to set up an alias for the PCs NIC card so it thinks its on the external network.

And if I ad more internal networks, such as 777.16.21.XXX, how would I add that static route? would I need a 3rd NIC card in my netrouter?

Now thats as clear as mud, Please Help!
 
Old 07-23-2004, 02:41 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
I don't quite understand?
Quote:
eth0 999.16.21.7
eth1 888.16.24.10
Both connected to a switch which is linked to external connection.
My gateways are 999.16.21.1 for internal network and 888.16.24.1 for external network
eth0 and eth1 goes to one switch each, right? Or do you really mean they are connected to the same switch?
eth0 is internal, eth1 external - the switch on eth1 then is on the other closed network?

About the routing:
You set one default gateway on the computers = 999.16.21.1 and on the router 888.16.24.1
That should be all needed.
--------------------------------------------
STOP!
Now I think I understand!
Netrouter with 2 ports, connects to two switches.
Switch 1 connects to 999.16.21.0 + outside.
Switch 2 connects to 888.16.24.0 + outside.

I find it a bit strange to connect to the outside via the switches. I would suggest a third nic in the netrouter which connects to the outside. Makes config easier and safer.
But it should work the way you have it, only thing is netrouter must have one default gateway so only one outside-connection will be used if you go via the router.
There could be a way to filter this though, by using ptables on the router.
I haven't used iptables that much, can't tell you how.

You could also set the routes in the switch (if it handles different networks it must be able to route). Default = port to outside, only internal traffic will go via the netrouter.

Last edited by pingu; 07-23-2004 at 02:58 AM.
 
Old 07-23-2004, 03:18 AM   #3
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
I've been doing some thinking again...
(Yes, I am a bit tired! Three beers and a whisky yesterday, too late in bed and still had to get up at 6 am...)

Your switches can't route - that's why you need those alias-IP's. (If you don't know whether they can or not, look at the price tag. Switches that also can do routing are not found among the cheapest.... )
This means you definitely should connect to outside via netrouter.
 
  


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
how to route internal Networks by IP tables? quazidaniel Linux - Networking 4 10-12-2005 10:32 AM
Help with static route noinfo Linux - Networking 1 10-05-2005 11:40 AM
route command help connecting two windows networks sra Linux - Networking 1 09-28-2005 03:15 PM
can't route/ping between networks ender03 Linux - Networking 21 02-01-2005 06:14 AM
Two networks - one route out diveguy Linux - Networking 5 08-29-2002 05:36 PM

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

All times are GMT -5. The time now is 10:07 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
Open Source Consulting | Domain Registration