i am struggling with port forwarding and virtualization, i have come quite far and could open and forward a port (9867) to my vm after this tutorial: https ://aboullaite.me/kvm-qemo-forward-ports-with-iptables/
here my iptables:
root@s1 ~/.ssh # iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 4445 packets, 245K bytes)
pkts bytes target prot opt in out source destination
5 220 DNAT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:9888 to:192.168.122.191:2302
9 452 DNAT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:9867 to:192.168.122.192:22
Chain INPUT (policy ACCEPT 4377 packets, 237K bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 35 packets, 2529 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 41 packets, 2793 bytes)
pkts bytes target prot opt in out source destination
0 0 RETURN all -- * * 192.168.122.0/24 224.0.0.0/24
0 0 RETURN all -- * * 192.168.122.0/24 255.255.255.255
34 1768 MASQUERADE tcp -- * * 192.168.122.0/24 !192.168.122.0/24 masq ports: 1024-65535
85 5512 MASQUERADE udp -- * * 192.168.122.0/24 !192.168.122.0/24 masq ports: 1024-65535
0 0 MASQUERADE all -- * * 192.168.122.0/24 !192.168.122.0/24
0 0 MASQUERADE all -- * * 192.168.111.0/24 0.0.0.0/0
13 1608 MASQUERADE all -- * * 192.168.122.0/24 0.0.0.0/0
0 0 MASQUERADE all -- * * 192.168.122.0/24 0.0.0.0/0
with the port 9867 it works great, here my nmap output:
root@kali:~# nmap <my Server> -p 9867
Starting Nmap 7.70 ( https://nmap.org ) at 2019-07-16 12:58 EDT
Nmap scan report for <my Server> (<my Server IP>)
Host is up (0.020s latency).
rDNS record for <my Server IP>: static.<my Server IP>.clients.your-server.de
PORT STATE SERVICE
9867/tcp open unknown
but my port 9888 is closed:
PORT STATE SERVICE
9888/tcp closed cyborg-systems
can anyone tell me why it’s not open? I followed the instructions above for both.
I would be very happy about an answer…
btw. can you tell me, how i can tag my question?