V
V
vityabond2015-10-19 14:43:01
Debian
vityabond, 2015-10-19 14:43:01

Set up Debian port forwarding?

There is a machine with Proxmox with an external IP, there is a virtual machine with Centos, the network between Proxmox and Centos is configured, NAT is also configured, you need to configure port 80 forwarding, port 22 has been forwarded, 80, by analogy, does not want to.
I do this:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.0.2:80
Output iptables rules:
Chain PREROUTING (policy ACCEPT)
target prot opt ​​source destination
DNAT tcp -- anywhere tcp dpt:http to:192.168.0.2:80
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
MASQUERADE all -- 192.168.0.0/24 anywhere

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vityabond, 2015-10-20
@vityabond

removed the rule in iptables on the virtual machine

K
Konstantin ™, 2015-10-19
@Energoblock

Most likely, port 80 is already occupied, since Proxmox, if my memory serves me, has an admin panel hanging there. It is necessary to transfer the admin panel to another port and then forward it to the freed 80th.
Check:
nestat -lptun | grep :80

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question