RE: Spoofing MAC address in tcp transmission

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This seems to be straight forward solution. Thanx Pat for your suggestion.

Infact, I am trying to come up with a multi homed host each having itz own
MAC (and IP address too probably).
I was looking for a way of adding each virtual MAC (corresponding to each
virtual machine) to the multicast group of my host (using setsockopt and
PACKET_ADD_MEMBERSHIP, PACKET_MR_MULTICAST option) hoping that I will
receive packets destined to my virtual machine at my physical interface.

I had problems with this approach though (wondering what MAC address to
provide in multicast group address field "mr_address" of "packet_mreq"
structure). If i give this multicast group address as 01-xx-xx-xx-xx-xx, my
application receives any packet destied to it irrespective of whether i add
my socket to the multicast group or not. This is because the multicast bit
is set in my multicast group address. If i specify address for which the
multicast bit is not set, I won't receive it. Can u tell me whatz wrong with
this? Am I doing the correct stuff?

But with your suggested solution, I need not have multicast group set at
all. My app should take care of handling my virtual hosts because, all
packets destined to my virtual host will be sent to my physical interface
(provided i update the ARP cache correctly). I just have to sniff and handle
it, as u said.

Thanx again,
Chak.


>What you could do is sending out your packet with the spoofed MAC and
>right after it send an arp reply xxx.xxx.xxx.xxx is at aa:bb:cc:dd:ee:ff
>to the MAC of the receiving host with your ip and the real MAC.


Greets,
Patrick

chakri schrieb:
>
> Hi,
>
> How do i spoof the source MAC address when sending a TCP packet in Linux
> platform?
> Is there any ioctl sortof which will allow me to write an arbitrary source
> MAC address before sending the packet onto the ethernet?
> I tried using the packet sockets for spoofing the MAC address.. in this
> case, everything works out at the ethernet level.. so tcp session
> maintenance will a problem.
> Can anybody suggest me some approach to solve this problem?
>
> Thanks in advance.
>
> Greetings,
> Chakri
>
> -
> : send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux