On August 25, 2010 8:20 PM, Stuart Henderson wrote: >On 2010-08-26, David Gwynne <l...@animata.net> wrote: >> relayd can do this i think. > >afaik, it just uses the normal routing table, you can't force a specific interface/nexthop. if that's correct, to have relayd check connectivity beyond the gateways, you'll need static routes (e.g. host 8.8.8.8 via connection A, 208.67.222.222 via connection B) and use those hosts as an indicator.
>> On 26/08/2010, at 9:10 AM, dontek wrote: >>>>> I have managed a solution using traceroute that allows me to >>>>> accomplish half of my goal. I can detect a failure and "down" that >>>>> route, however, once I delete the default route from the routing >>>>> table for the failed connection, I can no longer test it with traceroute. >>>>> This is because it doesn't appear to me that OpenBSD's traceroute >>>>> allows forcing an interface to work on. >it may work to set the source address (ping -I, traceroute -s) and use a route-to pf rule to make sure packets with a specific source address are directed out of the relevant interface...though if you only have one address to play with for each connection you might be unable to distinguish "check" packets from normal packets. I tried out Stuart's suggestion with a couple of vether interfaces and it seems to have accomplished what I was looking for. Details: $ cat /etc/hostname.vether0 inet 172.16.0.1 255.255.255.0 NONE $ cat /etc/hostname.vether1 inet 172.16.1.1 255.255.255.0 NONE $ cat /etc/pf.conf (additions only) match out on $ext_if_1 from (vether0:network) nat-to ($ext_if_1) match out on $ext_if_2 from (vether1:network) nat-to ($ext_if_2) pass out on $ext_if_1 from (vether0) route-to ($ext_if_1 $ext_gate_1) pass out on $ext_if_2 from (vether1) route-to ($ext_if_2 $ext_gate_2) Tests: $ traceroute -s 172.16.0.1 -n google.com $ traceroute -s 172.16.1.1 -n google.com Once the above was done I could apply my traceroute scheme of testing to a script and/or integrate into ifstated. Thanks Stuart. >otherwise maybe you can do something with multiple routing tables...