I'm trying to figure out if I can do this via a SOCKS proxy, or if I need to use a VPN.
I have a Ubuntu server, and a dual-boot Ubuntu 11.10/Windows 7 client. What I'd like to do is connect to the server, and then be able to make use of entries in the servers /etc/hosts
file - including one which is on the servers LAN.
Is this possible via SOCKS? If not, is there anything special I'd need to do for it to work with openVPN?
It doesn't work that way. The entries in
/etc/hosts
are for the local machine only. You'll either need to create corresponding entries in the client's hosts file or create proper DNS records for them.With regards to your question about OpenVPN vs. a SOCKS proxy, if all you're doing is browsing website through the tunnel, then there is not an advantage to either. Just pick one and use it.
The /etc/hosts file definitely won't work with a regular VPN, you'll have to set up some kind of DNS server for that to work. That - or just copy your hosts file over to your client.
SOCKS, depending on the client software, does support name resolution being performed by the SOCKS proxy rather than by DNS on the client machine. Depending on the implementation of the SOCKS server you plan on using, it might use the /etc/hosts file on the server for name resolution - or it might not. Try! It might even be configurable.
As a little tip suggestion for a zero-effort SOCKS proxy for an Ubuntu server, use SSH to set up dynamic SSH tunneling with a SOCKS interface generated by the local SSH client. Both PuTTY and OpenSSH may be used in this mode.
dnsmasq will serve up /etc/hosts data as if it were a DNS database, as well as providing a DHCP server and DNS cache.
After some searching, I found something.
SShuttle
.After some tweaking and reading the README, I got something that did what I wanted it to.
./sshuttle -r --dns [email protected]:22 0.0.0.0/0
That sends all my traffic through my server, and gives me access to my LAN. Poor mans proxy and VPN server.