Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
50
rated 0 times [  50] [ 0]  / answers: 1 / hits: 304487  / 3 Years ago, thu, october 7, 2021, 12:54:39

I'm trying to make my IP address static as I hear it fixes slow browsing issues.



When I click on connection information under the networking menu of the gray taskbar, it tells me about the IP address, subnet mask, and DNS, but nothing about the gateway.



I would like to know if there's a terminal command to find the information.


More From » networking

 Answers
6

I have this command as an alias for "ipconfig" (up to 14.04):



nmcli dev list iface eth0 | grep IP4


An example listing is:



IP4-SETTINGS.ADDRESS:                   192.168.1.110
IP4-SETTINGS.PREFIX: 24 (255.255.255.0)
IP4-SETTINGS.GATEWAY: 192.168.1.1
IP4-DNS1.DNS: 208.67.222.222
IP4-DNS2.DNS: 208.67.220.220


If eth0 doesn't work, you may need to use eth1, eth2, ... depending on your configuration.



EDIT: 2/8/16



Note that this only works in versions before v15.04 (or possibly before v14.10; I have v14.04). For newer versions, you can use this:



 nmcli dev show eth0

[#35091] Saturday, October 9, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ersoggles

Total Points: 69
Total Questions: 111
Total Answers: 111

Location: Vanuatu
Member since Sun, Oct 2, 2022
2 Years ago
;