udp portforward on same interface
Hi
I'm using iptables as a firewall system and I'm very pleased. But I'm trying to make a rule which forwards a udp port to another on the same interface.. I want users who connect to port 78 be redirected to port 98.. Is it possible to do this with iptables? If yes.. Could someone give me an example.. thank you..
Amir
This doesn't belong on netfilter-devel as it's clearly a user question which can even be easily answered by looking at the manpage.
Example:
iptables -t nat -A PREROUTING -i <if> -p udp --dport 78 -j REDIRECT --to-ports 98 iptables -A INPUT -i <if> -p tcp --dport 98 -j ACCEPT
Bye
Patrick
Quoted 6 lines · Amir Zangeneh
Hi
I'm using iptables as a firewall system and I'm very pleased. But I'm trying to make a rule which forwards a udp port to another on the same interface.. I want users who connect to port 78 be redirected to port 98.. Is it possible to do this with iptables? If yes.. Could someone give me an example.. thank you..
Amir
Hello,
first of all this is the the netfilter developing mailing list, maybe you try the users mailing list next time?? ;-)
What you want to do can easily be done with the REDIRECT target. Try something like
iptables -t nat -A PREROUTING -p udp --dport 78 -j REDIRECT --to-ports 98
Hope this helps ;-)
Sven
Quoted 6 lines · Amir Zangeneh
Hi
I'm using iptables as a firewall system and I'm very pleased. But I'm trying to make a rule which forwards a udp port to another on the same interface.. I want users who connect to port 78 be redirected to port 98.. Is it possible to do this with iptables? If yes.. Could someone give me an example.. thank you..
Amir
Uhhh, and don't forget to ACCEPT traffic for UDP port 98 in filter table INPUT
Sven
Quoted 6 lines · Amir Zangeneh
Hi
I'm using iptables as a firewall system and I'm very pleased. But I'm trying to make a rule which forwards a udp port to another on the same interface.. I want users who connect to port 78 be redirected to port 98.. Is it possible to do this with iptables? If yes.. Could someone give me an example.. thank you..
Amir