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: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Tue, 13 Feb 2001 20:56:12 -0700
Cc: Rick Richardson <rick@xxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
Organization: Candela Technologies
References: <20010213131528.A1746@bravidacorp.com> <3A89C2F5.853775B8@uow.edu.au> <20010213175713.B1249@bravidacorp.com> <3A89D921.F5B18A96@uow.edu.au>
Sender: owner-netdev@xxxxxxxxxxx
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

[snip]

Why not use source-based routing, and use ping with the -I command.

Here's an example from a product I've built:
(vlan0009 will be your eth1 or something...)

ip ru del from 192.168.9.3 lookup 7

# Setup for device: vlan0009  IP:  192.168.9.3
ip link set vlan0009 down
ip link set vlan0009 up
ip addr flush dev vlan0009
ip address add 192.168.9.3/24 broadcast 192.168.9.255 dev vlan0009
ip link set dev vlan0009 up
ip link set vlan0009 txqueuelen 400
ip ru add from 192.168.9.3/32 table 7
ip route add 192.168.9.0/24 via 192.168.9.3 table 7
ip route add 0/0 via 192.168.9.1 dev vlan0009 table 7


-- 
Ben Greear (greearb@xxxxxxxxxxxxxxx)  http://www.candelatech.com
Author of ScryMUD:  scry.wanfear.com 4444        (Released under GPL)
http://scry.wanfear.com               http://scry.wanfear.com/~greear

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