Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using my server as NAT/router, which works well. But now I'm trying to forward port 3478, which I can't get to work.

eth0 = public interface
eth1 = private network

$ cat /proc/sys/net/ipv4/conf/eth0/forwarding
$ cat /proc/sys/net/ipv4/conf/eth1/forwarding

Then to forward port 3478 to, I read somewhere that I should run

iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 3478 -j DNAT --to-destination
iptables -A FORWARD -p tcp -d --dport 3478 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

I also ran

ufw allow 3478

But testing port 3478 with doesn't work. Any idea what I have done wrong?

share|improve this question
Here's a few methods of port forwarding… – Ben Lessani - Sonassi Sep 22 '12 at 13:55
Does the machine also have a proper Netfilter MASQUERADING or SNAT rule? – Alexander Janssen Oct 8 '12 at 17:51
@AlexanderJanssen No idea, it's a Win 7 box – Znarkus Oct 9 '12 at 8:35
@Znarkus in mean in your Ubuntu firewall. Check the OUTPUT chain of the NAT table. – Alexander Janssen Oct 9 '12 at 8:40
@AlexanderJanssen iptables -L OUTPUT -t nat looks empty. – Znarkus Oct 9 '12 at 12:40

I use port forwarding (and working) on Ubuntu server with:

-A PREROUTING -i eth0 -p tcp --dport 3478 -j DNAT --to

-A FORWARD -p tcp -i eth0 -d --dport 3478 -j ACCEPT
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.