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