LoginSignup
12
15

More than 5 years have passed since last update.

LAN内で使用されているIPアドレスを調べる

Last updated at Posted at 2018-08-24

前置き

小規模ネットワーク(家庭内とか)でLinuxのコマンド実行を想定

コマンド

IPアドレスを確認
#> CentOS6 & etc
ifconfig | grep inet                                                  
#192.168.99.xxx

#> CentOS7
ip r
# もしくは
hostname -i

#default via 192.168.99.xxx


# → 第1〜3オクテットの数値がわかればOK
LAN内で使用されているIPアドレスを表示
# 適宜、第1〜3オクテット(X)の値を変更して実行
#echo XXX.XXX.X.{1..254} | xargs -P256 -n1 ping -s1 -c1 -W1 | grep ttl

echo 192.168.99.{1..254} | xargs -P256 -n1 ping -s1 -c1 -W1 | grep ttl

LAN内で使われているIPアドレスを調べる6つの方法(Linux/Windows) | 俺的備忘録 〜なんかいろいろ〜

自分のPCのIPアドレスを確認

ifconfig | grep "inet " | grep -v 127.0.0.1

# CentOS7 なら
ip r
# もしくは
hostname -i

MacでIPアドレスを確認する 4つの方法 - wikiHow

12
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
15