Re: 2 routers
- From: ibuprofin@xxxxxxxxxxxxxxxxxxxxxx (Moe Trin)
- Date: Wed, 30 Aug 2006 19:13:53 -0500
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
.
- References:
- 2 routers
- From: miguel-lopes
- 2 routers
- Prev by Date: Re: Gnome windows management
- Next by Date: Re: Problem with Nedit
- Previous by thread: Re: 2 routers
- Next by thread: Need a good XML editor
- Index(es):
Relevant Pages
|