Re: 2 routers



On Wed, 30 Aug 2006, in the Usenet newsgroup alt.os.linux.suse, in article
<QZ-dnYRna_VGy2jZRVnygw@xxxxxxxx>, miguel-lopes wrote:

Hello I have a linux Suse 9.3 installed and it is working fine but I have a
problem is how cam I serve 2 diferente networks.

Let me explain we have 2 routers 192.168.1.254 ( framerelay) and
192.168.1.252 (internet).

OK - where do those routers lead to? The world? Two computers in the
next room?

The default gateway on linux box is 192.168.1.254 and I want it to change to
192.168.1.252 because I want this machine to acces the internet and also
comunicate with the frame relay at the same time.

A "gateway" is a device that leads to another network. For example;

[example ~]$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 89948 eth0
192.168.2.0 192.168.1.6 255.255.255.0 UG 0 0 32165 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 388 lo
0.0.0.0 192.168.1.248 0.0.0.0 UG 0 0 2673 eth0
[example ~]$

Here, the local network is 192.168.1.0. There is _another_ network,
192.168.2.0. To reach hosts on that network, I must use the "gateway"
at 192.168.1.6. There is a second "gateway" at 192.168.1.248, and this
one can reach "the world". In the terms used in Linux networking, this is
the "default gateway". The term refers to the meaning "if no other rule
is correct, use this one". So - if I want to send packets to 192.168.1.21,
the first rule applies - the local network. If I want to send packets to
192.168.2.221, the second rule applies. While rule applies when I want to
send packets to 195.23.115.65? It is not the first, or second - certainly
not the third that will work. But the last rule - the default - says that
it can reach _EVERYWHERE_ (which is false - it can't reach 192.168.2.0 for
example). Your kernel looks at the routing table, and tries to match the
address with the most definitive netmask. Thus, 192.168.1.0 with a mask of
255.255.255.0 is better if the destination is 192.168.1.64 than the last
rule 0.0.0.0 with a mask of 0.0.0.0.

You can only have one default. If the destination is not on the first,
second, or third rule, use the last. If you had two (or more) defaults,
how would you choose which one to use? The kernel uses the rule that if
there are two routes to the same place (0.0.0.0/0.0.0.0 is "everywhere")
and the mask is the same - then use the last route.

How can I do this Thanks

If 192.168.1.254 does not lead to "the world" then it should not be the
default. You should specify the correct description of where the router
can take you - perhaps it only leads to those two computers down the hall,
or perhaps it leads to the university. Specify that. You can do this
using Yast.

If both routes lead to the world, then you need to use the Advanced
Routing HOWTO to set up policy routing - when will you use this route as
opposed to that route - when they both can reach the same destination.
See

-rw-rw-r-- 1 gferg ldp 297491 Sep 4 2003 Adv-Routing-HOWTO

Old guy
.



Relevant Pages

  • Re: AIX 1.3 Failures and Fables
    ... I don't know if 1.3 has SMIT or its equivalent but there should be some way to add a default gateway which is your router. ... is: route add 1.2.3.4 gateway ... Manually manipulates the routing tables. ... Is the destination host or network. ...
    (comp.sys.ibm.ps2.hardware)
  • Re: [SLE] connection redundancy
    ... which is the router just this side of the ... >>because it's own gateway is still up. ... You'll also need three network cards to put into this Linux box. ... your internal LAN can route packets to the Internet. ...
    (SuSE)
  • Re: AIX 1.3 Failures and Fables
    ... DESTINATION GATEWAY FLGS REFCNT USE INTERFACE ... Is my interpretation of the AIX 1.3 #man route correct? ... Manually manipulates the routing tables. ... Is the destination host or network. ...
    (comp.sys.ibm.ps2.hardware)
  • Re: Routing table problem
    ... I'm facing some routing table problem with XP O.S. ... server leg, 24.0 for published server leg, and XP clients have 16.0 leg. ... Moved my xp terminal to 24.0 network by adding ... timeout i didn't test that yet) and power back, the route table ...
    (microsoft.public.windows.server.networking)
  • Re: AIX 1.3 Failures and Fables
    ... I don't know if 1.3 has SMIT or its equivalent but there should be some way to add a default gateway which is your router. ... Is my interpretation of the AIX 1.3 #man route correct? ... Manually manipulates the routing tables. ... Is the destination host or network. ...
    (comp.sys.ibm.ps2.hardware)