Thursday, May 2, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2492  / 3 Years ago, sun, august 29, 2021, 7:55:42

KVM Guest is a Windows machine. I set the hooks to forward port 3389 to the guest. But RDP cannot connect. RDP is enabled in Guest. Does someone have an idea?



Guest="win"
Guest_ip="192.168.1.3"

if [[ $1 = $Guest ]]
then
if [[ $2 = "stopped" || $2 = "reconnect" ]]
then
iptables -t nat -D PREROUTING -i eth0 -p tcp --dport 3389 -j DNAT --to $Guest_ip:3389
iptables -D FORWARD -d $Guest_ip -p tcp -m state --state NEW -m tcp
--dport 3389 -j ACCEPT
fi
if [[ $2 = "start" || $2 = "reconnect" ]]
then
iptables -t nat -I PREROUTING -i eth0 -p tcp --dport 3389 -j DNAT --to $Guest_ip:3389
iptables -I FORWARD -d $Guest_ip -p tcp -m state --state NEW -m tcp
--dport 3389 -j ACCEPT
fi
fi



Destination Gateway Genmask Flags Metric Ref Use Iface

default 10.1.226.206 0.0.0.0 UG 0 0 0 eth0

10.1.226.206 * 255.255.255.254 U 0 0 0 eth0

10.1.226.207 * 255.255.255.255 UH 0 0 0 eth0

192.168.1.0 * 255.255.255.0 U 0 0 0 virbr0



More From » virtualization

 Answers
4

No hooks:



redir --lport 3389 --caddr=GuestIP --cport 3389

[#10375] Monday, August 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
huovie

Total Points: 234
Total Questions: 99
Total Answers: 105

Location: Central African Republic
Member since Sun, Feb 26, 2023
1 Year ago
;