With the linux arp comand you can get mac addreses from the system arp cache, something like this should work:

import os
import re

mac_regex = re.compile(ur'(?:[0-9a-fA-F]:?){12}')
tmp = os.popen("arp -a 10.15.84.20").read()
mac = re.findall(mac_regex, tmp)[0]
print mac


Greetings.


El 05/11/15 a las 11:44, Fabiano Almeida escribió:
Hi All!


Got it. If the server and client are on the same network, including the web2py it is installed on the network server. How to get the mac address by ARP?

Thanks again,

Fabiano.

2015-11-04 21:40 GMT-02:00 Dave S <snidely....@gmail.com <mailto:snidely....@gmail.com>>:


    On Wednesday, November 4, 2015 at 11:58:07 AM UTC-8, Carlos Cesar
    Caballero wrote:

        El 04/11/15 a las 14:30, Fabiano Almeida escribió:
        Hi!

        Web2py can obtain mac address from user?

    > Bassicly, the MAC address don't cross the routers, so, you can't
    get the mac address of a client from a external network server,
    > you only can get the MAC of the last router. You could do some tweak 
using ARP, but only if the client
    and server are in the same subnet.
      Web2py does give you access to the requesting IP.  This my be a
    NAT'd value if the client is on an internal network, which is
    mostly the case.

    /dps

-- Resources:
    - http://web2py.com
    - http://web2py.com/book (Documentation)
    - http://github.com/web2py/web2py (Source code)
    - https://code.google.com/p/web2py/issues/list (Report Issues)
    ---
    You received this message because you are subscribed to the Google
    Groups "web2py-users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to web2py+unsubscr...@googlegroups.com
    <mailto:web2py+unsubscr...@googlegroups.com>.
    For more options, visit https://groups.google.com/d/optout.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com <mailto:web2py+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.



--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to