Raspberry Pi Adventures

Join me on my fun ride

View Hostname and IP Address of Raspberry Pi

1 Comment

To View Host Name

pi@raspberrypi ~ $ hostname

Returns
raspberrypi

 

To View IP Address

pi@raspberrypi ~ $ ip addr

Returns
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether b8:27:eb:90:aa:d6 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 10:bf:48:50:4d:08 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.208/24 brd 192.168.1.255 scope global wlan0

OR

pi@raspberrypi ~ $ ifconfig

Returns
eth0 Link encap:Ethernet HWaddr b8:27:eb:90:aa:d6
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan0 Link encap:Ethernet HWaddr 10:bf:48:50:4d:08
inet addr:192.168.1.208 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1262 errors:0 dropped:3 overruns:0 frame:0
TX packets:381 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:121349 (118.5 KiB) TX bytes:54742 (53.4 KiB)

Note: I am connected to my RPi using WLAN so it also displays wlan0

 

Enjoy 🙂

Advertisements

Author: Sanket Sonavane

Sanket Sonavane Software Developer, IoT Enthusiast, Photographer, Bike Rider, Chef, AndroidUser, MacOSXNewbie & 3x3x3 Cuber ;) Loves computers, programming, web developement, micro-controllers, gadgets, automation and many more such tech innovations that defines the way we live in the modern age and likes to explore what more can be done to help the human race :)

One thought on “View Hostname and IP Address of Raspberry Pi

  1. I read this piece of writing completely about the comparison of most recent and preceding technologies, it’s awesome article.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s