Linux / UNIX Tech Support Forum
This is a discussion on Blocking ports in linux within the Linux software forums, part of the Linux Getting Started category; How do i block ports in linux as i do not want to give access to everyone... How do i ...
|
Register free or login to your existing account and remove all advertisements. |
|
|||||||
| Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
||||
|
The easiest way to block particular TCP port in Linux is use iptables rule as follows:
Code:
iptables -A INPUT -p tcp --destination-port PORT-NUBMER -j DROP Code:
iptables -A INPUT -p tcp --destination-port 22 -j DROP Code:
iptables -A INPUT -p tcp --destination-port 22 -s \! 202.65.11.10 -j DROP Code:
iptables -A INPUT -p udp --destination-port PORT-NUBMER -j DROP
__________________
Vivek Gite Linux Evangelist |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| blocking streaming | zafar466 | CentOS / RHEL / Fedora | 0 | 04-12-2008 03:37 AM |
| How to drop all ports except mentioned in script | deltamails | Networking, Firewalls and Security | 2 | 05-15-2007 12:54 PM |
| Open Mail Ports | B!n@ry | Linux software | 31 | 12-29-2006 02:19 AM |
| iptables rules blocking ftp | hammooda | Linux software | 7 | 09-23-2006 04:24 PM |
| Linux : How do I verify which ports are listening? | sweta | Getting started tutorials | 0 | 07-30-2006 10:02 PM |