So i made topology as shown in figure.
Router have 3 interfaces like this:
eth0 to internet side (with ip 192.168.1.10/24 gateway 192.168.1.254/24).
eth1 to server-PC side (with ip 192.168.20.1/28)
eth2 to Client side (with ip 172.16.20.1/29)
Server and client connected and get internet from router-pc. Server-pc uses a static ip (192.168.20.2), while the client gets an automatic ip from DHCP on router-pc
And i want to configure iptables on my Router-PC to redirect client’s internet to Proxy server on my Server-PC. So client must using credential to access internet (i already configure authentication proxy on my squid and already configure proxy manually on client side).
The firewall i’ve running is:
iptables -t nat -A PREROUTING -p tcp -s 172.16.20.0/29 -j DNAT –to 192.168.20.2
192.168.20.2 is my Server’s ip address. So, can you help me to fix the configuration I have done, in order to according to what I want?
Sorry for my bad english. Thanks.