E
E
Evgeny Mikhalev2011-11-03 17:30:35
linux
Evgeny Mikhalev, 2011-11-03 17:30:35

Port forwarding to a virtual machine, configure a firewall?

There is a server (piece of iron), it costs the provider, there is only one external IP, it is no longer possible. The server has kvm-qemu and nat. The cable is plugged into eth0 and the virtual machines sit on br0 (br0:0), at the hardware node ip XXX.XXX.XXX.XXX and 192.168.0.1. Sites are spinning on virtual machines, and through nginx they are given out. Nginx is running on a hardware node. Now, to get into the virtual machine, you first need to go via ssh to the hardware node, and from there ssh [email protected], which is not very convenient. As I understand it, you can forward ports, for example 100,200,300, so that you can access virtual machines via sssh like this - [email protected]:100 [email protected]:200 [email protected]:300, and also forward port 80 to some kind of virtual machine, and move the indzhayniks there. What is the best way to do this? I don’t want to experiment, because if you lose control over sssh, then this is not very good. And you have to do it quickly. There is no time to understand thoroughly. Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Burov, 2011-11-03
@neznae4ko

iptables -t nat -A PREROUTING -p tcp -d XXX.XXX.XXX.XXX --dport 100 -j DNAT --to-destination 192.168.1.xx:22
ssh [email protected] -p 100
in ssh port is specified not through: but as a separate parameter.

V
Vlad Zhivotnev, 2011-11-03
@inkvizitor68sl

debian.pro/523 - rinetd.

S
shadowalone, 2011-11-03
@shadowalone

the fastest is rinetd - if there is no time to understand. quickly and clearly.
otherwise, iptables.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question