Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have my laptop receiving a wifi signal, and its sharing the connection through its ethernet port. The ethernet port is connected to a switch, and my clients (multiple computers/xbox 360/ps2) connect to the switch. One thing that I would like to do is set up some kind of port forwarding, so that if port 80 is used, the laptop forwards that port to one of the computers connected on the switch.

How would I go about doing something like this?

share|improve this question
up vote 1 down vote accepted

You're probably going to have to get familiar with iptables, but in brief:-

iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j DNAT --to
iptables -A FORWARD -p tcp -d --dport 80 -j ACCEPT

Change to the machine connected to your switch which you're wanting to forward port 80 to, and wlan0 to the same of your wireless interface.

If you're not comfortable with using iptables, have a look at Firewall Builder, which has a nice GUI and generates iptables configs.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .