K
K
kiev77772022-02-22 13:31:26
iptables
kiev7777, 2022-02-22 13:31:26

An iptables rule allowing access from one VM (private IP address) to a second VM (public IP address)?

Hello
Who can help with understanding such a question.
I have two VMs with private IP addresses. One of them has rules that allow access on multiple ports from the outside to the Proxmox public IP address.
So the rules work - I have access to the VM from the outside.

iptables -t nat -A PREROUTING -p tcp -d 116.XXX.XXX.99 --dport 8443 -j DNAT --to-destination 192.168.7.200:8443

But I need access from one VM to the second VM - and I have it, but by internal ip addresses, meanwhile I need from a private ip (one VM) to a public ip (second VM).
In which tables do I need to make such a rule and what does it look like?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
meDveD_spb, 2022-02-22
@meDveD_spb

but by internal ip addresses

and why might this not be enough?
ip addresses, meanwhile I need from private ip (one VM) to public ip (second VM).

allow.
I understand the problem is that the second machine does not have Internet access,
because there is no router.
once again the question arises, why connect to a neighboring machine through a route that you do not physically have?
If you want to connect between devices on the same subnet, you don't need a gateway.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question