Unroutable packer to specific IP forces process to run

Don Wilde dwilde1 at gmail.com
Thu Aug 6 21:58:58 UTC 2020


On 8/6/20 2:40 PM, Aryeh Friedman wrote:
>
>
> On Thu, Aug 6, 2020 at 5:39 PM Don Wilde <dwilde1 at gmail.com 
> <mailto:dwilde1 at gmail.com>> wrote:
>
>
>     On 8/6/20 2:35 PM, Aryeh Friedman wrote:
>>
>>
>>     On Thu, Aug 6, 2020 at 5:33 PM Don Wilde <dwilde1 at gmail.com
>>     <mailto:dwilde1 at gmail.com>> wrote:
>>
>>
>>         On 8/6/20 2:30 PM, Aryeh Friedman wrote:
>>         > I have VPN that has stability problems (the fault of the
>>         ISP and they admit
>>         > it) I have set up one my FreeBSD machine as a router for
>>         that specific VPN:
>>         > # on non-gateway machines in /etc/rc.conf
>>         > static_routes="internalnet2"
>>         > route_internalnet2="-net 10.31.10.0/24
>>         <http://10.31.10.0/24> 192.168.11.60"
>>         >
>>         > Is there any way to force the gateway machine to run a
>>         preset command if
>>         > 10.31.10.0/24 <http://10.31.10.0/24> is unreachable?  (i.e.
>>         reset the connection)
>>         What about a simple scripted cron-job ping, Aryeh? Sometimes the
>>         simplest solutions are the best.
>>
>>
>>     The amount time the connection stays up is unpredictable and due
>>     to the use case it needs to be repaired immediately if down (not
>>     even a 5 min delay for cron to do its normal wake up and look for
>>     a job is acceptable)
>
>     Understood.
>
>     So how about a simple C daemon that pings every ten seconds? Just
>     set the ping count to 1.
>
>
> System load.  (the gateway also hosts 3 moderately used VM's)


Okay, so forget a system() call to ping. Send a packet directly to 
something on the target from the C code. Even simpler, just call 
getaddrinfo() on host:port of a machine at the "other" end.

Honestly, I don't think you can get any simpler than this, Aryeh. 
There's only so much you can juggle, and no existing package is going to 
be any faster or more specifically better than what you code yourself.

Take a break, drink some coffee, and approach it with a refreshed brain. 
You do have the resources you need to solve this and I *know* you're 
good enough to do so.

I do understand what you're trying to do. I had my programmers build 
international database and site replication into a raw C module for 
Apache 1.3 many dozens of moons ago.

We also, IIRC, talked about how your bosses are screwing you out of 
necessary resources. Sooner or later you're going to have to address 
that issue head-on, but YMMV and beyond what we've already discussed 
it's not my business.

All the best! :D

-- 
Don Wilde
****************************************************
* What is the Internet of Things but a system      *
* of systems including humans?                     *
****************************************************



More information about the freebsd-questions mailing list