ILD

ubuntu如何查看当前的ip,网关,DNS服务器信息
作者:Yuan Jianpeng 邮箱:yuanjp89@163.com
发布时间:2019-8-2 站点:Inside Linux Development

使用如下命令:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ nmcli device show eno1
GENERAL.DEVICE:                         eno1
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         74:D4:35:19:8F:9C
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Wired connection 1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/5
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.1.2/24
IP4.GATEWAY:                            192.168.1.1
IP4.ROUTE[1]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]:                             192.168.1.1
IP4.DNS[2]:                             8.8.8.8
IP6.ADDRESS[1]:                         240e:fa:c624:2500:ebaa:2364:a0fe:b833/64
IP6.ADDRESS[2]:                         fe80::6b31:7e2d:2e3d:f84f/64
IP6.GATEWAY:                            fe80::1
IP6.ROUTE[1]:                           dst = 240e:fa:c624:2500::/64, nh = ::, mt = 100
IP6.DNS[1]:                             fe80::1

参考:

https://askubuntu.com/questions/152593/command-line-to-list-dns-servers-used-by-my-system



Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.