Unusual Routing Question

Unusual Routing Question

Post by rg » Fri, 13 Sep 1996 04:00:00



I have a question about routing.

We have a network layout as in the diagram below. We have a linux server
connected to a Cabletron FN10 switch via a 100Mbs ethernet link(eth0). The
server will soon be connected to the outside world via a 10mbs ethernet
link (eth1) to a CISCO router. As you can see the Linux server has two
ethernet cards, one for the the 10 Mbs link to the outside and one for the
local 100Mbs link to the switch.

I have been reading all I can find about routing with Linux and I have
worked out how to talk to the intenet via the 10Mbs card but I am having
problems getting the internal networks (203.28.240.0, 203.28.241.0,
203.28.242.0) to talk to each other properly.

                                  ---------> University ---> Internet
                                 |
                                 |        |------->
                                 |        |------->
                    --------> Cisco Router|------->  Other nearby sites
                   |                      |------->
                   |                      |------->
                   |10 Mbs Ethernet eth1
  _________________|________________________________
 |                 |                                |
 v              -------   Linux Server/Router       v
Our            |       |  Firewall                 Our
Site            -------   203.28.241.1             Site
                   |
                   | 100 Mbs Ethernet eth0
                   |
               ----------
              |          | Cabletron FN10 24 port ethernet switch
               ----------
               ||||||||||
        ------- |||||||| ------------------
       |  ------ |||||| ----------------   |
       | |  ----- |||| ----------       |  |
       | | |  ---- || -------   |       |  |
       | | | |  ---  -----   |  |       |  |  
       | | | | |          |  |  |       |  |
       | | | | |          |  |  |       |  |
      [][][][][]         []  [] []      [] []  <- hubs with local computers
        Admin             Student1     Student2  * off them
     203.28.240.0      203.28.241.0   203.28.242.0

At present the Macintosh machines can quite happily use Appletalk to
communicate to each other throughout the entire campus. I believe this is
because they use the MAC address of each machine and the switch will
happily pass their packets. The problem occurs with IP communications. As
expected at present computers on each network can all talk to each other
happily, even if it means going via the switch , but they cannot talk to
computers on other networks (ie a computer on 203.28.241.0 cannot reach a
computer on 203.28.242.0). I have set up the linux box with the commands:

route add -net 203.28.240.0 netmask 255.255.255.0 dev eth0
route add -net 203.28.241.0 netmask 255.255.255.0 dev eth0
route add -net 203.28.242.0 netmask 255.255.255.0 dev eth0

This seems to allow a few computers to communicate across network
boundaries and the server is able to access all the networks. The problem
is that not all computers can communicate across the network boundaries.

I know the normal configuration is to have a separate ethernet card for
each network. Setting things up for a card for each network seems to be
well documented and obvious. That is what will happen for the connection
to the outside world, but we need to get working internal routing between
three networks via one ethernet card and a switch.

Can anyone help? Have I missed something, do I need to use a dummy device
or something, do I need to assign more than one IP number to the etho
ethernet card?

Richard

--
Richard Wraith
Department of Mechanical and Manufacturing Engineering
University of Melbourne
Parkville     3052
Victoria      Australia
Tel: (+61 3)/(03) 9344 7249
Fax: (+61 3)/(03) 9347 8784

WWW Home Page http://www.veryComputer.com/

 
 
 

Unusual Routing Question

Post by B.A.McCau.. » Fri, 13 Sep 1996 04:00:00



>Subject: Unusual Routing Question

It doesn't seem too unusual to me.  In fact the answer I'm about to
give is based on my general TCP/IP admn knowledge - I've never
actually done this with Linux.

I do however pose what I consider to be a more awkward question
towards the end of my answer.

Quote:> v              -------   Linux Server/Router       v
>Our            |       |  Firewall                 Our
>Site            -------   203.28.241.1             Site
>                   |
>                   | 100 Mbs Ethernet eth0
>                   |
>               ----------
>              |          | Cabletron FN10 24 port ethernet switch
>               ----------
>               ||||||||||
>        ------- |||||||| ------------------
>       |  ------ |||||| ----------------   |
>       | |  ----- |||| ----------       |  |
>       | | |  ---- || -------   |       |  |
>       | | | |  ---  -----   |  |       |  |  
>       | | | | |          |  |  |       |  |
>       | | | | |          |  |  |       |  |
>      [][][][][]         []  [] []      [] []  <- hubs with local computers
>        Admin             Student1     Student2  * off them
>     203.28.240.0      203.28.241.0   203.28.242.0

>At present the Macintosh machines can quite happily use Appletalk to
>communicate to each other throughout the entire campus. I believe this is
>because they use the MAC address of each machine and the switch will
>happily pass their packets. The problem occurs with IP communications. As
>expected at present computers on each network can all talk to each other
>happily, even if it means going via the switch , but they cannot talk to
>computers on other networks (ie a computer on 203.28.241.0 cannot reach a
>computer on 203.28.242.0). I have set up the linux box with the commands:

