How to relax firewall for UDP connections/ports for a specific IP address?

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?


Solution 1:

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.