Port Forwarding

Alright, I have a small network.

The gateway runs firewall/NAT/forwarding.

I already have test web server running on the firewall computer at this point. It has a firewall script via iptables.

It accepts external connections on port 81, and that works fine. But I want to forward port 5222 to another host.

Here's the lines in my script that are significant:

iptables -t nat -A PREROUTING -i ppp0 -d $EXTIP -p tcp --dport 5222 -j DNAT --to 192.168.0.9:81
iptables -A FORWARD -p tcp -i ppp0 -d 192.168.0.9 --dport 81 -j ACCEPT

-----

$EXTIP is for my dynamic IP. That part works fine.

No server found on external connect however. Works fine connecting directly to 192.168.0.9 from the internal network.

0

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Port Forwarding

my answer from yesterday is gone??
anyway.
without all rules it is a little bit difficult to answer. maybe forwarding not enabled?
echo 1 > /proc/sys/net/ipv4/ip_forward

Syndicate content