Configure Proxy in Debian 7
Proxy is a computer that act as a bridge between client's computer and internet. It's used for packet filtering alongside with the firewall. With proxy, every access to website can be limited.
You can follow steps below how to configure proxy in Debian 7
A. Checking Up Hardware and BIOS (UEFI)
This is what should we do at the very first step. We must make sure that our proxy computer has 2 LAN Card which has different functionality. First LAN Card (let's call it eth0) used for receiving internet connection, and the second LAN Card (eth0) used as output to client. To make it easier to understand, configure any networking installation using eth0 as a gateway (which receiving internet) first so later we can proceed with eth1 as the output.
B. Connect This Server To Internet
After checking up hardwares, the next step is connect this proxy server to internet.
- Type nano /etc/network/interfaces to open networking configuration
- Assign Domain Name Server (DNS) to 8.8.8.8 (Google)
- After that, assign IP gateway (which we get from ISP router. we can check what IP by directly connect it to another PC and check it via CMD. ipconfig command will show it)
- After entering IP Gateway, dont forget to Save (by pressing ctrl x+y on keyboard)
- Next, configure resolv.conf file by entering command nano /etc/resolv.conf
- Then add nameserver 8.8.8.8 and nameserver 8.8.4.4
C. Routing
Routing is a process to connect the server to internet.
- Type iptables -X (Used for reseting chain)
- Type iptables -F
- Type iptables -t nat -F
- Type iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE (eth0 act as Input LAN card)
- Then save the IP network tables by typing iptables-save > /etc/network/iptables.conf
- Now type echo "iptables-restore < /etc/network/iptables.conf" >> /etc/network/if-up.d/iptables
- Type chmod -x /etc/network/if-up.d/iptables to grant access
- Do restart computer with command init 6