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
|