>route add -net 203.28.240.0 netmask 255.255.255.0 dev eth0
>route add -net 203.28.241.0 netmask 255.255.255.0 dev eth0
>route add -net 203.28.242.0 netmask 255.255.255.0 dev eth0

>This seems to allow a few computers to communicate across network
>boundaries and the server is able to access all the networks. The problem
>is that not all computers can communicate across the network boundaries.

What do these compters think is the netmask?  What do they think is
the default router?  A computer on network 203.28.240.0 with a netmask
255.255.255.255 and a default router 203.28.241.1 is going to find
life a bit tricky!

Try giving eth0 multiple addresses, one in each subnet:

ifconfig eth0 203.28.241.1 netmask 255.255.255.0
ifconfig eth0:1 203.28.240.1 netmask 255.255.255.0
ifconfig eth0:2 203.28.242.1 netmask 255.255.255.0
route add -net 203.28.240.0 dev eth0
route add -net 203.28.241.0
route add -net 203.28.242.0 dev eth0

Note: You don't should usually need to give the device and mask
explicitly on the "route" command.  I have just taken a look at
ip_forward.c I suspect that the kernel won't generate ICMP_REDIRECTS
if you have your routing table referring to eth0:1 and eth0:2.  Maybe
I'm wrong about this.  Maybe it's a bug.  Maybe there's a good reason
for doing it this way.  Does anyone care to comment?

Note: If you don't have 2.0.x kernel with IP aliasing you will have to
play about with dummy devices and proxy ARP.

Next make sure that machines on 203.28.240.0 think that their router
is 203.28.240.1 not 203.28.241.1.

--

 .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
 # ll  l\\  ~~~~ ~   ~ ~    ~ | http://www.veryComputer.com/~bam/


 
 
 

Unusual Routing Question

Post by B.A.McCau.. » Tue, 17 Sep 1996 04:00:00




Quote:>I have just taken a look at
>ip_forward.c I suspect that the kernel won't generate ICMP_REDIRECTS
>if you have your routing table referring to eth0:1 and eth0:2.  Maybe
>I'm wrong about this.  Maybe it's a bug.  Maybe there's a good reason
>for doing it this way.  Does anyone care to comment?

In private corresponance with reference to his original query about routing


>> I think you need to adjust your netmasks. The "240", "241", and "242"
>> networks are all really on 1 LAN segment (the switch is a lower layer
>> than IP). The problem is that the guys on te 240 net (with a netmask
>> of 255.255.255.0) think that the 241 & 242 "nets" are only reachable
>> through a router. The router in question (the linux box) is either
>> unwilling or inefficient about forwarding packets back out the
>> interface they came in.
>To me this makes the whole network accessable, whereas we would like to
>control the traffic in and out of the admnin network to some to degree for
>security etc.

Maybe this is the answer to my question as to why ip_forward.c does
not appear to check if a packet is being forwarded back to an *alais*
on the interface on which it arrived.

If you configure the way I said with the routing table on the Linux
box using eth0 for all outgoing packets then the Linux box will
generate ICMP_REDIRECT messages so only the *first* packet from each
machine will go via the router.  After that all other packets will go
direct (assuming the clients are configured/capable of respecting
ICMP_REDIRECT from their router).  This achieves the same as the other
person suggested but allows for machines that do not support
non-byte-aligned netmasks.

If on the other hand you don't explicitly set the routes via eth0 and
let them default to eth0:1 and so on then my reading of the kernel
sources is that while the kernel will still route the packets back out
the same physical interface it will not realise that it is doing so
thus there will be no ICMP_REDIRECTs generated.  This means all
packets between subnets will go via the router and thus can
potentially be filtered and/or accounted.

I've not had it confirmed that I have correctly understood
ip_forward.c, however if I have correctly understood ip_forward.c and
the reason why it behaves the way it does I think a comment should be
inserted into the source code to explain why it does not consider net
aliases as candidates for ICMP_REDIRECTs so that some well-meaning
person doesn't "fix" it in future.

Note: I wouldn't trust this mechanism for security unless you are
really sure people can't alter their subnet masks.

--

 .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
 # ll  l\\  ~~~~ ~   ~ ~    ~ | http://www.veryComputer.com/~bam/

>Organization: The University of Birmingham, UK.
>Lines: 82

>NNTP-Posting-Host: wcl-l.bham.ac.uk


>>Subject: Unusual Routing Question

>It doesn't seem too unusual to me.  In fact the answer I'm about to
>give is based on my general TCP/IP admn knowledge - I've never
>actually done this with Linux.

>I do however pose what I consider to be a more awkward question
>towards the end of my answer.

