LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   configure proxy server with private internal network single NIC (https://www.linuxquestions.org/questions/linux-networking-3/configure-proxy-server-with-private-internal-network-single-nic-4175472412/)

randdeveloper 08-06-2013 10:24 PM

configure proxy server with private internal network single NIC
 
I'm trying to set up a private internal network of Linux/windows/android connected to a wireless router separated from the Internet by a proxy server. I have an old computer running Linux mint and I have a switch as well as the router provided by my ISP. How can I set up Linux to be a proxy through which all of my internal computers must pass in order to connect to the internet and allow me to access my internal network from the outside.
The ISP router is ATT which has instructions for port forwarding. The Linux Mint proxy only has one NIC which is why I thought I could connect that to the switch and connect both routers to the switch making that one network, use my second Linksys router for my internal network wired and wireless, and leave my ATT router to provide guest access to the internet.
On the Linux mint proxy I want to run Apache to serve web pages, Squid for proxy for my private network, and also allow SSH or other remote desktop from the internet through the ATT router through the Linux mint proxy then into my internal network.
Here's the setup with the internal networks shown for each router:

internet - ATT router --- switch ---- Linksys router - internal network
...........(192.168.1.) | (10.12.80.)
........................proxy server

Alternatively I could not use the switch and go:

internet - ATT router --------- Linksys router - internal network
...........(192.168.1.) | (10.12.80.)
.............................proxy server {also on the 10.12.80. internal network}

To give more details on the setup the Linksys router uses DHCP on the 10.12.80.0/25 internal network to connect windows 8, windows 7, Linux mint development machine, and a couple of phones and tablets all android. The other side of the Linksys I now have set up on a port on the ATT router as part of the 192.168.2.0/24 network. The Linksys router is the gateway for the computers and the ATT router is the gateway for the Linksys router. I also have one other windows 7 computer connected directly to the ATT router. I have the switch and the Linux computer I want to make into a proxy and thought it would work best connecting the ATT router to the switch, the Linux mint proxy to the switch, and the Linksys router to the switch to enable the computer to sit between the internal network and the ATT router.

How do I setup Linux and squid plus apache plus SSHserver on my proxy server to handle all traffic between the internal network and the ATT router and outside world? Do I need the switch or can I achieve the same separation connecting the proxy server to the Linksys router say by giving it a static ip and letting that ip be the gateway for the Linksys router?

I'm very new to Linux and to networking. I've read a few books, watched some very helpful videos online, and read a bunch of websites to learn how to set up a network, etc. but I just can't understand how to accomplish this task and would appreciate any help.

nini09 08-07-2013 02:17 PM

You can use route policy to create two separate routing table to control internal and external network. The key point use source route.

jefro 08-07-2013 02:26 PM

Some of the firewall's and security software apps out there run on one ip (well almost all can) but usually folks put in a dual IP in their nic. May be only for convenience. It will still be kind of slow on high demand stuff. Set proxy to the second ip address on the proxy for either your browser or just make it global for the OS.

randdeveloper 08-07-2013 06:49 PM

Thanks nini09 and jefro
I can set up two ip addresses for the NIC using eth0 and eth0:1 in my configuration files. In doing that, isn't the only routing I need to set up to be from the internal network's router to the proxy server and then let the proxy server use the other ip address to communicate with the ATT router? In other words, they'll effectively be two NICs and the internal Linksys router can just pass all of its traffic to one of those NICs while the other can communicate with the external router.

Thanks, again, for your help.

jefro 08-08-2013 03:47 PM

That is what you'd want. "In other words, they'll effectively be two NICs and the internal Linksys router can just pass all of its traffic to one of those NICs while the other can communicate with the external router." May have to watch loads or speeds, if too low might need to do stuff like offload checksum or even get new nic or faster system.


All times are GMT -5. The time now is 03:29 AM.