Blocking an IP address

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Blocking an IP address
# 1  
Old 02-22-2011
Java Blocking an IP address

Dear all,

I am new to this forum.I need some assistant from you people.

I have a server in which Linux 5 is installed and it is in the network. How i block any user to access my server.. Upto how many users i can block.. send me the procedure....



Thank you in advance......
# 2  
Old 02-22-2011
i didn't understand the purpose of this...can u elaborate more on your requirement....if you dont want ur server to be accessed dont create the user account :-)
# 3  
Old 02-22-2011
the server is in network to which many computers are connected. All the users on the systems are accessing it. I just want to block a perticular IP or the user using that ip who is not able to access that server...

How to do that..

plz reply.
# 4  
Old 02-22-2011
Please give as much information as possible when asking such questions. No one here knows your network, and no 2 networks are the same. No one here knows your machine, and what services are running there. No one here knows your users, or why they have to be blocked.

So: what services are running on your machine? Which one do you want to block for a user? If it's a webservice, do you want to completely block that user, or just for certain applications in that service? Is the user always connecting with the same IP, or do they switch workstations/get new IPs (DHCP)?
# 5  
Old 02-22-2011
Also,

Please refrain from calling it "Linux 5." The Linux kernel is on version 2.6.3x. Red Hat puts out a distribution called "Red Hat Enterprise Linux" and you are likely on version 5 of that software. Calling it "Linux 5" can cause confusion, even if it is under the Red Hat forums.

That being said,

You may want to look into hosts.deny and perhaps iptables. Hosts.deny will disallow logins from certain areas and iptables can simply drop packets from a particular rule base, which can contain an IP address or range.
# 6  
Old 02-22-2011
If you have iptables configured and running:
Code:
iptables -I INPUT -s <IP_ADDRESS_TO_BLOCK> -j DROP
service iptables reload

Replace <IP_ADDRESS_TO_BLOCK> with the ip address you want to block.

You can check the status of your iptables service with:
Code:
service iptables status

# 7  
Old 02-22-2011
Quote:
Originally Posted by fpmurphy
If you have iptables configured and running:
Code:
iptables -I INPUT -s <IP_ADDRESS_TO_BLOCK> -j DROP
service iptables reload

Sorry but this is not going to work as you have stated here. Once you have given the first line there is no reason to execute the second as it will only reload the saved rules and thus remove the rule you just added. The command to save the running rules is:

Code:
service iptables save

You need to save the running rules first so that you will have them when you reboot.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

C program to detect duplicate ip address if any after assigning ip address to ethernet interface

Hi , Could someone let me know how to detect duplicate ip address after assigning ip address to ethernet interface using c program (3 Replies)
Discussion started by: Gopi Krishna P
3 Replies

2. Programming

Which are blocking and non-blocking api's in sockets in C ?

among the below socket programming api's, please let me know which are blocking and non-blocking. socket accept bind listen write read close (2 Replies)
Discussion started by: VSSajjan
2 Replies

3. IP Networking

ping blocking

Hi I am starting to practice nmap for my own education. Now I created two host in virtual box. Bot are scientific linux, one in installed as web server and the other as developing station. I tried to run nmap on so I did nmap on their IP address, I got an answer that ip is down or that... (8 Replies)
Discussion started by: programAngel
8 Replies

4. UNIX for Dummies Questions & Answers

Blocking signals

I know how to add signal to a set. But what if I want to add 2 or 3 signals to the set. I know I can use sigaddset (&set,SIGBUS)....but what if I want to add SIGBUS and SIGALRM at once. Do i have to do it like this.. sigaddset (&set,SIGBUS); sigaddset (&set,SIGALRM); Is there another way to... (0 Replies)
Discussion started by: joker40
0 Replies

5. Programming

non blocking connect

OS : solaris 10 X86 I created stream socket, tries to connect to port 7 on the remote machine. After doing the non blocking connect call I did select with time out value is 3 secs. I am always getting timed out though I am writing prior to select. code: x=fcntl(S,F_GETFL,0);... (1 Reply)
Discussion started by: satish@123
1 Replies

6. IP Networking

Tracing a MAC address to IP address: Solaris

Hi there I lost connectivity to one of our remote systems and when I checked the messages log I found the following: Aug 10 23:42:34 host xntpd: time reset (step) 1.681729 s Aug 16 13:20:51 host ip: WARNING: node "mac address" is using our IP address x.x.x.x on aggr1 Aug 16 13:20:51 host... (9 Replies)
Discussion started by: notreallyhere
9 Replies

7. UNIX for Advanced & Expert Users

ps blocking

Hi Folks I have been debugging a script that is called every thirty seconds. Basically it is doing a ps, well two actually, one to file (read by the getline below) and the other into a pipe. The one into the pipe is: - V_SYSVPS=/usr/sysv/bin/ps $V_SYSVPS -p$PIDLIST -o$PSARGS... (0 Replies)
Discussion started by: steadyonabix
0 Replies

8. UNIX for Dummies Questions & Answers

Panic kernal-mode address fault on user address 0x14

:) Firstly Hi all!!, im NEW!! and on here hoping that someone might be able to offer me some help... i have a server that keeps crashing every few days with the error message: PANIC KERNAL-MODE ADDRESS FAULT ON USER ADDRESS 0X14 KERNAL PAGE FAULT FROM (CS:EIP)=(100:EF71B5BD) EAX=EF822000... (10 Replies)
Discussion started by: Twix
10 Replies

9. IP Networking

How to Achive IP address through MAC(Ethernet) address

Hi sir, i want to make such programe which takes MAC(Ethernet) address of any host & give me its IP address....... but i'm nt getting that how i can pass the MAC address to Frame........ Please give me an idea for making such program... Thanks & regards Krishna (3 Replies)
Discussion started by: krishnacins
3 Replies

10. IP Networking

blocking DHCP

I've got a legit DHCP server on my network. I've got a 3550 as my VTP server providing 4 vlans to 4 2950 switches. If somebody were to plug into one of those vlans with a DHCP server configured then it would throw off my whole network. How could i block the DHCP server that could plug into the... (2 Replies)
Discussion started by: byblyk
2 Replies
Login or Register to Ask a Question