0

How to set static IP address on Ubuntu 16.04 LTS? I need connect router board which have static IP address ((192.168.15.1 address is board ip). I tried set via GUI, Network > Settings > IPv4 Settings > Method (Manual) where tried to specify Address, Netmask, Gateway: but these are not saved for some reason, if I type subnet (2nd step), it appears in place of ip address field, same for gateway. Not sure what's wrong there. For example, I want set

IP 192.168.15.3
subnet mask 255.255.255.0
gateway 192.168.15.254
minto
  • 831

1 Answers1

2

First, verify that the address and other details are valid; that is, that you haven't specified 192.168.15.xx when the network is actually 192.168.0.xx.

Second, verify that the selected address is not in the pool used in the router for DHCP addresses. You can either look in the administrative pages of the router or, if this is not feasible, by guesswork. What do other computers, phones, iPads, etc. get for addresses. For example, if devices on the network get addresses like 192.168.15.4, 192.168.15.5, 192.168.15.7, etc. then I'd suggest a static IP address of 192.168.15.100.

Set you details in Network Manager similar to this:

enter image description here

Be sure to specify DNS nameservers. Usually, the gateway address is sufficient but I would also include a fallback, such as 8.8.8.8 or 8.8.4.4.

Click Apply and restart NM from the terminal:

sudo service network-manager restart

Check:

ip addr show
ping -c3 www.ubuntu.com
chili555
  • 60,188
  • I have different Network Manager. For testing, tried set up static ip on wired connection (cable in unplugged) IP is set, but when set Netmask, settings are broken. – minto Sep 06 '19 at 11:11
  • Please check here: https://youtu.be/Hvi2cTMmTq0 – chili555 Sep 06 '19 at 11:35
  • Yes, this works. (the input should be typed exactly under title). What address can be used for Gateway? Any free address in subnet? – minto Sep 06 '19 at 17:48
  • The gateway must be the address of the router, typically xxx.1 or xxx.254. Other devices on the network connected by DHCP will show it. My iPad shows it as ‘router.’ – chili555 Sep 06 '19 at 19:26
  • No router in the network, only PC and board. x.x.x.1 is board ip, so it can't be for gateway. – minto Sep 06 '19 at 19:41
  • no, I don't need wi-fi and wan network for that. It's just local network environment. – minto Sep 06 '19 at 21:45
  • https://askubuntu.com/questions/22835/how-to-network-two-ubuntu-computers-using-ethernet-without-a-router Please try Link local only. – chili555 Sep 06 '19 at 22:05
  • @chili555 Shouldn't DNS Automatic be OFF if you want it to use the specified DNS servers? – heynnema Feb 11 '20 at 01:28
  • @heynnema Yes, indeed; it should be OFF. Good catch, thanks. – chili555 Feb 11 '20 at 02:37