When using UFW I see there are "applications" like OpenSSH or Apache, to name a couple. If I were to change my SSH default port to something other than the 22, would the OpenSSH application rule map to the new port? Or, do I need to manually add the rule for this new port?
If I connect to a server like so:
JP_PORT=$(shuf -i 8895-9100 -n 1)
TB_PORT=$(shuf -i 6010-6200 -n 1)
ssh -Y -L ${JP_PORT}:127.0.0.1:${JP_PORT} -L ${TB_PORT}:127.0.0.1:${TB_PORT} <host>
Once connection is established, is there any terminal command that will return the list of ports I forwarded?
I am in a bit of trouble as I am trying to setup a reverse proxy with and a second server. My idea was to get the firewall to forward https to the reverse proxy and port 29418 (gerrit ssh) to the second server. Now my cooperate IT guy says: CAN NOT! Either both ports go to server 1 or both ports go to server 2.
Ok, as a work around I tried to setup a port forwarding on the reverse proxy of port 29418 -> server2:29418
Details:
- Server1 IP: 10.0.0.132 and 192.168.10.2 on Ubuntu 12.04.2 LTS
- Server2 IP: 10.0.0.133 and 192.168.10.3 on Ubuntu 12.04.2 LTS
Now both https and port 29418 go from the firewall to 10.0.0.132, IT says that's the only way. :(
So please tell me how to forward from 10.0.0.132:29418 -> 192.168.10.3:29418 or 10.0.0.133:29418
When I am working on the 10.0.0.132 I can connect to both 10.0.0.133:29418 and 192.168.10.3:29418 so the ports are open.
-- Update --
My iptables -t nat -L looks like this:
root@dev:/root# iptables -t nat -L Chain PREROUTING (policy ACCEPT) target prot opt source destination DNAT tcp -- anywhere dev.example.com tcp dpt:29418 to:10.0.0.133 Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination root@dev:/root# cat /proc/sys/net/ipv4/ip_forward 1
I used to run a service on port 25570 I'm now changing it to run on port 25565 but I still want people who try to access it on the old port to have access to the service. So I'd like to forward port 25570 to 25565 on the same machine.
I know there's a lot of questions that talk about forwarding to a different machine but I was wondering if the method is different when using the same machine?
I have Ubuntu 10.04 as host machine and Ubuntu 10.10 as guest machine installed in VirtualBox.
I had success on port forwarding to connect to Apache of guest machine, so that now I can open in host machine web sites published in Web Server(Apache) of guest machine.
I need to do the same with MySql, i.e. access MySql of guest machine from host machine.
In order to achieve this goal I am executing following commands in host machine:
VBoxManage setextradata Ubuntu "VBoxInternal/Devices/e1000/0/LUN#0/Config/mysql/HostPort" 3307
VBoxManage setextradata Ubuntu "VBoxInternal/Devices/e1000/0/LUN#0/Config/mysql/GuestPort" 3306
VBoxManage setextradata Ubuntu "VBoxInternal/Devices/e1000/0/LUN#0/Config/mysql/Protocol" TCP
where Ubuntu is the name of the host machine.
Guest machine loads and when I try to connect to MySql from host machine it can not connect to it.
What could be the problem here?
Thank you.