Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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 192.168.0.2:80
iptables -A FORWARD -p tcp -d 192.168.0.2 --dport 80 -j ACCEPT

Change 192.168.0.2 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.