Hello ,
Thanks for the prompt response !
I append my original posting at the end, but
to make a long question short this was my problem:
How to make two machines connected on the same physical
network, but belonging to different subnets, talk directly
to each other without going via a router ?
The answers I received fell into three categories
1) By making the network mask more "open" one
could possibly merge the two subnets into a
single one.
2) Sweat it out and re-assign the IP numbers according
to the actual use.
3) It is indeed possible to add static routes
in the routing table that routes the traffic
directly as if they were sitting on the same
network. (As I noticed that the case was for Linux,
I just was not reading the man pages carefully enough.)
The first option is fine provided that the different
network numbers allow this. It is however not
the case for us, and was already considered. For the
sake of completeness I include a piece that explains
how this could be achieved.
Andrew Betteridge wrote:
[snip]
>
> the subnet mask is used by the routing software/hardware to determine what
> traffic is "local" and what isn't, local traffic goes to the destination,
> non-local traffic goes via the router
> a subnet mask of 255.255.255.0 tells the router software that any packets
> with the first 3 octects different to the source ip is NOT local.
> likewise a subnet mask of 255.255.0.0 tells the router software that any
> packets with the first _2_ octets different to the source ip is NOT local
> (see a pattern emerging here?)
> right, so if you got 2 subnets, say 192.1.1.X and 192.1.2.X, then your
> subnet mask for any machine that needed to talk to a machine in the other
> subnet would be 255.255.0.0, because you only need to blank out the first 2
> octets (the 192.1 part) of the ip address.
>
[snip]
The second option is not flexible enough and there are other
reasons why some machines require a specific IP number, e.g..
access to electronic journals etc.
That 3) is actually an option in DU as well,
however with a slightly different syntax, was pointed
out to me by: Mitch Kulberg, Tom Webster and Serguei Patchkovskii.
Serguei Patchkovskii wrote:
[snip]
>
>
> This exactly the situation we have: three class-C subnets
> sharing the same logical Ethernet segment. This is what I
> do on DU 4.0D:
>
> primary=`/sbin/ifconfig tu0 | `
> /sbin/route add -net XXX.YYY.81.0 -interface $primary
> /sbin/route add -net XXX.YYY.82.0 -interface $primary
> /sbin/route add -net XXX.YYY.80.0 -interface $primary
>
> Customize to taste, stick into /etc/inet.local, and voila! :-)
>
> /Serge.P
where the first line of the script just extracts the local IP number.
I however used /sbin/ifconfig -a because the name of the interface
is different on different machines.
Thanx a lot for your effort,
Per
-----Original Message-----
From: Per Andersson [mailto:per_at_physto.se]
Sent: Thursday, May 11, 2000 8:27 AM
To: tru64-unix-managers_at_ornl.gov
Subject: Another routing question
Hi,
Is there anybody out there who could explain this
for a relative newbee in this area ?
We have a switched LAN consisting of hundreds
of nodes divided into two subnets. Most nodes
are running DU 4.0d
For historical reasons the IP numbers for
the different subnets are randomly distributed
among the different user groups. As a consequens
of this two machines from two different subnets
connected to the same switch cannot talk directly
to each other, the traffic has to be routed, which
ofcourse increases the bandwith consumption.
The easiest way to solve this, I guess, would to
swap IP numbers, so they more correspond to the
actual use, however the prospect of having to
change hundreds of IP numbers is not daunting.
Recently I discovered on Linux (RH 6.0) that
one could add a static route for any subnet
to a given interface by the command:
route add -net aaa.bbb.ccc.0 netmask 255.255.255.0 dev eth0
(for interface eth0)
which means that the routing is not necessary on a
local network. Even if they belong to different subnets.
So now to my actual question, anybody still with me ... :-)
Is there a way to achieve a similar behaviour on
DU ? I have failed bitterly while trying this and
I have looked in the man pages and scanned the
archive but got nada.
cheers,
Per
--
*************************************************
* Per Andersson *
* Department of Physics, Stockholm University *
*************************************************
Received on Fri May 12 2000 - 17:50:18 NZST