Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i need to forward incoming port 69 to port 2112 with iptables on linux. i don't need any NAT etc. just accept incoming connections to port 2112 like it be 69 pot.

Thank you!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

This should do what you want

iptables -t nat -A PREROUTING -p udp --dport 69 -j REDIRECT --to-port 2112
share|improve this answer
    
And when i run your command nothing still applied to iptables. –  Raspizdyay Aug 10 '12 at 12:54
    
@Raspizdyay: Did you list the correct table ? iptables -t nat -L ? –  Iain Aug 10 '12 at 15:03
    
but why nat? there is no nat on my computer it is just an imput –  Raspizdyay Aug 12 '12 at 9:11
    
@Raspizdyay: Port forwarding is address translation and takes place in the PREROUTING chain of the NAT table. –  Iain Aug 12 '12 at 9:28

As well as the port forwarding, you also need an extra module loaded to handle tracking tftp connections. This can be done in testing by simply running

modprobe nf_conntrack_tftp

Making it permanent depends on the distro in use, but you generally just need to put it in /etc/modules so it will be loaded at boot.

share|improve this answer

Your Answer

 
discard

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.