Networking Forums

Networking Forums > Computer Networking > Linux Networking > Help: How to Prevent Source Address Spoofing

Reply
Thread Tools Display Modes

Help: How to Prevent Source Address Spoofing

 
 
Amy Lee
Guest
Posts: n/a

 
      01-27-2008, 12:22 PM
Hello,

I use ADSL to link the Internet, so my ip address is not static, it's
dynamic. However, I wanna use iptables to prevent source address spoofing
which source address of packets is from my ip address.

How to accomplish it?

Thank you very much~

Regards,

Amy Lee
 
Reply With Quote
 
 
 
 
Robert Harris
Guest
Posts: n/a

 
      01-27-2008, 01:09 PM
Amy Lee wrote:
> Hello,
>
> I use ADSL to link the Internet, so my ip address is not static, it's
> dynamic. However, I wanna use iptables to prevent source address spoofing
> which source address of packets is from my ip address.
>
> How to accomplish it?
>
> Thank you very much~
>
> Regards,
>
> Amy Lee


Your question is not clear. The source address of all the IP packets
that you send should be the correct one. You cannot stop other machines
spoofing your IP address but the internet will route all packets
destined for your IP address to you.

Which packets do you want to filter out?

Robert
 
Reply With Quote
 
Amy Lee
Guest
Posts: n/a

 
      01-27-2008, 01:14 PM
On Sun, 27 Jan 2008 14:09:17 +0000, Robert Harris wrote:

> Amy Lee wrote:
>> Hello,
>>
>> I use ADSL to link the Internet, so my ip address is not static, it's
>> dynamic. However, I wanna use iptables to prevent source address spoofing
>> which source address of packets is from my ip address.
>>
>> How to accomplish it?
>>
>> Thank you very much~
>>
>> Regards,
>>
>> Amy Lee

>
> Your question is not clear. The source address of all the IP packets
> that you send should be the correct one. You cannot stop other machines
> spoofing your IP address but the internet will route all packets
> destined for your IP address to you.
>
> Which packets do you want to filter out?
>
> Robert

Thank you. I wanna filter out the packets send to my machine but which is
from my ip address.

Amy Lee
 
Reply With Quote
 
Robert Harris
Guest
Posts: n/a

 
      01-27-2008, 02:36 PM
Amy Lee wrote:
> On Sun, 27 Jan 2008 14:09:17 +0000, Robert Harris wrote:
>
>> Amy Lee wrote:
>>> Hello,
>>>
>>> I use ADSL to link the Internet, so my ip address is not static, it's
>>> dynamic. However, I wanna use iptables to prevent source address spoofing
>>> which source address of packets is from my ip address.
>>>
>>> How to accomplish it?
>>>
>>> Thank you very much~
>>>
>>> Regards,
>>>
>>> Amy Lee

>> Your question is not clear. The source address of all the IP packets
>> that you send should be the correct one. You cannot stop other machines
>> spoofing your IP address but the internet will route all packets
>> destined for your IP address to you.
>>
>> Which packets do you want to filter out?
>>
>> Robert

> Thank you. I wanna filter out the packets send to my machine but which is
> from my ip address.
>
> Amy Lee


Ah. Well you should add your iptables rule at the time when DHCP has
allocated your computer an IP address. On my system (Debian etch), that
would mean adding a little script to the directory:

/etc/dhcp3/dhclient-exit-hooks.d

where $new_ip_address will contain your new IP address. The script
should drop all packets with source and destination both the same as
$new_ip_address

Robert
 
Reply With Quote
 
Amy Lee
Guest
Posts: n/a

 
      01-29-2008, 03:24 PM
On Sun, 27 Jan 2008 15:36:52 +0000, Robert Harris wrote:

> Amy Lee wrote:
>> On Sun, 27 Jan 2008 14:09:17 +0000, Robert Harris wrote:
>>
>>> Amy Lee wrote:
>>>> Hello,
>>>>
>>>> I use ADSL to link the Internet, so my ip address is not static, it's
>>>> dynamic. However, I wanna use iptables to prevent source address spoofing
>>>> which source address of packets is from my ip address.
>>>>
>>>> How to accomplish it?
>>>>
>>>> Thank you very much~
>>>>
>>>> Regards,
>>>>
>>>> Amy Lee
>>> Your question is not clear. The source address of all the IP packets
>>> that you send should be the correct one. You cannot stop other machines
>>> spoofing your IP address but the internet will route all packets
>>> destined for your IP address to you.
>>>
>>> Which packets do you want to filter out?
>>>
>>> Robert

>> Thank you. I wanna filter out the packets send to my machine but which is
>> from my ip address.
>>
>> Amy Lee

>
> Ah. Well you should add your iptables rule at the time when DHCP has
> allocated your computer an IP address. On my system (Debian etch), that
> would mean adding a little script to the directory:
>
> /etc/dhcp3/dhclient-exit-hooks.d
>
> where $new_ip_address will contain your new IP address. The script
> should drop all packets with source and destination both the same as
> $new_ip_address
>
> Robert

Thank you. But my OS is RHEL 3, it seems that I can't find the directory.

Regards,

Amy
 
Reply With Quote
 
Robert Harris
Guest
Posts: n/a

 
      01-29-2008, 04:47 PM
