问题
I have a web application running on tomcat at port 8080. The application needs to be accessible from behind a very strict firewall. Will forwarding port 80 to 8080 allow users behind the firewall blocking 8080 to access the application?
If not, what other options do I have?
I follow these instructions for port forwarding
Step 1: View current firewall rules
sudo ipfw show
Step 2: Add port forwarding rule (80 to 8080)
The default port that Tomcat runs on is 8080, so here we show the command to do port fowarding from port 80 to 8080 (Tomcat’s default port). Obviously, this works for other ports as well, and you’d just have to adjust the command accordingly.
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
This is a temporary change, and it will revert once you reboot. If you want to make it permanent, you can create a lauch deamon for it.
Optional Remove Rule
If you want to remove your firewall rules run:
sudo ipfw flush
回答1:
Yes it will work, since the forwarding is done on your machine it looks to the outside as if it were on port 80. We had a similar set up and it worked fine.
Of course if the firewall is very strict they might have other blocking rules that could interfere (perhaps they only allow certain IPs through).
来源:https://stackoverflow.com/questions/12872051/forward-port-80-to-8080-on-my-server-will-users-that-block-port-8080-be-able-to