# Forward port from other device



## Dupl3xx (Sep 13, 2012)

Hello, I have 2 devices. switch (10.0.0.10) and freebsd server(10.0.0.15)
I need redirect port 80 (management) from switch to port 100 on server
My ISP give me public IP only on server, but i need connect to switch from public area
(http://10.0.0.15:100)
I can use only IPFW, no next programs
I found this, but ist redirect one port to other in one device


```
ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
```

can somebody help me ? Thank you


----------



## SirDice (Sep 13, 2012)

Use ssh(1) and forward a port with that. Opening up the management web interface of the switch to internet is a really bad idea.


----------



## Dupl3xx (Sep 13, 2012)

OK, ssh(1) is possible, I allow only 1 ip in ipfw.
can you helpme with this

`$ ssh 10.0.0.15 -R 100:10.0.0.10:80`

Or how to do it best? Thanks.


----------



## SirDice (Sep 13, 2012)

`$ ssh -L8080:10.0.0.10:80 10.0.0.15`

Keep in mind that non-root users cannot open ports below 1024. Hence the use of 8080.

Once the ssh(1) session is up connect your browser to http://localhost:8080.


----------



## Dupl3xx (Sep 13, 2012)

ssh: connect to host 10.0.0.15 port 22: Connection refused
I have ssh por 2222,
but


> ssh -L8080:10.0.0.10:80 10.0.0.15 -p 2222


It can password but i cant conect to switch


----------



## SirDice (Sep 13, 2012)

Connect to localhost port 8080 if you want to connect to the switch.


----------

