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 :
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 192.168.1.xxx subnet and at hoem I use 192.168.0.xxx, so I can access local websites within my office via Safari.
But now the catch:
When I use an entry
192.168.1.123 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 ?
Thanks.
I found a script which sets it automatically :
Code:
#!/bin/bash
# http://richardkmiller.com/925/script-to-enabledisable-socks-proxy-on-mac-os-x
disable_proxy()
{
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 127.0.0.1 3310
networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 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 192.168.1.xxx subnet and at hoem I use 192.168.0.xxx, so I can access local websites within my office via Safari.
But now the catch:
When I use an entry
192.168.1.123 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 ?
Thanks.