Solved

Routing

Posted on 2004-04-06
9
366 Views
Last Modified: 2012-04-17
I have two machines A,B in different networks
A ----->192.168.1.0/24
b------>192.168.0.0/24
I want to access one from the other.For this I havae creaed a static route for machine A in machine B.

In Machine  B
route add 192.168.1.1 dev eth0
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1


In machine A
route add -net 192.168.0.0 netmask 255.255.255.0 dev eth0
Now I am able to connect from one to other.

Is there any other way to accomplish my task apart from static route?
Basically i want to connect to other network without using static route concept.How to do that?.
0
Comment
Question by:palanisaravanan
  • 3
  • 2
  • 2
  • +2
9 Comments
 

Author Comment

by:palanisaravanan
ID: 10772129
I enabled IP forwardin in both the sides.There is no filre wall b/w the networks
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10773058
What you have done is not clean at all :-))))

You force routes that should not be forced this way. So, there is no good method for doing this appart from static.

You could change the netmask on all the boxes from both networks to 255.255.254.0. This way, you would not have to do routing.

0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10792781
Are you trying to have one of these systems act as a gateway router between it's network and the other network?
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10792787
Sorry, that "it's" is supposed to be "its".
0
Save on storage to protect fatherhood memories

You're the dad who has everything. This Father's Day, make sure your family memories are protected. My Passport Ultra has automatic backup and password protection to keep your cherished photos and videos safe. With up to 3TB, you have plenty of room to hold the adventures ahead.

 

Author Comment

by:palanisaravanan
ID: 10804460
Yes exactly karwilbur.sorry for the misunderstanding in my question.I will explain it briefly.

My network is like this


I  have 4 Linux machines(Debian woody) A,B,C.
A and B are in same network.(192.168.1.0/24 )
C and D  are in diffrent network.(192.168.0.0/24)

                                               
                                     192.168.1.1/24                   192.168.0.1/24
       A  ------------------> B                                            C <----------------------D
      192.168.1.2/24      |                                              |                   192.168.0.2/24      
                                       |__________________________|
                                       
B and C are configures as gateways.

For A   , machine B is the default gateway.
For D ,   machine  C is the default gateway.
    Now I want to connect From machine A to Machine D and vice versa using their respective gateways(B and C).
                   MY routing is like this
In machine A
---------------------
     route add    default gw 192.168.1.1
In machine D
---------------------
  route add default gw 192.168.0.1
 In machine B(gateway)
---------------------------------    
route add -net 192.168.0.0 netmask 255.255.255.0 dev eth0

In machine C(another gateway)
-------------------------------------------
      route add 192.168.1.1 dev eth0
       route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0

    -----  After this I am able to connect from one network to another.
  One of my friend said that These two networks are not physically separarted.By routing only I separated the network.He said another way of routing is there.I searched on net.But didn't get any ideas.Can Any network guruz  help me.
Sorry for the delay in posting





0
 
LVL 9

Expert Comment

by:Alf666
ID: 10804598
As I said, this is not clean at all.

If you want to avoid static route, and all your boxes are on the same network, just change the subnet mask.

Choose 255.255.255.254. This way, all your boxes will be on the same "network", and you will not have to route.
0
 

Author Comment

by:palanisaravanan
ID: 10804989
Let us forget the word static route in my thread starter.
How to route in the above mentioned scenario?.
0
 
LVL 1

Expert Comment

by:jainrah
ID: 10845232
You mention in your post that you did achieve to route the packets. So that is the first way of doing routing which is correct. Yes this is static because if there is any change in the network you will have to manually change the settings.

If you want that the router should learn of any change in the network and update its tables accordingly, then you should use any of the routing protocols. The simples that should fit for your needs is RIP. Here is what you will need to do.

Type the command "routed" in a terminal window on all the computers. The computers will then communicate and build the routing table. You can provide a default route for the host machines seprately if you wish.
0
 
LVL 1

Accepted Solution

by:
greg14unix earned 250 total points
ID: 10947937
The quick way to get this done is by runnig routed on the gateway host ( B, C ) and set the gateway on the outside host ( A, D ) to point to the host you are using as gateways.  Routed will enable the routing damon on the systems and start using RIP as its routing protocol.  Routed should detect the two networks it is connected to and route packets between it and the other routers( the other gateway host running routed ) runnig the RIP routing protocol.  Also, routed should automatically exchange routing info between the two host, giving you dynamic routing tables instead of the static setup you currently have.  


Hope this help :)
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Only Allow Access to an HTTPS webpage via Squid Proxy 7 319
Redhat Linux 6.6 and LDAP 18 112
How to minimize the path of packets to my application? 3 71
installed old nagios.... 13 112
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now