[Disclaimer : wicked networking inside]

Hello,

tortoise underscore 74 at yahoo. nospam co.uk a écrit :
> [...] My test system dials out from one modem and responds on
> the other. The problem is
> that though a connection is established it is not used for any traffic.
> I have ppp0 as 111.111.111.1 and ppp1 as 111.111.112.2. If I ssh into
> 111.111.111.1 the OS is smart enough to realise that 111.111.111.1
> might as well be 127.0.0.1 so the connection is not actually used.


No, the OS is not smart, and 111.111.111.1 is not 127.0.0.1 at all.
111.111.111.1 is just a local IP address, and a locally generated packet
sent to any local address is routed via lo, the loopback interface,
regardless of the interface the local address is attached to.

> Is there any way to
> resolve this using some clever routing commands?


Depending on what you want to test, you may try using some NAT to fool
the kernel routing. Make up a couple of dummy IP addresses that you will
use on the PPP link, for instance :

ppp0 dummy : 111.111.112.1
ppp1 dummy : 111.111.112.2

Do *not* use them as IP aliases (ppp0:1), else they will be considered
local and routed via lo. Create routes for these addresses as if they
were remote destinations :

route add 111.111.112.1 dev ppp1
route add 111.111.112.2 dev ppp0

Replace the source address of packets going out via ppp0 and ppp1 with
the dummy address :

iptables -t nat -A POSTROUTING -o ppp0 -j SNAT --to 111.111.112.1
iptables -t nat -A POSTROUTING -o ppp1 -j SNAT --to 111.111.112.2

And replace the dummy destination address of packets coming in via ppp0
and ppp1 with the real address :

iptables -t nat -A PREROUTING -i ppp0 -j DNAT --to 111.111.111.1
iptables -t nat -A PREROUTING -i ppp1 -j DNAT --to 111.111.111.2

Test scenario :
Send a ping packet to the dummy address 111.111.112.2.
The packet is routed through ppp0 with address 111.111.111.1, as
{src=111.111.111.1,dst=111.111.112.2}.
The packet source is changed into 111.111.112.1 by the ppp0 SNAT rule.
The packet becomes {src=111.111.112.1,dst=111.111.112.2}, goes through
the PPP link and arrives at ppp1.
The packet destination is changed into 111.111.111.2 by the ppp1 DNAT
rule. The packet is now {src=111.111.112.1,dst=111.111.111.2}.
The destination is local, so the packet is routed to the local host
which can send a reply packet to 111.111.112.1 routed via ppp1, through
the PPP link and received on ppp0.