Noboby a écrit :
> Pascal Hambourg wrote:
>> Noboby a écrit :
>
>>> echo " Enabling phone vpn redirection."
>>> $IPTABLES -t nat -A PREROUTING -p tcp --dport 3389 --dst xxxx.xx.xx.50
>>> -j DNAT --to-destination 10.1.1.112
>> What kind of VPN uses TCP port 3389 ?
>
> Since I could not reach the router on the inside,
What router on the inside ?
> I tried reaching a
> Windows machine. 3389, as you may know, is the port for Remote Desktop
> on a Windows machine.
Ok.
>>> $IPTABLES -t nat -A POSTROUTING -s 10.0.1.112 -j SNAT --to-destination
>>> 173.11.168.50
>>
>> SNAT has no --to-destination option. What is the purpose of this rule ?
>> Shouldn't it be 10.1.1.112 instead of 10.0.1.112 ?
>
> I read that a POSTROUTING rule was necessary.
Not for a redirection (DNAT). It affects only outgoing connections, not
incoming connections.
> Yes, typo, should be 10.1.1.112,
And --to-destination should be --to-source.
>> The PREROUTING rule matches only TCP, I don't see how it could make ping
>> (ICMP echo) fail.
>
> Good point, but it does. Perhaps in combination with another rule.
No, it doesn't. A rule with "-p tcp" cannot affect ICMP packets.
> Sorry, I thought it would be obvious from my statements. As an example,
> for the test 3389 port I should be able to connect to the Windows
> machine at .112 with Remote Desktop from the outside using the .50 . I
> cannot. Even after correcting the typo, I cannot.
Connect to the Windows box with RDP involves more than the DNAT rule :
- the DNATed packets in states NEW,ESTABLISHED must be accepted in the
FORWARD chain
- the Windows box firewall must accept the packets
- the Windows box must run the RDP service
- the Windows box must have a route back to the source through the Linux
box (default gateway)
- the return packets from the Windows box in state ESTABLISHED must be
accepted in the FORWARD chain
I suggest you use packet capture on each interface of the Linux and the
Windows boxes on the path to check whether the packets are transmitted
as expected. You can also insert LOG rules to log these packets through
the iptables chains.
|