Amy Lee wrote:
> On Sun, 27 Jan 2008 15:36:52 +0000, Robert Harris wrote:
>
>> Amy Lee wrote:
>>> On Sun, 27 Jan 2008 14:09:17 +0000, Robert Harris wrote:
>>>
>>>> Amy Lee wrote:
>>>>> Hello,
>>>>>
>>>>> I use ADSL to link the Internet, so my ip address is not static, it's
>>>>> dynamic. However, I wanna use iptables to prevent source address spoofing
>>>>> which source address of packets is from my ip address.
>>>>>
>>>>> How to accomplish it?
>>>>>
>>>>> Thank you very much~
>>>>>
>>>>> Regards,
>>>>>
>>>>> Amy Lee
>>>> Your question is not clear. The source address of all the IP packets
>>>> that you send should be the correct one. You cannot stop other machines
>>>> spoofing your IP address but the internet will route all packets
>>>> destined for your IP address to you.
>>>>
>>>> Which packets do you want to filter out?
>>>>
>>>> Robert
>>> Thank you. I wanna filter out the packets send to my machine but which is
>>> from my ip address.
>>>
>>> Amy Lee

>> Ah. Well you should add your iptables rule at the time when DHCP has
>> allocated your computer an IP address. On my system (Debian etch), that
>> would mean adding a little script to the directory:
>>
>> /etc/dhcp3/dhclient-exit-hooks.d
>>
>> where $new_ip_address will contain your new IP address. The script
>> should drop all packets with source and destination both the same as
>> $new_ip_address
>>
>> Robert

> Thank you. But my OS is RHEL 3, it seems that I can't find the directory.
>
> Regards,
>
> Amy

I really don't know that system too well. Try:

man dhclient

which should tell you where to look for things.

Robert
 
Reply With Quote
 
goarilla@work
Guest
Posts: n/a

 
      01-30-2008, 09:17 AM
Robert Harris wrote:
> Amy Lee wrote:
>> On Sun, 27 Jan 2008 15:36:52 +0000, Robert Harris wrote:
>>
>>> Amy Lee wrote:
>>>> On Sun, 27 Jan 2008 14:09:17 +0000, Robert Harris wrote:
>>>>
>>>>> Amy Lee wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I use ADSL to link the Internet, so my ip address is not static, it's
>>>>>> dynamic. However, I wanna use iptables to prevent source address spoofing
>>>>>> which source address of packets is from my ip address.
>>>>>>
>>>>>> How to accomplish it?
>>>>>>
>>>>>> Thank you very much~
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Amy Lee
>>>>> Your question is not clear. The source address of all the IP packets
>>>>> that you send should be the correct one. You cannot stop other machines
>>>>> spoofing your IP address but the internet will route all packets
>>>>> destined for your IP address to you.
>>>>>
>>>>> Which packets do you want to filter out?
>>>>>
>>>>> Robert
>>>> Thank you. I wanna filter out the packets send to my machine but which is
>>>> from my ip address.
>>>>
>>>> Amy Lee
>>> Ah. Well you should add your iptables rule at the time when DHCP has
>>> allocated your computer an IP address. On my system (Debian etch), that
>>> would mean adding a little script to the directory:
>>>
>>> /etc/dhcp3/dhclient-exit-hooks.d
>>>
>>> where $new_ip_address will contain your new IP address. The script
>>> should drop all packets with source and destination both the same as
>>> $new_ip_address
>>>
>>> Robert

>> Thank you. But my OS is RHEL 3, it seems that I can't find the directory.
>>
>> Regards,
>>
>> Amy

> I really don't know that system too well. Try:
>
> man dhclient
>
> which should tell you where to look for things.
>
> Robert


or man dhcpcd ...
 
Reply With Quote
 
Stefan Schmidt
Guest
Posts: n/a

 
      01-30-2008, 12:10 PM
On 2008-01-27, Amy Lee <(E-Mail Removed)> wrote:
> Hello,


Moin moin,

> I use ADSL to link the Internet, so my ip address is not static, it's
> dynamic. However, I wanna use iptables to prevent source address spoofing
> which source address of packets is from my ip address.
>
> How to accomplish it?


Actually i don't think you need to. By default the Linux kernel does
prevent that kind of thing anyways - check if
sysctl -a|grep \.rp_filter
is on (i.e. set to 1).

After a quick google for linux, rp_filter and forwarding i found these to
be helpful descriptions for it:

"# When using IPv4 packet forwarding, you will also get the
# rp_filter, which automatically rejects incoming packets if the
# routing table entry for their source address doesn't match the
# network interface they're arriving on"

"The rp_filter variable sets up a reverse patch (rp) filter on the
specific interface. What this means, is quite simple. All it does, is to
validate that the actual source address used by packets correlates
properly with our routing table, and that packets with this specific
source IP address are supposed to get their replies back through that
interface again."

Zap
 
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
Spoofing IP address from Firefox H.K. Kingston-Smith Linux Networking 2 09-05-2008 06:29 PM
Help: Source Address Spoofing Amy Lee Linux Networking 1 01-25-2008 06:57 PM
spoofing Hot Spot Mac Address mustafa.badawi@gmail.com Wireless Internet 10 12-15-2006 06:28 AM
Spoofing a PCI Lan MAC Address? Terry Home Networking 6 03-07-2006 12:26 PM
Spoofing a MAC Address R.Daneel Olivaw Broadband 4 09-07-2005 09:33 PM



1 2 3 4 5 6 7 8 9 10 11