i'm newbie to NAT & Routing, I have an Ubuntu pc with 2 NIC's eth0 which is connected to a private Network with ip 172.16.10.0/24 and eth1 connected to 10.3.0.250/16 and eth1 connects to the internet successfully through the organisation's proxy server 10.0.0.5/24. I want the private network to connect to the internet through eth1. so from tutorials i configured DHCP to release IP's to the private network & enabled forwarding from eth0 to eth1,the private network acquires IP's successfully but i can't connect to the internet.
Asked
Active
Viewed 623 times
1 Answers
0
There are 2 ways to do this.
I will call your pc the "server", and the client which is on the private network "client".
Enable NAT on your PC connecting the 2 networks. To test, I would use fixed ips, or you can use DHCP. Check in this order:
- Can you ping the server from the client?
- Is the default gateway on the client the server's ip?
- Can you ping the proxy from the client? 10.0.0.5
- Did you set the proxy on your client? Your server only routes to the proxy, but doesn't do any NAT to proxy conversion.
Or you set up a proxy on your server, which will use the organisation's proxy as parent: http://www.christianschenk.org/blog/using-a-parent-proxy-with-squid/
If this doesn't work, check * Can you ping the server from the client? * Did you set the proxy on your client? It's now the private ip of your server.

davidbaumann
- 1,887
- 1
- 18
- 31
-
1- NAT is enabled on the "server" – Ahmed Fouda Nov 30 '15 at 12:04
-
1- NAT is enabled on the "server" net.ipv4.ip_forward=1 sudo iptables -A FORWARD -i eth0 -j ACCEPT sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE , 2- i can ping the server eth0 from client, 3- default gw on clients is "now" the server ip. 3-yes i can ping the organisation proxy 10.0.0.5 from client. 4- i didn't configure proxy on clients but squid3 is installed but not configured. – Ahmed Fouda Nov 30 '15 at 13:19
-
So set the proxy on the clients, and it should work. – davidbaumann Nov 30 '15 at 13:20