# [Solved] Help: Source based portforwarding

## aztech

I need help, if possible, to setup portforwarding/redirecting based on source-IP.

The proxy at work, has as far as I know, only port 80 and 443 open.

They closed port 8080 last week, so I can't use that anymore =(

Any way, can I use portforwarding based on source address for this?

ie. redirect/forward to local port 22, if source address is my work IP.Last edited by aztech on Tue Sep 13, 2011 6:37 am; edited 1 time in total

----------

## truc

```
iptables -t nat -A PREROUTING -i $ext_if -s workIP/32 -p tcp --dport 80 -j REDIRECT --to-port 22
```

 :Question: 

----------

## aztech

thanks !

----------

## truc

 *aztech wrote:*   

> thanks !

 solved?

----------

## aztech

 *truc wrote:*   

>  *aztech wrote:*   thanks ! solved?

 

Yes!

Didn't work at first, but i figured it had to do with the proxy it self.

It doesn't like that I use SSH over port 80. All i get from Putty is "bad request 400" or something.

So I changed to port 443 and it works ... for the moment.

----------

