How find ruby on rails app client mac address?

1,003 views
Skip to first unread message

Yasin PEHLİVANLI

unread,
Jan 5, 2015, 12:21:02 PM1/5/15
to rubyonra...@googlegroups.com
Hi;
How to get client login mac address? (ruby on rails)

i am sorry bad english :)

Jason Fleetwood-Boldt

unread,
Jan 5, 2015, 2:19:30 PM1/5/15
to rubyonra...@googlegroups.com

I don’t believe the MAC address is passed in a TCP/IP request, this is used by the networking (switches & routers) layer only.

Passing MAC addresses around the internet seems like it could lead to people spoofing other people’s machines easily, so that’s probably why it isn’t done.

Generally in a web app you record the user’s browser using a cookie (which is tied to a session) and you record the user’s IP address. I’ve never heard of anyone recording a MAC address.

-Jason


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1034b6d2-e1c8-4e0b-90b8-5c16936e9863%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robby O'Connor

unread,
Jan 5, 2015, 2:22:51 PM1/5/15
to rubyonra...@googlegroups.com

This sounds like someone doesn't truely understand how networking works...

--Rob
Sent from my cell, please excuse any typos.

Jason Fleetwood-Boldt

unread,
Jan 5, 2015, 2:29:53 PM1/5/15
to rubyonra...@googlegroups.com
Me or the original poster?

If MAC Addresses are passed in the http cycle that is certainly news to me since I’ve never heard of that. Obviously switches and hubs use Mac addresses at the TCP/IP layer, but remember that the TCP/IP layer is a separate layer from the http cycle layer. 

-Jason


Robby O'Connor

unread,
Jan 5, 2015, 2:31:15 PM1/5/15
to rubyonra...@googlegroups.com

you understand it fine...Original poster.

--Rob
Sent from my cell, please excuse any typos.

Robby O'Connor

unread,
Jan 5, 2015, 2:31:59 PM1/5/15
to rubyonra...@googlegroups.com

I meant the original poster did not understand it...which is quite worrisome.

--Rob
Sent from my cell, please excuse any typos.

Dave Aronson

unread,
Jan 5, 2015, 2:38:25 PM1/5/15
to rubyonrails-talk
On Mon, Jan 5, 2015 at 2:22 PM, Robby O'Connor <robby....@gmail.com> wrote:

> This sounds like someone doesn't truely understand how networking works...

True, but these days, many (most?) developers don't. So, I'm tempted
to just cut him some slack, and point him in the direction of some
learning.

Yasin, the "standard model" of networking in general can be found at:

http://en.wikipedia.org/wiki/OSI_model

The "real" Internet stack is a little bit different, and can be found at:

http://www.w3.org/People/Frystyk/thesis/TcpIp.html

(though this omits the bottom layers found in OSI). You can find a
more general description of protocol stacks at:

http://en.wikipedia.org/wiki/Protocol_stack

One important thing to remember is that in a layered architecture
(such as this), each layer should generally be as ignorant as possible
of what's going on at the lower layers. So, I would very much doubt
that a MAC address would be found in an HTTP request, unless some
specially modified application were adding it in a custom header or
some such.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

Scott Ribe

unread,
Jan 6, 2015, 9:41:21 AM1/6/15
to rubyonra...@googlegroups.com
On Jan 5, 2015, at 12:18 PM, Jason Fleetwood-Boldt <te...@datatravels.com> wrote:
>
> Generally in a web app you record the user’s browser using a cookie (which is tied to a session) and you record the user’s IP address.

You can't even get the user's machine's IP address unless the user is on a LAN with your server. You'll only get a gateway address.

--
Scott Ribe
scott...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




Reply all
Reply to author
Forward
0 new messages