Skip to contentSkip to conversation

another port forwarding question

DISCUSSION John Mathey 1 participant 1 message Dec 3, 2003

lore
Share & tools
lore
#0 lore raw

Sorry, I mistyped, the second -p was --dport:

$IPT -t nat -A PREROUTING -d $MYEXTIP -p tcp -s $MYSOURCEIP --dport 196 -j DNAT --to 192.168.1.50:80

John

I'm trying to figure a way to forward a packet from a linux box to an
internal windows box given a specific port. I'm pretty sure I can specify a port in my browser via a colon: eg: http://myfoobox:196, right?

Here is the rule I've set up in the iptables:

$IPT -t nat -A PREROUTING -d $MYEXTIP -p tcp -s $MYSOURCEIP -p 196 -j DNAT --to 192.168.1.50

Now, if I remove the -p ( port) it works, but I don't want every single request coming here to get forwarded, just a specific port, I've tried entering this in my browser:

http;//myfoobox - This works if I don't have a port (-p ) in my iptables rule
http://myfoobox:196 - this doesn't work no matter what
just entering the myfoobox , still no go.

The rule is the first one in my table so I know it has to at least get evaluated, in other words, there's not another rule filtering it out before it hits this.

Thanks in advance
John