RDP over iptables
IPTABLES='/usr/sbin/iptables'
IP_EXT="external server ip-address "
IP_INT="internal server ip-address "
SRDP_PORT="external RDP-port"
DRDP_PORT="real rdp port"
RDP_HOST_IP="real ip of RDP-host"
$IPTABLES -t nat -I PREROUTING --dst $IP_EXT -p tcp --dport $SRDP_PORT -j DNAT --to-destination $RDP_HOST_IP:$DRDP_PORT
$IPTABLES -t nat -I POSTROUTING -p tcp --dst $RDP_HOST_IP --dport $DRDP_PORT -j SNAT --to-source $IP_INT
$IPTABLES -t nat -I OUTPUT --dst $IP_EXT -p tcp --dport $SRDP_PORT -j DNAT --to-destination $RDP_HOST_IP:$DRDP_PORT
$IPTABLES -I FORWARD -i $IP_INT --dst $RDP_HOST_IP -j ACCEPT
IPTABLES='/usr/sbin/iptables'
IP_EXT="external server ip-address "
IP_INT="internal server ip-address "
SRDP_PORT="external RDP-port"
DRDP_PORT="real rdp port"
RDP_HOST_IP="real ip of RDP-host"
$IPTABLES -t nat -I PREROUTING --dst $IP_EXT -p tcp --dport $SRDP_PORT -j DNAT --to-destination $RDP_HOST_IP:$DRDP_PORT
$IPTABLES -t nat -I POSTROUTING -p tcp --dst $RDP_HOST_IP --dport $DRDP_PORT -j SNAT --to-source $IP_INT
$IPTABLES -t nat -I OUTPUT --dst $IP_EXT -p tcp --dport $SRDP_PORT -j DNAT --to-destination $RDP_HOST_IP:$DRDP_PORT
$IPTABLES -I FORWARD -i $IP_INT --dst $RDP_HOST_IP -j ACCEPT
Комментариев нет:
Отправить комментарий