netdev
[Top] [All Lists]

Re: External Loopback with crossed route entries

To: Andrew Morton <andrewm@xxxxxxxxxx>
Subject: Re: External Loopback with crossed route entries
From: Rick Richardson <rick@xxxxxxxxxxxxxxx>
Date: Tue, 13 Feb 2001 21:27:49 -0600
Cc: netdev@xxxxxxxxxxx
In-reply-to: <3A89D921.F5B18A96@xxxxxxxxxx>; from andrewm@xxxxxxxxxx on Wed, Feb 14, 2001 at 01:02:25AM +0000
References: <20010213131528.A1746@xxxxxxxxxxxxxxx> <3A89C2F5.853775B8@xxxxxxxxxx> <20010213175713.B1249@xxxxxxxxxxxxxxx> <3A89D921.F5B18A96@xxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
I didn't have any luck with your approach:

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.11.2    0.0.0.0         255.255.255.255 UH       40 0          0 eth1
192.168.11.1    0.0.0.0         255.255.255.255 UH       40 0          0 eth2
192.168.200.0   0.0.0.0         255.255.255.0   U        40 0          0 vmnet1
172.16.0.0      0.0.0.0         255.255.0.0     U        40 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
0.0.0.0         172.16.0.1      0.0.0.0         UG       40 0          0 eth0
$ ping 192.168.11.1
connect: Invalid argument


There is a tiny patch for kernel 2.0.36 that made external loopback
with crossed route entries work:

    http://www.uwsg.iu.edu/hypermail/linux/kernel/9903.3/0614.html

    Description: Fixes problem with external loopback, using crossed route
                 entries.
    Version: 2.0.36 (& 2.0.37-pre9)
    Testing: Connected two NICs together, using an external cross-over cable,
    swapped route entries (to force packets out the opposite interfaces),
    and then issued pings, telnets, & ftps to both addreseses. Unplugged
    the cable to verify pings, etc. were appropriately halted.
    Request: Please CC bmoyle@xxxxxxxxxxxx with any comments/feedback.

The patch was rejected with some argument and never made it into any
kernels:

        http://www.uwsg.iu.edu/hypermail/linux/kernel/9903.3/0887.html
        http://www.uwsg.iu.edu/hypermail/linux/kernel/9903.3/0948.html


Now, given the size of the patch for 2.0.36, one would think it would be
an easy thing to update the patch for 2.4.0.  Anybody know for sure?

-Rick


On Wed, Feb 14, 2001 at 01:02:25AM +0000, Andrew Morton wrote:
> Rick Richardson wrote:
> 
> > 
> > +----------------------+
> > |                      |
> > |  +------------------+| eth0
> > |  | eth0 192.168.1.1 |----------+
> > |  +------------------+|         |
> > |                      |         | crossover cable
> > |  +------------------+| eth1    |
> > |  | eth1 192.168.2.1 |----------+
> > |  +------------------+|
> > |                      |
> > |  PC with two I/F's   |
> > +----------------------+
> > 
> > A "ping 192.168.2.1" should go out the top port (eth0), over the
> > crossover cable, and back in to the lower port (eth1).
> > 
> 
> Interesting.
> 
> # There's probably a simpler way of doing this
> #
> # Open the links
> ip link set eth0 up
> ip link set eth1 up
> 
> # Give them an IP
> ip addr add 192.168.1.1 dev eth0
> ip addr add 192.168.1.2 dev eth1
> 
> # kill the local routes
> ip route del 192.168.1.1 dev eth0 table local
> ip route del 192.168.1.2 dev eth1 table local
> 
> # Provide the crossed routes
> ip route add 192.168.1.2 dev eth0
> ip route add 192.168.1.1 dev eth1
> 
> # OK, now packets cross over the loopback.  Now what?
> 
> 
> This will send packets across the loopback, but when
> they arrive back, they of course loop-unto-TTL-expiry.
> What do you want to do with the incoming packets?

Ping, telnet, ftp, ttcp, etc. between the two ports.

-- 
Rick Richardson  rick@xxxxxxxxxxxxxxx  http://home.mn.rr.com/richardsons/
Twins Cities traffic animations are at http://members.nbci.com/tctraffic/#1

I've never used Linux, and probably never will. -- Me, 06/22/94
I'm using Linux.  -- Me, 12/14/95

<Prev in Thread] Current Thread [Next in Thread>