Install apt-cacher-ng on server
# apt-get install apt-cacher-ng
Limiting access using iptables, rules:
-A INPUT -p tcp --dport 3142 --source 127.0.0.0/8 -j ACCEPT
-A INPUT -p tcp --dport 3142 --source [your network] -j ACCEPT
-A INPUT -p tcp --dport 3142 -j DROP
COMMIT
On server and client:
# vi /etc/apt/apt.conf.d/02proxy
Acquire::http { Proxy "http://[your ip server]:3142"; };
For server [your ip server] can be replaced with 127.0.0.1
Log apt-cacher-ng:
# tail /var/log/apt-cacher-ng/apt-cacher.log
1491201231|I|260|127.0.0.1|debrep/dists/jessie-backports/main/i18n/Translation-en.diff/Index
1491201231|O|28126|127.0.0.1|debrep/dists/jessie-backports/main/i18n/Translation-en.diff/Index
1491201231|O|237|127.0.0.1|security.debian.org/dists/jessie/updates/main/i18n/Translation-en.bz2
1491201231|O|233|127.0.0.1|debrep/dists/jessie/main/i18n/Translation-en.bz2
No comments:
Post a Comment