I’m not going to go into exactly why (it’s a minor networking niggle following on from a change in broadband provider) but I wanted a simple HTTP proxy in my lab so that my lab VMs could get out on to the internet. Mostly for installing updates etc.
Since my NAS is ideally placed in my network I thought that I’d use that. It’s only a short-term thing anyway.
Now in order to get a proxy service on to the NAS, I needed to setup IPKG first. This allowed me to install and configure SQUID as follows:
1. Open an SSH session to the NAS
2. Download and install SQUID
ipkg install squid
3. Perform a couple of configuration commands
squid -k parse squid -z ln -s /opt/etc/init.d/S80squid /usr/syno/etc/rc.d/
4. SQUID can now be started using /opt/etc/init.d/S80squid start
Now there may be some additional changes you might want to make. By default SQUID will accept connections from a standard set of internal networks as follows:
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network acl localnet src 172.16.0.0/12 # RFC1918 possible internal network acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
However, you may want to tie this down for one reason or another. For me, I’m not too bothered. Any changes can be done by editing /opt/etc/squid/squid.conf.
Want to check that it works? I configured the proxy config in my VM as follows:
And then monitored the proxy access file using tail:
tail -f /opt/var/squid/logs/access.log 1409911439.044 141 192.168.100.151 TCP_MISS/200 405 HEAD http://download.windowsupdate.com/v9/windowsupdate/redir/muv4wuredir.cab? - DIRECT/126.96.36.199 application/octet-stream 1409911439.138 80 192.168.100.151 TCP_MISS/200 24017 GET http://download.windowsupdate.com/v9/windowsupdate/redir/muv4wuredir.cab? - DIRECT/188.8.131.52 application/octet-stream 1409911445.219 46 192.168.100.151 TCP_MISS/200 405 HEAD http://ds.download.windowsupdate.com/v11/3/windowsupdate/selfupdate/WSUS3/x64/Win7SP1/wsus3setup.cab? - DIRECT/184.108.40.206 application/octet-stream 1409911445.246 16 192.168.100.151 TCP_MISS/200 34418 GET http://ds.download.windowsupdate.com/v11/3/windowsupdate/selfupdate/WSUS3/x64/Win7SP1/wsus3setup.cab? - DIRECT/220.127.116.11 application/octet-stream
Michael is a Senior Consultant for Xtravirt. If it's got buttons or flashy lights on it then it'll probably be on his radar. When not "mending computers" (it's sometimes easier than explaining "cloud" to relatives), Michael provides essential education, entertainment and trampoline services to his two children.