Re: routing within the same network? is it possible?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes you can.

Think of this.

As this mail says, routing is to move packets between two different networks.
Thats right.
Ill just let aside the theory and all that bored stuff.

Now, very very very very basic, how you define a network?

with a network address and a mask.

How packets gets routed? by the more specific address.

So, 192.168.0.15/32 and 192.168.0.16/32 will be more specific than the lan. so
there will be routing. Layer 2 will be who take the packet and carries it to the
next hop.


So its perfectly legal and believe me that it works if you put a more specific
static for a connected lan.

An example

my connected lan is 192.168.0.0/24

now, i have in 192.168.1.12 a box with 2 interfaces with some connected
addresses from this lan (13,14,15), if this addresses are configured in the
interface, theres no need for routing, because the box accepts arp requests for
13,14,15 and layer 2 will have the information to switch packet to those
addresses.

But, what if those addresses are not configured and are just simple used for nat
(for example), there is no arp request and arp reply for those addresses, so L2
will not know how to reach those destinations.

In this case you can instruct L3 to reach those destinations (yes, routing) like
this

just if youre using iproute2 just type

ip route add 192.168.0.13/32 via 192.168.0.12
ip route add 192.168.0.14/31 via 192.168.0.12

when a request for 13,14,15 need to be passed, there is no arp entry for those
addresses, so it will check L3 information that is the routing table in this
case, it will find 192.168.0.12/32 as next hop for those addresses, so it will
check for a arp entry for 192.168.0.12 (that really exists) and will switch the
packet with

destination mac > the one that belongs to 192.168.0.12
destination ip address > 13,14,15

hope this helps



----- Original Message ----- 
From: "Yemi Fowe" <foweyemi@xxxxxxxxx>
To: "Victor Catten" <vlcparis@xxxxxxxxxxxxx>; <lartc@xxxxxxxxxxxxxxx>
Sent: Saturday, June 12, 2004 9:39 AM
Subject: Re:  routing within the same network? is it possible?


> With my little knowledge of TCP/IP, i dont think
> routing withing thesame network is possible.
> Routing means moving from one network to another.
> Thank You
> Yemi
>
>
> n--- Victor Catten <vlcparis@xxxxxxxxxxxxx> wrote:
> > Hello,
> >
> > Is routing within the same network possible?
> > If it is, what configuration should I put for the
> > firewall/router shown below? I basically want the
> > host debian13 to be able to send packets via a
> > multi-homed firewall. I think the multi-homed
> > firewall involve some routing.
> >
> > +-------------------+
> > |debian13           |
> > |eth0:192.168.0.13  |
> > +-------------------+
> >          |eth0
> >          |
> >          |eth0
> > +--------------------------+
> > |firewall/router(linux-box)|
> > |which configuration here? |
> > +--------------------------+
> >          |eth1
> >          |
> >          +----------------------+
> >          |                      |
> >          |eth0                  |eth0
> > +-------------------+  +-------------------+
> > |eth0:192.168.0.15  |  |eth0:192.168.0.16  |
> > |debian15           |  |debian16           |
> > +-------------------+  +-------------------+
> >
> >
> > Thank you!
> >
> > Victor
> > _______________________________________________
> > LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
> > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
> http://lartc.org/
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/
> _______________________________________________
> LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>

_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux