Hi folks-

I have an iptables question.  I've tried a few things, but since this is 
my gateway/router I usually seem to end up killing internet access (or 
more strangely, slowing it right down for a  time) when I try to work it 
out myself.

Here is the setup.  What I need to do is to open an external port on the 
WAN side and direct it to a port on an internal machine.

Can anyone suggest the required incantation to do the job?

Many thanks!

wlan0 is the LAN side and
r...@squiddy:~# more startup
#!/bin/bash

sysctl -w net.ipv4.ip_forward=1
iptables -P FORWARD ACCEPT
iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables --table nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j 
REDIRECT --to-port 3128

r...@squiddy:~# iptables-save
# Generated by iptables-save v1.4.4 on Thu Apr 22 10:18:53 2010
*nat
:PREROUTING ACCEPT [132042:12331577]
:POSTROUTING ACCEPT [18152:3537221]
:OUTPUT ACCEPT [82653:10602042]
-A PREROUTING -i wlan0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Thu Apr 22 10:18:53 2010
# Generated by iptables-save v1.4.4 on Thu Apr 22 10:18:53 2010
*filter
:INPUT ACCEPT [9519853:1538511432]
:FORWARD ACCEPT [4638871:616558804]
:OUTPUT ACCEPT [8536672:1749833220]
COMMIT
# Completed on Thu Apr 22 10:18:53 2010



-- 
Next meeting: Unknown
http://dorset.lug.org.uk/     http://www.linkedin.com/groups?gid=2645413
   Chat: http://www.mibbit.com/?server=irc.blitzed.org&channel=%23dorset
           List info: https://mailman.lug.org.uk/mailman/listinfo/dorset

Reply via email to