LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2009, 05:48 AM   #1
mostafaashish
LQ Newbie
 
Registered: Aug 2009
Posts: 6

Rep: Reputation: 0
Exclamation Block and Allow IP using iptables in RedHat Linux 4.0


Dear Friend

I have blocked below IP by using iptables command in RedHat Linux 4.0.

Code:
iptables -A INPUT -s 192.168.0.85 -j DROP
It's now totally blocked and can't get access into web or internal network.

Please let me know how I can un-block that IP, so that it can again starts it's normal operation.

Appreciate, if you would come back at your earliest.


Regards
Pervez
 
Old 08-03-2009, 05:59 AM   #2
Tokhs
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
Greetings,

Pervez,

To remove a block:
- ssh to the machine that has blocked the user.


- If you need to, you can search the firewall for just that IP address with:
Quote:
sudo /sbin/iptables --list --numeric --verbose | /bin/grep ipaddr, e.g.
sudo /sbin/iptables --list --numeric --verbose | /bin/grep 152.2.129.83
- When you have decided that the address is indeed blocked by the firewall,
run the following command:
Quote:
sudo /sbin/iptables --delete rule -s ipaddr/32 -d 0/0 -j DROP, e.g.
sudo /sbin/iptables --delete UNC-ACCEPT-INPUT -s 152.2.129.83/32 -d 0/0 -j DROP
- Now search for the IP address again in UNC-ACCEPT-INPUT, in case the user
ended up in the firewall more than once. All instances of the IP address
must be removed from the UNC-ACCEPT-INPUT firewall rule.


All the best
 
Old 08-03-2009, 06:58 AM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by mostafaashish View Post
Dear Friend

I have blocked below IP by using iptables command in RedHat Linux 4.0.

Code:
iptables -A INPUT -s 192.168.0.85 -j DROP
It's now totally blocked and can't get access into web or internal network.

Please let me know how I can un-block that IP, so that it can again starts it's normal operation.

Appreciate, if you would come back at your earliest.


Regards
Pervez
couple of ways.

1. service iptables restart
2. iptables --list INPUT -n --line-number and then
iptables -D INPUT <linenumber>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how i block one particular domain access using squid for Redhat Linux 4.0 siri.siri143 Linux - Server 1 10-26-2007 10:30 AM
IPTables and PPTPD :S (to block or not to block) thewonka Linux - Networking 0 03-24-2005 07:58 PM
IPtables - Block all except what I allow ]SK[ Linux - Software 4 02-10-2005 07:14 AM
How to Block the Ports in linux Redhat 7.2 rajeshacpt Linux - Networking 3 07-16-2003 11:59 AM


All times are GMT -5. The time now is 11:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration