0

So I set up my raspberry pi 2 with a hostapd that casts out an access point using my wlan0 interface along with dnsmasq and apache2 as my defualt browser. Now when i did this a year ago i could type the command:

arp -a

and it would show a list of the users that are on my network as such:`

*USERS NAME* 10.0.0.142 *mac adress*

along with other details. However, when i do it now, it only shows the ip address that they are on and the usual detail except for the users device name. instead of a device name i am shown "?" for all of the devices that are connected. I know my question might be a bit hard to follow but i hope someone can answer this question. Thank you.

  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Raspberry Pi Stack Exchange](http://raspberrypi.stackexchange.com/), [Internet of Things Stack Exchange](http://iot.stackexchange.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Oct 17 '17 at 05:07

1 Answers1

0

You can print only Hostname of connected devices using the command:

arp | cut -d ' ' -f 1 | sed '1d'

it's better to add it to your aliases by editing the file .bashrc:

cd ~
sudo nano .bashrc

then press Ctrl+W and type alias to look for it, then you simply can insert your alias (at the end of system aliases) with desired name:

alias clients="arp | cut -d ' ' -f 1 | sed '1d'"

NOTE: be sure to use double quotations to enclose the command, or you can precede every single quotation with backslash \' in this case there is no need for "