Include MAC address on HTTP request

Asked by comeback

Hi everyone, Can I include MAC address to the request when I using the squid transparent proxy with ecap? I have squid transpanrent proxy in my network, any solution for that. Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
eCAP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alex Rousskov (rousskov) said :
#1

The eCAP itself has an API for the host application to pass meta information (e.g., MAC addresses) to the adapter transaction. It is up to the host application (e.g., Squid) to supply that information. Please direct your future Squid-specific questions to the Squid Project, but I can give you some starting pointers below:

AFAIK, Squid already uses that eCAP interface to pass client and server IP addresses, but there is insufficient Squid configuration support to pass other transaction meta information through the same interface. I recommend implementing or sponsoring a Squid feature that would allow an admin to use arbitrary logformat codes in Squid adaptation_meta values. That would allow you to pass client MAC to an eCAP adapter using the %>eui code. For example,

    adaptation_meta X-Client-MAC "%>eui"

Again, the above is not currently supported by Squid AFAIK, but there are ways to add such support: http://wiki.squid-cache.org/SquidFaq/AboutSquid#How_to_add_a_new_Squid_feature.2C_enhance.2C_of_fix_something.3F

Revision history for this message
comeback (comeback1106) said :
#2

@Alex Rousskov: Thank you alots. In the first, I think can add meta_data by using eCAP to the request from client to webserver. Meta data is MACAddress. Then on server, I will config to get this information. I just get start using eCAP and with Squid proxy, do you think my idead can work?
Thanks :D

Revision history for this message
Alex Rousskov (rousskov) said :
#3

Yes, if your HTTP client can add an HTTP request header field with MAC address info, then your eCAP adapter will see that header. eCAP adapters normally see all extension HTTP headers.

Revision history for this message
comeback (comeback1106) said :
#4

@Alex Rousskov: ECAP can do this?

Revision history for this message
Alex Rousskov (rousskov) said :
#5

If you are asking whether an eCAP adapter can add an HTTP header field to the request, then the answer is yes. Some of the sample eCAP adapters do that. To add a header field with MAC address, the eCAP adapter needs to know the MAC address. That MAC address information has to come from the host application (Squid in your case) as discussed in my original answer.

BTW, if you do not need an eCAP adapter to be involved in MAC address processing, then you may be able to add a request header with MAC address using Squid's request_header_add directive. Again, please use the Squid Project support channels for Squid-specific support.

Can you help with this problem?

Provide an answer of your own, or ask comeback for more information if necessary.

To post a message you must log in.