0

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?

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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