리눅스 IP 확인

리눅스 IP 확인

1 방법1: ip ★[ | ]

[root@zetawiki ~]# ip addr | grep "inet "
    inet 127.0.0.1/8 scope host lo
    inet 192.168.0.39/24 brd 192.168.0.255 scope global eth1
[root@zetawiki ~]# ip addr | grep "inet " | grep brd | awk '{print $2}' | awk -F/ '{print $1}'
192.168.0.39

2 방법2: ifconfig[ | ]

[root@zetawiki ~]# ifconfig | egrep "(^\\w|inet )"
eth1      Link encap:Ethernet  HWaddr 00:0C:29:A2:8E:A8  
          inet addr:192.168.0.39  Bcast:192.168.0.255  Mask:255.255.255.0
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
[root@zetawiki ~]# ifconfig | grep "inet "
          inet addr:192.168.0.39  Bcast:192.168.0.255  Mask:255.255.255.0
          inet addr:127.0.0.1  Mask:255.0.0.0
[root@zetawiki ~]# ifconfig -a | grep "inet " | grep "Bcast:" | awk '{print $2}' | awk -F: '{print $2}'
192.168.0.39

3 방법3: hostname[ | ]

[root@centos7 ~]# hostname -I
192.168.0.39 127.0.0.1
[root@centos7 ~]# hostname -I
172.28.128.11 172.17.0.1
root@debian9:~$ hostname -I
172.18.0.1 172.17.0.2

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}