Skip to content Skip to sidebar Skip to footer

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.
  1. Type nano /etc/network/interfaces to open networking configuration
  2. Assign Domain Name Server (DNS) to 8.8.8.8 (Google)
  3. 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)
  4. After entering IP Gateway, dont forget to Save (by pressing ctrl x+y on keyboard)
  5. Next, configure resolv.conf file by entering command nano /etc/resolv.conf
  6. 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.

  1. Type iptables -X (Used for reseting chain)
  2. Type iptables -F
  3. Type iptables -t nat -F
  4. Type iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE (eth0 act as Input LAN card)
  5. Then save the IP network tables by typing iptables-save > /etc/network/iptables.conf
  6. Now type echo "iptables-restore < /etc/network/iptables.conf" >> /etc/network/if-up.d/iptables
  7. Type chmod -x /etc/network/if-up.d/iptables to grant access
  8. Do restart computer with command init 6