Networking Forums

Networking Forums > Computer Networking > Linux Networking > Source MAC address per IP packet

Reply
Thread Tools Display Modes

Source MAC address per IP packet

 
 
albrechtuhlmann@gmx.net
Guest
Posts: n/a

 
      06-15-2008, 07:02 PM
Hello,

for a networking application, I need to set the source MAC address
individually
for every IP packet that I send. Is this possible at all? I know that
the MAC address
can be changed in software but per IP frame? On the other hand, every
layer 2
switch does exactly this, so it must be possible in principle. Do I
need special
network controller chips that support this feature? All datasheets of
ethernet
controllers I got hands on allow you to program the MAC address but it
is then
automatically filled in for every packet.

Also, how would the programming side look like? I presume I must use
RAW sockets
but in which field would I set the source MAC address?

Thanks,

Albrecht
 
Reply With Quote
 
 
 
 
hat-trick
Guest
Posts: n/a

 
      08-10-2008, 05:51 PM
On Jun 15, 3:02*pm, albrechtuhlm...@gmx.net wrote:
> Hello,
>
> for a networking application, I need to set the source MAC address
> individually
> for every IP packet that I send. Is this possible at all? I know that
> the MAC address
> can be changed in software but per IP frame? On the other hand, every
> layer 2
> switch does exactly this, so it must be possible in principle. Do I
> need special
> network controller chips that support this feature? All datasheets of
> ethernet
> controllers I got hands on allow you to program the MAC address but it
> is then
> automatically filled in for every packet.
>
> Also, how would the programming side look like? I presume I must use
> RAW sockets
> but in which field would I set the source MAC address?
>
> Thanks,
>
> Albrecht


Albrecht,

For what practical, benevolent purpose would you ever need to do
this!?

hat trick
 
Reply With Quote
 
Patrick Schaaf
Guest
Posts: n/a

 
      08-11-2008, 06:17 AM
hat-trick <(E-Mail Removed)> writes:

>For what practical, benevolent purpose would you ever need to do this!?


What about replaying network traces to test (possibly modified)
packet filter rules? What about generating specifically formatted
packets to test such rules where they try to match MAC addresses
(whatever good that would do)? What about testing layer 2 switch
MAC table overflow characteristics?

best regards
Patrick
 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      08-11-2008, 01:44 PM
On Aug 10, 10:51*am, hat-trick <marcmath...@comcast.net> wrote:

> Albrecht,
>
> For what practical, benevolent purpose would you ever need to do
> this!?


Aside from all the others suggested, the most obvious would be if you
are implementing a transparent layer 2 switch/bridge.

DS

 
Reply With Quote
 
Burkhard Ott
Guest
Posts: n/a

 
      08-12-2008, 12:31 PM
Am Sun, 10 Aug 2008 10:51:49 -0700 schrieb hat-trick:

> On Jun 15, 3:02Â*pm, albrechtuhlm...@gmx.net wrote:


>> for every IP packet that I send. Is this possible at all? I know that
>> the MAC address
>> can be changed in software but per IP frame? On the other hand, every
>> layer 2
>> controllers I got hands on allow you to program the MAC address but it
>> is then
>> automatically filled in for every packet.
>>
>> Also, how would the programming side look like? I presume I must use
>> RAW sockets
>> but in which field would I set the source MAC address?
>>


What about /usr/src/linux/if_ether.h ?
(struct ethhdr)

You can set the MAC address to what ever you want.

cheers
 
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
Help: Source Address Spoofing Amy Lee Linux Networking 1 01-25-2008 06:57 PM
Generate an IP Packet with false source address? Christian Reiter Linux Networking 4 06-21-2007 06:14 PM
Packet routing by source IP andrei.stoian@gmail.com Linux Networking 3 10-12-2006 03:37 PM
When Linux PC boots, Does it sends RARP packet to get its IP address by embedding its Hardware address? santa19992000@yahoo.com Linux Networking 2 10-16-2005 10:40 PM
Changing source address of packets Drew Leske Linux Networking 0 10-02-2004 12:41 AM



1 2 3 4 5 6 7 8 9 10 11