F
F
farafontov2011-07-01 12:07:06
RDP
farafontov, 2011-07-01 12:07:06

ubuntu port forwarding

There is a home web server on ubuntu 10.04 server that distributes pppoe internet to home LAN.

Internet sharing is configured according to this manual : help.ubuntu.com/community/Internet/ConnectionSharing



/etc/rc.local /etc/iptables.sav
iptables-restore < /etc/iptables.sav
exit 0



*nat
:PREROUTING ACCEPT [10:1028]
:POSTROUTING ACCEPT [6:422]
:OUTPUT ACCEPT [14:1129]
-A POSTROUTING -j MASQUERADE
COMMIT
# Completed on Thu Mar 17 16:39:01 2011
# Generated by iptables-save v1.4.4 on Thu Mar 17 16:39:01 2011
*filter
:INPUT ACCEPT [121:15427]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [232:23484]
-A FORWARD -s 192.168.0.0/24 -i -eth0 -o eth1 -m conntrack --ctstate NEW -j ACCEPT
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Thu Mar 17 16:39:01 2011
# Generated by iptables-save v1.4.4 on Thu Mar 17 16:39:01 2011
*mangle
:PREROUTING ACCEPT [13692:2096795]
:INPUT ACCEPT [3911:1206418]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2297:430096]
:POSTROUTING ACCEPT [2423:449298]
COMMIT

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
verd, 2011-07-01
@farafontov

iptables -t nat -A PREROUTING -p tcp --dport 3389 -i ppp0 -j DNAT --to 192.168.0.10
Replace ppp0 with external interface.

D
danfe, 2011-07-01
@danfe

I think something like this (if I'm confusing everything correctly, because I rarely encounter iptables):
iptables -A PREROUTING -j DNAT -p tcp --dport 3389 --to-destination 192.168.0.10

S
shadowalone, 2011-07-01
@shadowalone

there is an even simpler option - rinetd
is in native turnips.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question