There is no ioctl to set your MAC address. TCP sessions maintenance will be a problem anyhow, if you spoof your MAC address the arp-cache of the receiving host (or the router) will be updated with an entry of your ip and the spoofed mac. When answering, it will send the packet back to the spoofed MAC, so you have to sniff the net, grab the answer and process it yourself. I think what you want is libnet (http://www.packetfactory.net/projects/libnet) and libpcap (www.tcpdump.org). 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