Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to block specific IPs?

Reply
Thread Tools Display Modes

How to block specific IPs?

 
 
kernel.lover
Guest
Posts: n/a

 
      04-01-2005, 11:35 AM
Hello,
I want to block specific IPs or allow specific IPs at
Ethernet level. How can i do that? I dont want those blocked IP
packets to reach IP layer instead reject them by NIC or any program
after processing Ethernet layer?
If thats not possible then is there any way to allow packets
with only specific HW address of NICs?

regards,
cranium.
 
Reply With Quote
 
 
 
 
James Knott
Guest
Posts: n/a

 
      04-01-2005, 11:58 AM
kernel.lover wrote:

> Hello,
> I want to block specific IPs or allow specific IPs at
> Ethernet level. How can i do that? I dont want those blocked IP
> packets to reach IP layer instead reject them by NIC or any program
> after processing Ethernet layer?
> If thats not possible then is there any way to allow packets
> with only specific HW address of NICs?


How are you planning to determine the IP, if you don't let it reach the IP
layer?

Perhaps you'd better describe what it is you're trying to do.

 
Reply With Quote
 
Mihai Osian
Guest
Posts: n/a

 
      04-01-2005, 12:14 PM
kernel.lover wrote:

>Hello,
> I want to block specific IPs or allow specific IPs at
>Ethernet level. How can i do that? I dont want those blocked IP
>packets to reach IP layer instead reject them by NIC or any program
>after processing Ethernet layer?
> If thats not possible then is there any way to allow packets
>with only specific HW address of NICs?
>
>regards,
>cranium.
>
>

Iptables can reject packets based on the HW (MAC) address. Read the
firewall tutorials from http://www.netfilter.org. But remember that most
ethernet cards allow you to change their MAC address from software (in
Linux: man ifconfig), which means that a user with some IT knowledge can
pass through your firewall if he hijacks the MAC address of a computer
which has access.

Mihai
 
Reply With Quote
 
David Serrano (Hue-Bond)
Guest
Posts: n/a

 
      04-03-2005, 12:39 AM
kernel.lover, vie20050401@13:35:27(CEST):
>
> I want to block specific IPs or allow specific IPs at Ethernet level.


Ethernet knows nothing about IP addresses.


> is there any way to allow packets with only specific HW address of NICs?


Yes it is. But beware that, as someone said, MAC addresses can be spoofed.


--
David Serrano
 
Reply With Quote
 
Marcin Szczepaniak
Guest
Posts: n/a

 
      04-08-2005, 08:53 AM
At 1 Apr 2005 03:35:27 -0800 kernel.lover wrote:
> Hello,
> I want to block specific IPs or allow specific IPs at
> Ethernet level. How can i do that? I dont want those blocked IP
> packets to reach IP layer instead reject them by NIC or any program
> after processing Ethernet layer?
> If thats not possible then is there any way to allow packets
> with only specific HW address of NICs?


Maybe ebtables will be good ?


--
z powazaniem "Don't be afraid to take a big step.
Marcin Szczepaniak You can't cross a chasm in two small jumps."
-- David Lloyd George

 
Reply With Quote
 
Raqueeb Hassan
Guest
Posts: n/a

 
      04-09-2005, 02:30 AM
# to block a MAC Address
/sbin/iptables -A macblock -m mac --mac-source 00:XX:XX:XX:XX:XX -j
DROP

or ... something like this ....

#!/bin/sh

/sbin/iptales -N mac_chains

for foo in `cat /etc/macs.allowed`
do
iptables -A mac_chains -j ACCEPT -m mac --mac-source "$foo"
done

/sbin/iptables -A INPUT -p tcp -j mac_chains
/sbin/iptables -A FORWARD -p tcp -j mac_chains

and add those addresses in /etc/macs.allowed.

Raqueeb Hassan
Bangladesh

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Block specific SSID Dan @ HBA Wireless Networks 3 04-22-2008 12:03 AM
how to block a specific website... RJK Wireless Networks 6 11-05-2007 12:23 PM
Utility to block traffic to one specific IP address robpimentel@yahoo.com Windows Networking 4 10-15-2007 03:40 AM
Can I block specific networks from being detected trippwwf Wireless Networks 6 05-31-2005 07:50 PM
D-Link DSL504 (how to block specific IP internet access) Shane Mallia Broadband 6 10-28-2003 10:31 PM



1 2 3 4 5 6 7 8 9 10 11