• Post Reply Bookmark Topic Watch Topic
  • New Topic

Fetcth the Router's Mac Address

 
Oren Gross
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I have heard somewhere that there might be a way to fetch the Router's MAC address from the Request/Session. Anyone knows anything about it?
 
joseph edwards
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The MAC address is part of the layer 2 (data link) layer of the tcp/ip stack. However, the java.net libraries don't really provide access to the lower layers of the tcp/ip packets. Instead, the libraries provide access to layer 3 and layer 4 of the stack, specifically the IP and TCP parameters, such as IP address and ports.

You may want to try java "raw sockets" if you need access to the lower levels of the tcp/ip stack.

Originally posted by Oren Gross:
Hi there, I have heard somewhere that there might be a way to fetch the Router's MAC address from the Request/Session. Anyone knows anything about it?
 
joseph edwards
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you know the router's IP address, you can also get the MAC address by using RARP (Reverse Address Resolution Protocol).

Take a look at the jPcap library package, which uses the raw sockets API / libpcap libs, and supports the following protocols Ethernet, IPv4, IPv6, ARP/RARP, TCP, UDP, ICMPv4
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!