>> v              -------   Linux Server/Router       v
>>Our            |       |  Firewall                 Our
>>Site            -------   203.28.241.1             Site
>>                   |
>>                   | 100 Mbs Ethernet eth0
>>                   |
>>               ----------
>>              |          | Cabletron FN10 24 port ethernet switch
>>               ----------
>>               ||||||||||
>>        ------- |||||||| ------------------
>>       |  ------ |||||| ----------------   |
>>       | |  ----- |||| ----------       |  |
>>       | | |  ---- || -------   |       |  |
>>       | | | |  ---  -----   |  |       |  |  
>>       | | | | |          |  |  |       |  |
>>       | | | | |          |  |  |       |  |
>>      [][][][][]         []  [] []      [] []  <- hubs with local computers
>>        Admin             Student1     Student2  * off them
>>     203.28.240.0      203.28.241.0   203.28.242.0

>>At present the Macintosh machines can quite happily use Appletalk to
>>communicate to each other throughout the entire campus. I believe this is
>>because they use the MAC address of each machine and the switch will
>>happily pass their packets. The problem occurs with IP communications. As
>>expected at present computers on each network can all talk to each other
>>happily, even if it means going via the switch , but they cannot talk to
>>computers on other networks (ie a computer on 203.28.241.0 cannot reach a
>>computer on 203.28.242.0). I have set up the linux box with the commands:

>>route add -net 203.28.240.0 netmask 255.255.255.0 dev eth0
>>route add -net 203.28.241.0 netmask 255.255.255.0 dev eth0
>>route add -net 203.28.242.0 netmask 255.255.255.0 dev eth0

>>This seems to allow a few computers to communicate across network
>>boundaries and the server is able to access all the networks. The problem
>>is that not all computers can communicate across the network boundaries.

>What do these compters think is the netmask?  What do they think is
>the default router?  A computer on network 203.28.240.0 with a netmask
>255.255.255.255 and a default router 203.28.241.1 is going to find
>life a bit tricky!

>Try giving eth0 multiple addresses, one in each subnet:

>ifconfig eth0 203.28.241.1 netmask 255.255.255.0
>ifconfig eth0:1 203.28.240.1 netmask 255.255.255.0
>ifconfig eth0:2 203.28.242.1 netmask 255.255.255.0
>route add -net 203.28.240.0 dev eth0
>route add -net 203.28.241.0
>route add -net 203.28.242.0 dev eth0

>Note: You don't should usually need to give the device and mask
>explicitly on the "route" command.  I have just taken a look at
>ip_forward.c I suspect that the kernel won't generate ICMP_REDIRECTS
>if you have your routing table referring to eth0:1 and eth0:2.  Maybe
>I'm wrong about this.  Maybe it's a bug.  Maybe there's a good reason
>for doing it this way.  Does anyone care to comment?

>Note: If you don't have 2.0.x kernel with IP aliasing you will have to
>play about with dummy devices and proxy ARP.

>Next make sure that machines on 203.28.240.0 think that their router
>is 203.28.240.1 not 203.28.241.1.

>--

> .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

>.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
> # ll  l\\  ~~~~ ~   ~ ~    ~ | http://www.veryComputer.com/~bam/


 
 
 

1. unusual routing situation

I need some help with routing on my lan. At home, I currently have one
machine running IPROUTE (a network address translator) which connects via
ppp dialup to the office. Connected to that,  I have several machines using
the private network 192.168.0.0. This setup is working perfectly.
I recently added a linux box running Redhat 5. I wish to use that as a dial
in server, so that when I am away from home, I can dial into my lan, which
will give me access to all of my machines with the private addresses, and
hopefully, also allow me internet access out through the iproute machine. I
am using mgettty as the terminal software.
So far, I can dial in, and ping all the machines on the lan. I assign the
dial in 192.168.0.70, and the modem in the Redhat machine 192.168.0.60. The
iproute gateway is 192.168.0.254. However, any packets destined for anything
other than the private network is not being routed out through the iproute
gateway, I have packet forwarding enabled on the Redhat machine, as well as
proxy arp.
My question is, do I need to add any static routes to either the dial in
server, or the gateway. If so, what would they be?
Thanks in advance.

Heres a simple diagram if it helps.

isdn -> router -> office RAS server  -----> NAT GATEWAY ------>192.168.0.0
lan ------->linux box (192.168.0.53) <-----dial in

Basically, I need the dial in to connect to the office. I can only ping as
far as the gateway but it doesnt get translated, routed,  and sent out to
the office (which is connected via isdn to the internet)

2. bind()ing to more than 1 ip

3. help with unusual proxy routing?

4. nwe-serv

5. Unusual (routing?) problem...

6. HLP: w/ Central X server, assorted X clients..

7. unusual routing problem

8. [2.5] set pci dma mask for ohci-hcd

9. Unusual Stacksize Question

10. Unusual Jumpstart Question

11. Netscape and pine...unusual question

12. Unusual Kpppd question for Linux Gods!

13. Unusual HW question on Creative AWE32 ISA