LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Blocking a IP address (https://www.linuxquestions.org/questions/linux-server-73/blocking-a-ip-address-860817/)

mosharaf_linux 02-04-2011 11:28 PM

Blocking a IP address
 
How to block an ip address from mikrotik so that when a fake user use this ip he does'nt get internet but in the mean time real user gets internet. Real user will not harm if fake user trying to access.

Kenny_Strawn 02-05-2011 12:34 AM

I can't understand this post. First of all, if you block an IP address you only block *one* site, not the entire Internet (unless you're talking about blocking the IP address of the computer in question). Secondly, the grammar in that post is hard to understand.

However, to block Internet access from a particular user, what you would do is take the Internet configuration files (/etc/hosts and /etc/resolv.conf) and edit the permissions on them so that the user(s) in question cannot access them at all -- perhaps by logging into that user's account and typing:

Code:

sudo chmod u-rwx /etc/hosts
sudo chmod u-rwx /etc/resolv.conf

Then, log into your account again. In doing this to users one by one you can block them from accessing the Internet at all.

mosharaf_linux 02-10-2011 02:26 AM

I just means that in local network when 2 pc are connected by a switch assigning same ip address. Is there any solution that one user can get desire service but other user not?

lazydog 02-10-2011 04:27 PM

You could use IPTABLES and block on the MAC address. Then it doesn't matter what IP Address he has his connections will be blocked.

I just question why you allow someone to use a fake IP Addres on your network.


All times are GMT -5. The time now is 12:05 PM.