Today, I tested how to set up an HTTP Proxy Server in Linux to implement the following layout:
I am located in lan2 and want to get the resources in lan1 ..
In addition, you need to access the private site in lan2 in lan1 and the public network through lan2. lan2 accesses the private site in lan1 and the public network through lan1.
Connect the two NICs to lan1 and lan2 respectively.
Eth0 192.168.15.xx lan1 Network
Eth1 192.168.88.xx lan2 Network
The lan1 gateway is 15.1. The lan2 gateway is 88.1.
After the access, lan1 and lan2 can both be pinged to the server, but the server cannot access the Internet and can not ping any machine in lan1.
Route, we can see that 0.0.0.0 uses the 15 gateway, and other gateway settings are invalid ......
Google, someone said it was a problem to set the NIC startup sequence. I changed the start sequence and went to the Internet on lan2, but I still couldn't ping the machine on lan1.
I called the IT department .. In the past, the MAC address was restricted for access ......
Then set the routing rules as follows:
The server generally uses the 88 network segment (the lan2 egress accesses the Internet)
Access 192.168.xxx.xxx address (lan1) with 15 network segments)
Then we found that lan1 still has 10. xxxx addresses, So we added a route entry.
Route add-net 10.0.0.0 GW 192.168.15.1 netmask 255.0.0.0 Dev eth1
..
Therefore, this machine can access lan1 and lan2. Next, configure the HTTP proxy.
Use squid -- what? Not installed? Yum install squid!
After this is done, the configuration file comes directly.
Http_access allow all users to use proxies
Then the service squid restart
Finally, select a machine in lan1 and lan2 to open the browser and use the server as the proxy to test everything.
In both lan1 and lan2, you can set this machine as an HTTP Proxy Server to access the machine in the Peer LAN and access the Internet through the Internet egress of the peer.
Lab complete ~