COMMAND LINE KUNG FU

Lệnh hiển thị địa chỉ ip trên Linux

631
author Huỳnh Đình Hiếu - 2022-07-21 11:07:29 (GMT+7)

Để hiển thị thông tin địa ip trên Linux chúng ta dùng lệnh sau:

bash (non-root)
ip addr

Hoặc

bash (non-root)
ifconfig
Kết quả
1: lo: <LOOPBACK,UP,LOWER_UP> 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: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether fa:16:3e:85:0e:80 brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet xxx.xxx.xxx.xx/24 metric 100 brd xxx.xxx.xxx.xxx scope global dynamic ens3
       valid_lft 60484sec preferred_lft 60484sec
    inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 2591793sec preferred_lft 604593sec
    inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever
3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether fa:16:3e:c6:52:d3 brd ff:ff:ff:ff:ff:ff
    altname enp0s4
    inet xxx.xxx.xxx.xxx/16 metric 100 brd xxx.xxx.xxx.xxx scope global dynamic ens4
       valid_lft 60484sec preferred_lft 60484sec
    inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever
4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:ce:bb:f2:63 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:ceff:febb:f263/64 scope link
       valid_lft forever preferred_lft forever
6: veth3f76c37@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether 9e:13:5c:53:cc:06 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::9c13:5cff:fe53:cc06/64 scope link
       valid_lft forever preferred_lft forever


Bạn có làm được theo hướng dẫn này không?

Lệnh liên quan

Object Storage

Chuẩn S3, không giới hạn băng thông

Object Storage
Thông tin tác giả
Bình luận

Tính năng đang được phát triển

Đang tải bình luận