0% found this document useful (0 votes)
41 views2 pages

To-Ports 8080 '

This document provides instructions for configuring a computer to function as a router with the following key steps: 1. Configure the network interfaces and static IP addresses for Ethernet ports eth0 and eth1. 2. Set up iptables rules for port redirection, masquerading, and saving the iptables configuration. 3. Enable IP forwarding by editing sysctl.conf and restarting. 4. Install and configure the Squid proxy server to listen on port 3128 in transparent mode. 5. Restart the networking services and test the Squid proxy configuration.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views2 pages

To-Ports 8080 '

This document provides instructions for configuring a computer to function as a router with the following key steps: 1. Configure the network interfaces and static IP addresses for Ethernet ports eth0 and eth1. 2. Set up iptables rules for port redirection, masquerading, and saving the iptables configuration. 3. Enable IP forwarding by editing sysctl.conf and restarting. 4. Install and configure the Squid proxy server to listen on port 3128 in transparent mode. 5. Restart the networking services and test the Squid proxy configuration.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#nano /etc/network/interfaces auto eth0 allow-hotplug eth0 iface eth0 inet static address 172.26.78.19 netmask 255.255.255.

224 network 172.26.78.0 broadcast 172.26.78.31 gateway 172.26.78.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 124.81.116.2 dns-search smartlinkgm.net auto eth1 iface eth1 inet static address 192.168.10.1 netmask 255.255.255.0 broadcast 192.168.10.255 3. Setting Iptables #iptables -A PREROUTING -t nat -j REDIRECT -p tcp -s 192.168.10.0/24 -d 0/0 --dport 80 -to-ports 8080 (apabila sudah ada squid) #iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j MASQUERADE (belum ada squid) #iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j MASQUERADE #iptables-save > /etc/iptables.conf #echo "iptables-restore < /etc/iptables.conf" >> /etc/network/if-up.d/iptables #chmod 755 /etc/network/if-up.d/iptables 4. Setting ip forward #nano /etc/sysctl.conf net.ipv4.conf.default.rp_filter=1 net.ipv4.ip_forward =1 net.ipv4.conf.default.forwarding=1 net.ipv6.conf.default.forwarding=1 #sysctl -p /etc/sysctl.conf -A (untuk merestart ip forward) #sysctl -A|grep forward 5. Setting Squid #apt-get install squid setelah itu configure di #nano /etc/squid/squid.conf yang di konfigure antara lain http_port 3128 transparent our_networks 192.168.10.0/24 (di sesuaikan dengan network kita) #/usr/sbin/squid -k reconfigure (restart squid)

untuk mengetest squid #tail -f /var/log/squid/access.log 6. restart # /etc/init.d/networking restart Reconfiguring network interfaces...done. Ok Jadilah sebuah PC Router, konfigurasi seperti diatas sudah cukup aman dan secure.. Tambahan bisa juga router diatas di forward menjadi sebuah proxy... Dengan mengubah sedikit di script, squidnya..

You might also like