• Find something interesting and Exam it

Show IP Address in Linux

‘ifconfig’ or ‘ip addr show’ can show you your computer’s IP address, currently ip addr show is popular.

pi@raspberrypi:~ $ ip addr show
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:ab:3e:85 brd ff:ff:ff:ff:ff:ff
3: wlan0: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 1c:bf:ce:37:38:92 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.24/24 brd 192.168.1.255 scope global noprefixroute wlan0
valid_lft forever preferred_lft forever
inet6 2001:a453:1464:8b00:4369:a7a6:d53f:1304/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 2591764sec preferred_lft 604564sec
inet6 fe80::bdfa:5913:36cc:fd14/64 scope link
valid_lft forever preferred_lft forever

pi@raspberrypi:~ $ ifconfig
eth0: flags=4355 mtu 1500
ether b8:27:eb:ab:3e:85 txqueuelen 1000 (イーサネット)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (ローカルループバック)
RX packets 6 bytes 432 (432.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6 bytes 432 (432.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163 mtu 1500
inet 192.168.1.24 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::bdfa:5913:36cc:fd14 prefixlen 64 scopeid 0x20
inet6 2001:a453:1464:8b00:4369:a7a6:d53f:1304 prefixlen 64 scopeid 0x0
ether 1c:bf:ce:37:38:92 txqueuelen 1000 (イーサネット)
RX packets 31298 bytes 4475648 (4.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 37261 bytes 20829630 (19.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

コメントを残す