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

My server is Red Hat Enterprise Linux Server release 5.

iptables version is v1.3.5.

I want to allow all UDP connections / port for the IP address 192.168.0.200. This IP address is configured in my eth0. So basically I want to set it up the same as my local loopback (127.0.0.1) UDP traffic.

What is the iptable command to allow all UDP connections / ports for IP 192.168.0.200?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The basic command is:

iptables -I INPUT 1 -p udp -d 192.168.0.200 -j ACCEPT

This will add the rule at the beginning of the INPUT chain. You may need to specify a different chain depending on what your current rules look like though. See the iptables(8) man page for more details.

Also, the rule is for all packets going to .200. If you meant packets coming from .200 then change the -d to -s.

share|improve this answer
    
@Ignacio In case, if I want to set it up either way. Is it valid to execute both commands iptables -I INPUT 1 -p udp -d 192.168.0.200 -j ACCEPT and iptables -I INPUT 1 -p udp -s 192.168.0.200 -j ACCEPT. Or is there a single command to do this? –  Gnanam Apr 12 '10 at 7:54
    
You shouldn't need to do both. Since this is on the INPUT chain, only one of the endpoints can be .200. If it's the local machine then use -d, otherwise use -s. –  Ignacio Vazquez-Abrams Apr 12 '10 at 8:26
    
What does 1 after INPUT mean? –  Gnanam Apr 12 '10 at 8:53
add comment

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.