Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some machines running on the same network. One node is the control node which distributes traffic coming to it to the other nodes. The thing is that I want to have a custom protocol header between MAC header and IP(or whatever) payload incoming to the control node.

Control node receives this any packet like this:

| Layer 2 | IP(or whatever protocol) | Payload |

This packet should be distributed like this to other nodes

| Layer 2 | Custom Header | IP(or whatever protocol) | Payload |

I want some directions to do such a thing, Is there any current solution which I can use and I have to hack kernel for it from the scratch. A similar approach is to use L2TP but that runs over IP layer so I dont want that.

I also want this communication to be appeared as a seperate interface in linux like tun0 apart from physical eth0 interface.

Any help or ideas would be highly appreciated.

I dont know in what stack-exchange website this question belongs to so directions to correct website are also appreciated.

share|improve this question
I do not know why you need this, but did you have a look at VLANs which allows to separate traffic on the same LAN? Additionally, you get separated interfaces. – jofel Dec 7 '12 at 13:18
Check if MPLS help you: en.wikipedia.org/wiki/Multiprotocol_Label_Switching – jippie Dec 8 '12 at 9:26

There is no layer "2.5". That would violate the whole OSI model, so I'm going to say there is unlikely to be such a thing as no one would have a purpose for it, or want to adapt some purpose to make use of it. It would also involve a lot of kernel hacking, and that modified kernel would have to be used by every device accessing the network downstream from the control node.

The purpose of layer 3, the network layer, is addressing/routing. There is no data appropriate for insertion between layer 2 and layer 3, since data other than hardware (layer 2) and software (layer 3) addresses is part of the payload.

You could replace layer 3 IP stuff with some software routing protocol of your own, transforming incoming packets, but it is hard to see what the point of that would be.

Of course, if you explain more specifically what you want to accomplish, someone might have a suggestion.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.