50% connection timeout from Home Office to Company LAN over VPN



  • Hi,

    I often work from my home office with several computers over OpenVPN. I can have only 1 OpenVPN connection at a time to the company network so this required frustrating juggling connections when switching between PC's.

    So I tried to set up the OpenVPN client on my trusty pfSense box and this actually connects and allows me to route traffic.

    Home                                                        Office

    192.168.1.x  –> pfSense  --> OpenVPN --> 10.32.x.x

    I added a hybrid NAT rule to make the requests to the office servers come from the OpenVPC client ip address

    This mostly works with mostly meaning exactly 50% of the time, in the browser this is ok as it apparently retries sufficiently to make it work, however ssh is hit and miss and uploading artifacts with maven (using https) essentially never works as it does multiple requests without retrying.

    I noticed with curl a pattern of 1 connect , 1 connection timeout, 1 connect, 1 connection timeout

    a quick python script confirmed this:

    import requests

    for _ in range(1, 50):
        try:
            requests.get("https://dsl.XXXXXXXXX.com/artifactory/webapp", timeout=0.5)
            print("Ok")
        except requests.ConnectTimeout:
            print("Fail")

    produces:

    /usr/local/anaconda3/bin/ipython test_dsl.py
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok
    Fail
    Ok

    this can't be coincidence.

    What could cause this behavior?