SSH tunneling does not work on MAC OSX

Discussion in 'Mac OS X Lion (10.7)' started by PenguinApple, Sep 9, 2011.

  1. PenguinApple macrumors newbie


    Apr 8, 2011
    For connecting to the internal network in my office while working at home I use an SSH tunnel.

    I found a script which sets it automatically :
            networksetup -setsocksfirewallproxystate Wi-Fi off
            networksetup -setsocksfirewallproxystate Ethernet off
            echo "SOCKS proxy disabled."
    # triggered on abortion (e.g. Ctrl+C)
    trap disable_proxy INT
    #networksetup -setsocksfirewallproxy Wi-Fi 3310
    networksetup -setsocksfirewallproxy Ethernet 3310
    networksetup -setsocksfirewallproxystate Wi-Fi on
    networksetup -setsocksfirewallproxystate Ethernet on
    echo "SOCKS proxy enabled."
    echo "Tunneling..."
    ssh -g -ND 3310 USER@MYOFFICEcom
    This starts normally and the SOCKS proxy is checked in the Wifi (Airport) proxy settings in the system setting. And in Safari it works with whatsmyip,com which displays now my office's IP address rather than my home one.
    My office uses subnet and at hoem I use, so I can access local websites within my office via Safari.

    But now the catch:

    When I use an entry myentry.local
    in the /etc/hosts file on my Mac

    I CAN access the office site by 192.168,1,123 but I can NOT access the site by "myentry.local".

    Moreover what works over SSH tunnel works ONLY in Safari. Firefox does not use this proxy setting and using ssh (from terminal or another ssh client) to an office server starting with 192.168.1 does not work either.

    It seems that these settings are only valid for Safari.
    What can be the problem here ?

  2. Hansr macrumors 6502a

    Apr 1, 2007
    Firefox does not use the system proxy settings it uses it's internal proxy settings.

    Try adding the .local to the hosts file on the machine you are ssh-ing into
  3. PenguinApple thread starter macrumors newbie


    Apr 8, 2011
    No this is not a Firefox problem.

    I tried a third server as a proxy which is actually an Android phone (rooted Galaxy S2) which is in the same Wifi network as my Mac.

    On the Galaxy I started the SSH tunnel app to my office and then it works perfectly with the 'myentry.local' in the 'hosts' of my Galaxy even when using Firefox on the Galaxy.
    And then when I use my Galaxy as proxy server (which has an SSH tunnel running to my office) so I fill in the IP of my Galaxy as proxy server address on my Mac, the internal IP of my office works but the myentry.local does not.


Share This Page