S
S
simple_math2014-01-25 18:27:06
linux
simple_math, 2014-01-25 18:27:06

Oracle Linux. Another question about port forwarding from a noob

It is necessary to access from the outside via rdp to a computer in LAN
Here is a clumsy network diagram:
a1b81e08fa6a.jpg
On computer 133 (Win XP) I registered the default gateway 137. It does not go online. 94 address pings.
I write these rules:

# Generated by iptables-save v1.4.7 on Sat Jan 25 21:39:35 2014
*nat
:PREROUTING ACCEPT [13:3745]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [3:180]
:POSTROUTING ACCEPT [3:180]
-A PREROUTING -d XXX.XXX.XXX.94/32 -p tcp -m tcp --dport 3389 -j DNAT --to-destination 10.30.105.133:3389 
-A POSTROUTING -s 10.30.105.0/24 -o eth1 -p tcp -j SNAT --to-source XXX.XXX.XXX.94 
COMMIT
# Completed on Sat Jan 25 21:39:35 2014
# Generated by iptables-save v1.4.7 on Sat Jan 25 21:39:35 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1439173:120482899]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -p icmp -j ACCEPT 
-A INPUT -i lo -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT 
-A INPUT -j REJECT --reject-with icmp-host-prohibited 
-A INPUT -i eth1 -p tcp -m tcp --dport 3389 -j ACCEPT 
-A FORWARD -j REJECT --reject-with icmp-host-prohibited 
-A FORWARD -i eth1 -p tcp -m tcp --dport 3389 -j ACCEPT 
-A FORWARD -i eth1 -p tcp -m tcp --dport 3389 -j ACCEPT 
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT 
COMMIT

Help me please!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
praporshik, 2014-01-25
@praporshik

If you just need to release this host to the outside world, then instead
of -A POSTROUTING -s 10.30.105.0/24 -o eth1 -p tcp -j SNAT --to-source XXX.XXX.XXX.94
we write
-A POSTROUTING -o eth1 -j MASQUERADE

B
brutal_lobster, 2014-01-27
@brutal_lobster

Comment out the line
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question