Getting the MAC address of local computer

Hello developers! Can you to tell me how I can to get a MAC address of local computer in Java, JDK 1.4.0????
Thank you!

Hi,
There isn't a particular method you can call. However check out this thread.
http://forum.java.sun.com/thread.jsp?forum=4&thread=239391
This has sample code to get the MAC address on Windows.
Regards,
Roopasri Vittal
Developer Technical Support
Sun Microsystems
http://sun.com/developers/support

Similar Messages

  • How to get the MAC address of  other hosts in local net

    1. Is there any kerner or user function to get the MAC address of other hosts in local net?
    2. ire_route_lookup() can only lookup MAC in routing table(arp -a),Is there any way to enable it to find out all MAC of hosts in the local net?
    Best Regards
    Hann

    ChristianEC wrote:
    Hi,
    I am looking for a way to get the MAC address of a PXI RT controller. I know that there is a VI to do this, but I am looking for a solution for a dll (C-Code).
    I use the "Call library node" to call this dll and want to make sure that it is only used on a specific PXI.
    Since the VI provides the functionality, I am wondering if it is also available to be called from C-Code?
    Thank you,
    Christian
    If it is available in LabVIEW it is probably available in CVI, which you could then build into a DLL (if there isn't one available already).
    CLA, LabVIEW Versions 2010-2013

  • How can I get the MAC address of my Apple TV?

    How can I get the MAC address of my Apple TV? I currently do not have an HDMI device to connect it to, and the MAC is not listed on the box or the Apple TV itself.
    (to answer the obvious, I am trying to pair it with an iPad, and I need to register the Apple TV for the network so the two can see each other)

    As long as I know java doesn't have support to work on link-layer, only internet and transport layers. You may write simple native code. On windows, IP Helper functions, like SendARP allow you to pass an IP address and get the hardware address. You store the hardware address on your database/file and later, when that machine is off, you send a frame to the address you stored previous.
    [http://msdn.microsoft.com/en-us/library/aa366071(VS.85).aspx]
    I haven't seen it on Linux, but if you need help let me know I'll check the Linux API's too.

  • How to get the MAC address of the additional 10G NIC with ILO command line

    how to get the MAC address of the additional 10G NIC with ILO command line?
    thanks.
    This question was solved.
    View Solution.

    Hi Bruce,
    Out from what I can find on this network card is it not possible to get the mac address without a OS. I would recommend you to get/burn a Linux/Ubuntu live CD/DVD and run a Ifconfig in there.
    Hope it helps you.
    Best regards
    Zincas
    I work on behalf of HP

  • Can I get the Mac address in Audit logs of Active directory server for the user's machine which connect to the network/Domain

    Hello All,
    I am trying to get the information of all the user's who connect to our Domain network by signing in using the domain account. For this I am using the Windows audit group policies ( I am not sure of there is any other way). I can see when the user tries
    to login to the network there is a audit event created on the AD/DC server. I can see the Kerberos authentication and logon/logoff events in the audit events under event viewer.  
              However the info which is being populated in these events include :- Hostname, IP address, Username and so on... But I can't see the MAC address of the user machine/system. Is there any way I can
    get the Mac address of the endpoint system as its one of the important criteria for our project.
    Any inputs on this would be appreciated, incase if there is any other way other than group policies please suggest.
    Thanks,
    Kavish

    > include :- Hostname, IP address, Username and so on... But I can't see
    > the MAC address of the user machine/system. Is there any way I can get
    > the Mac address of the endpoint system as its one of the important
    > criteria for our project.
    If you use DHCP, you can query the DHCP server. There's no builtin
    method to get the MAC address directly.
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • How to get the MAC address of a PXI in a dll

    Hi,
    I am looking for a way to get the MAC address of a PXI RT controller. I know that there is a VI to do this, but I am looking for a solution for a dll (C-Code).
    I use the "Call library node" to call this dll and want to make sure that it is only used on a specific PXI.
    Since the VI provides the functionality, I am wondering if it is also available to be called from C-Code?
    Thank you,
    Christian
    Solved!
    Go to Solution.

    ChristianEC wrote:
    Hi,
    I am looking for a way to get the MAC address of a PXI RT controller. I know that there is a VI to do this, but I am looking for a solution for a dll (C-Code).
    I use the "Call library node" to call this dll and want to make sure that it is only used on a specific PXI.
    Since the VI provides the functionality, I am wondering if it is also available to be called from C-Code?
    Thank you,
    Christian
    If it is available in LabVIEW it is probably available in CVI, which you could then build into a DLL (if there isn't one available already).
    CLA, LabVIEW Versions 2010-2013

  • Is there any possible ways to get the MAC address?

    Hi guys:
    I am writing servlets on the server side. Is there any possible ways to get the MAC address when a HTTP request come in? Thank you very much for any helps.
    all the best!

    It is usually impossible to get the MAC address of the maker of a HTTP request in any programming language or system.
    At best, you can get the MAC of the closest intervening router, firewall, whatever.
    Are you sure you mean the MAC address? MAC looks like this: 8:ab:f0:0:71:bb:90 (Ethernet), or 01-23-45-67-89-ab (Token Ring), etc, depending on your network type.
    In contrast, an IP address looks like this: 209.249.116.195. If you want the IP address, check out the javadoc for HttpServletRequest and ServletRequest. Caveat: load balancers, web caches, proxy servers, etc will mask the "true" peer's address. Don't do anything silly like try to use the IP address for security or authentication.

  • How do I get the MAC address from my iPad?Thanksss.

    How do I get the MAC address from my iPad?Thanksss.

    Settings -> General -> About -> Wi-Fi Address
    Regards.

  • Getting the MAC address of the iPhone

    Hi,
    In order for an iPhone (or any other network device) to access or wi-fi network, it needs to be registered. I would like to make it so that they don't have to register it every time and to do that, I need the MAC address of the device. Users will be registering via a webpage using the browser on the phone. Is there any way in the midst of that process that I can query the iPhone for it's Mac address?
    Thanks,
    Rob Tanner
    Linfield College

    You can get the MAC address for your iPhone at Settings > General > About > Wi-Fi address.
    There is not a way to query the iPhone for the MAC address to be entered automatically in the space provided when registering the iPhone's MAC address via the webpage, but it can be written down in advance for manual entry of the address.

  • Trying to setup wifi, how do I get the mac address from ipod touch 5th gen?

    trying to setup wifi, how do I get the mac address from ipod touch 5th gen?  cannot get to the setting screen as it is trying to connect to itunes.

    If yo are setting up the iPod vai wifi you have to connect to a network that does not use MAC address filtering.
    After it is set up yu can get the MAC from Settings>General>About>WiFi Address

  • Getting the MAC address of the machine

    Is there any method to get the MAC address of machine in java.?????????????
    In our proxy server application we get the IP address of each client connected our proxy server.
    But as the IP addresses are dynamic , we can't trace the location of the machine whenever any client does malicious downloads.

    Thanks It works .
    The code is as follows .
    It works when the machine is connected to internet while throws a null pointer exception when not connected .
    import java.net.InetAddress;
    import java.net.NetworkInterface;
    import java.net.SocketException;
    import java.net.UnknownHostException;
    public class MacAddress {
    public static void main(String[] args) throws SocketException, UnknownHostException {
    try {          
    InetAddress address = InetAddress.getLocalHost();
    * Get NetworkInterface for the current host and then read the
    * hardware address.
    NetworkInterface ni = NetworkInterface.getByInetAddress(address);
    byte[] mac = ni.getHardwareAddress();
    * Extract each array of mac address and convert it to hexa with the
    * following format 08-00-27-DC-4A-9E.
    for (int i = 0; i < mac.length; i++) {
    System.out.format("%02X%s", mac, (i < mac.length - 1) ? "-" : "");
    // System.out.print(mac);
    } catch (UnknownHostException e) {
    e.printStackTrace();     
    } catch (SocketException e) {
    e.printStackTrace();

  • How can I get the MAC address

    My machine has two NIC's. I need to add another network interface, however when I do so it gets assigned to the same MAC address as the interface in use. Why is that and how can I determine the MAC address of the other card to be able to assign it to the new interface?
    thanks

    If necessary, change the value of local-mac-address? as follows:
    eeprom local-mac-address?=true
    When you reboot the system, the interfaces with factory-installed MAC addresses now use these factory settings, rather than the system-wide MAC address. Interfaces without factory-set MAC addresses continue to use the system-wide MAC address.
    [http://docs.sun.com/app/docs/doc/816-4554/eyprp?a=view]

  • How to get Mac Address of Remote Computer

    Hi All,
    I tried to find out a solution for finding Mac Address of a remote system, then first i tried with finding it with local address using the following code it works fine for me.
    public class MacAddressFinder {
         public static void main(String[] args) {
              try
                   InetAddress ipAddr = InetAddress.getLocalHost();
                   System.out.println("Current IP address : " + ipAddr.getHostAddress());
                   NetworkInterface nwIntf;
                   try
                        nwIntf = NetworkInterface.getByInetAddress(ipAddr);
                        byte[] hwAddr = nwIntf.getHardwareAddress();
                        System.out.print("Current MAC address : ");
                        StringBuilder sb = new StringBuilder();
                        for (int i = 0; i < hwAddr.length; i++)
                             sb.append(String.format("%02X%s", hwAddr, (i < hwAddr.length - 1) ? "-" : ""));          
                        System.out.println(sb);
                   } catch (SocketException e) {
                        e.printStackTrace();
              catch (UnknownHostException e) {
                   e.printStackTrace();
    But when i tried this piece of code in jsp with the following code i am getting NeworkInterface object value as null and there by i am unable to get the Mac Address of a remote computer.
    InetAddress ipAddr = InetAddress.getByName(request.getRemoteAddr());
    NetworkInterface nwIntf = NetworkInterface.getByInetAddress(ipAddr);Can you please suggest me how to find out the Mac address of remote system?
    Thanks,
    Uday

    first of all, NetworkInterface only exposes the NetworkInterfaces of the local computer. secondly, you cannot find the mac address of an arbitrary remote computer. that information is not available outside of the local subnet. and java doesn't expose a way to discover it even for computers on the local subnet.

  • Getting the IP address of the local machine.

    Hello All,
    We are deploying an application using 10g AS(LINUX).We have to capture the IP address of the
    user machine, in which the browser is running.(10g forms,9i db)
    WEB_UTIL is not configured and we are using java importer for the purpose.
    I am a 'very' newbie in java.I searched a lot in the net and got some solutions but all providing the Ip address of the AS machine.
    Can anyone give a java program to get the IP address of the local machine?Or a link...
    Thanks in advance
    Jeneesh

    Give a glance to these documents. may be coukd help you
    http://forum.java.sun.com/thread.jspa?threadID=245711
    Java 6.0 includes an API to get the MAC address of any attached network interface:
    http://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getHardwareAddress
    (idea for IP user: you can shell out, and use the 'who -m'?)
    Regards Jeneesh

  • How to get a mac address in any OS

    Hi all
    is there a way in java to get the mac address of machines on a local network (similar to the way arp -a on windows returns ip's but also their physical mac address) but working on any os so the java ap can run on windows, linux, osx for example.
    basically i want to be able to enter an ip range and have a method return each mac address for each ip address in the range (for ip addresses that exist)

    thanks for the link
    is this basically the only way to do this then? by querying local system methods of getting mac address info?
    there is no built in java way of doing it?
    still very useful link :)

Maybe you are looking for

  • The difference between A and B?

    Hello, I've got a question. I'm about to buy an iPod. Not sure if it's gonna be a Touch or Classic. But what is the difference between the MA627ZD/A and MA627ZD/B? Both are 16 GB, so I don't get what could be the difference... Is B the one with the l

  • Add button to QA33 ALV output list

    Hi, SAP experts: I need to add a custom button to the ALV output list display in QA33 transaction. I´ve only found the BAdi ALV_SWITCH_GRID_LIST, but it doesn´t fit my requirements at all. Any idea? Thank you very much!

  • Unable  to change NETPR while PO creation using BAPI_PO_CREATE1

    Hi Experts, Can someone tell me what are the parameters that are to be passed to the BAPI_PO_CREATE1 to update NETPR field at item level. I am trying to update the 'PBXX' cond type but failed. Following is sample piece of code of my code for items.  

  • I don't see the BLStart and BLFinish Dates

    Hello I have project A and the time to assign as a project baseline B newly imported, I can't see the BLFinish and BLStart dates. Project B has a start and end dates, but when he is assigned as the project BaseLine A, no dates are displayed. See the

  • Table of Contents Pod in Robohelp 8

    I am running Robohelp 8 and could be crazy but when I look under View --> Pods, I don't see the TOC pod.  Am I missing something here?