- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- port mapping in squid
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2009 10:03 PM
тАО09-28-2009 10:03 PM
squid proxy configured with a public ip address 59.90.72.76
type dest_host dest_port local_port
tcp 151.3.1.170 80 111
tcp 151.3.100.250 80 222
please give me an idea to do port mapping to the local servers so that it can be accessed through http from outside.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2009 04:36 AM
тАО09-29-2009 04:36 AM
SolutionHere's an example of setting up one forwarding:
http://wiki.squid-cache.org/ConfigExamples/Reverse/BasicAccelerator
The dest_port would be specified with the cache_peer directive. Look up the syntax of the cache_peer directive from here:
http://www.squid-cache.org/Doc/config/cache_peer/
Repeat the example as many times as needed.
... but if you are not specifically required to use Squid, I would suggest iptables forwarding instead, because it's easier to set up. Just two commands are needed:
iptables -t nat -A PREROUTING -p tcp -d 59.90.72.76 --dport 111 -j DNAT --to-destination 151.3.1.170:80
iptables -t nat -A PREROUTING -p tcp -d 59.90.72.76 --dport 222 -j DNAT --to-destination 151.3.100.250:80
i.e. "TCP packets incoming to 59.90.72.76 with a destination port X shall be redirected to destination Y".
The iptables settings will go away when the system is rebooted, so you will need to write a startup script or otherwise store the iptables configuration in a persistent way.
In RHEL 4 or 5, "iptables-save >/etc/sysconfig/iptables" should do the trick.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2009 11:17 PM
тАО09-29-2009 11:17 PM
Re: port mapping in squid
thanks for the quick responce
please guide me to configure http reverse proxy
Before the web url was http:\\59.90.72.76:111\ias\deafult.asp and http:\\59.90.72.76:222\hcl to access the package server.
after adding iptables also it is not working what else need to be checked
please guide me how to do http reverse proxy configuration for the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2009 06:11 AM
тАО09-30-2009 06:11 AM
Re: port mapping in squid
pp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2009 12:04 PM
тАО09-30-2009 12:04 PM
Re: port mapping in squid
Edit /etc/sysctl.conf, set net.ipv4.ip_forward to 1. Add this line if it does not exist:
net.ipv4.ip_forward=1
After editing the file, run "sysctl -p".
If you have other firewall rules configured, you must allow forwarding traffic to those local servers.
Did you read the Squid configuration example I linked? If you can't do it with that example, you should not be using Squid at all: if you don't know what you're doing, you're all too likely to accidentally create an "open proxy".
Open proxies can be used to send spam, to scam other Internet users for money, to make it look like you're the one downloading child porn, and many other nasty things.
There are people on the internet with automated tools for searching open proxies. Many modern computer worms and other malware will also automatically run network scans and report their findings to their creator.
MK