How to Block All UDP Ports in Ubuntu Linux


The User Datagram Protocol, or UDP, directs network data to specific programs using a designated Internet Protocol address, which all programs that connect to the network through the same adapter share, plus a unique port number. If you're diagnosing network problems or debugging an application, you may need to block UDP packets from reaching any port on the computer. You can configure your Ubuntu Linux system to block all UDP ports.

  • Log in to the computer.

  • Click on the "Terminal" desktop shortcut to launch a command shell. Click on the newly opened Terminal window to select it.

  • Type "sudo bash" into the Terminal window and press "Enter." Enter the password corresponding to the user name you used to log in, then press "Enter." Ubuntu elevates the current shell to the superuser -- or "root" -- privilege level.

  • Type "iptables -A INPUT -p udp -j DROP" and press "Enter." Type "iptables -A OUTPUT -p udp -j DROP" and press "Enter." Ubuntu blocks all incoming and outgoing traffic on the computer's UDP ports.

Related Searches


Promoted By Zergnet


You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!