1

Despite my greatest efforts I failed to set my destinated IP on my Ubuntu machine. I did the following:

This is my ifconfig result:

enp4s0    Link encap:Ethernet  HWaddr 28:d2:44:f9:03:a1  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:57143 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57143 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:5520637 (5.5 MB)  TX bytes:5520637 (5.5 MB)

wlp5s0    Link encap:Ethernet  HWaddr 80:19:34:08:26:63  
          inet addr:192.168.200.3  Bcast:192.168.200.255  Mask:255.255.255.0
          inet6 addr: fe80::adac:3e50:1835:2e22/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:120810 errors:0 dropped:0 overruns:0 frame:0
          TX packets:86941 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:65485971 (65.4 MB)  TX bytes:15414822 (15.4 MB)

On every tutorial and post I have found the device was called eth0 instead of my wlp5s0, but I switched eth0 with my wlp5s0 in tutorials.

This is my /etc/network/interfaces:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo wlp5s0
iface lo inet loopback

iface wlp5s0 inet static
address 192.168.200.32
gateway 192.168.200.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4

So my address should be "192.168.200.32" after restart, but after restarting:

sudo service network-manager restart
sudo service networking restart
sudo service resolvconf restart

there is no change in ifconfig output.


ADDITIONAL INFO, MAY BE NEEDED:

output of ip route show

default via 192.168.200.1 dev wlp5s0  proto static  metric 600 
169.254.0.0/16 dev wlp5s0  scope link  metric 1000 
192.168.200.0/24 dev wlp5s0  proto kernel  scope link  src 192.168.200.3  metric 600 

Output of ifconfig wlp5s0 | grep Mask for mask:

inet addr:192.168.200.3  Bcast:192.168.200.255  Mask:255.255.255.0

I am connecting wirelessly.


When I used network manager it worked for a while, but after a couple of hours I get:

DNS_PROBE_FINISHED_BAD_CONFIG

when trying to access any website.

Suggested sudo reslovconf -u have no effect on this problem.

After I change my DNS servers in any way I get: my error

my network manager

4
  • 2
    Is this a server or are you not using Network manager? You can set up static IP's in Network Manager
    – Jeremy31
    Jun 11, 2016 at 22:03
  • 1
    I think the interface must be getting the IP via NetworkManager, since your interface stanza on its own would not be enough to establish a wireless connection (you would need to include at least a target SSID and possibly a password or key). Since you're running NetworkManager, then you really should use that IMHO. Jun 11, 2016 at 22:07
  • switched to network manager and it works fine. Thanks for your suggestions. Jun 11, 2016 at 22:23
  • I think you should add the line auto wlp5s0 before the ifdown line as shown here: help.ubuntu.com/lts/serverguide/network-configuration.html. But this is better for servers, if you are using the gnome network manager better delete everything except # interfaces(5) file used by ifup(8) and ifdown(8) auto lo wlp5s0 iface lo inet loopback Jun 11, 2016 at 23:57

2 Answers 2

4

Use the Network Manager GUI to set up your static IP enter image description here

This is what my Network Manager settings look like using a static IP

But set your address to 192.168.200.32 and set the gateway to 192.168.200.1

8
  • I end up getting DNS_PROBE_FINISHED_BAD_CONFIG when trying to access websites after that (oddly enough I can use skype to talk with my friends). I updated main question with details. Jun 12, 2016 at 0:11
  • It might be in conflict because of the additions you made to /etc/network/interfaces
    – Jeremy31
    Jun 12, 2016 at 0:16
  • I changed it back to the state it was before. Jun 12, 2016 at 0:21
  • Your DNS would have to be 192.168.200.1 also
    – Jeremy31
    Jun 12, 2016 at 13:11
  • 1
    Bug report concerning your error
    – Jeremy31
    Jun 12, 2016 at 17:41
3

If you wish to connect wirelessly and use /etc/network/interfaces, it is necessary to declare the network and password to which you wish to connect:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo wlp5s0
iface lo inet loopback

iface wlp5s0 inet static
    address 192.168.200.32
    gateway 192.168.200.1
    netmask 255.255.255.0
    wpa-ssid <your_router>
    wpa-psk <your_wpa_key>
    dns-nameservers 8.8.8.8 8.8.4.4

Get the system to read and use the changes:

sudo ifdown wlp5s0 && sudo ifup -v wlp5s0

Did you connect?

ping -c3 192.168.200.1
ping -c3 www.google.com
2
  • by <your_router> do you mean SSID? Jun 12, 2016 at 17:37
  • 1
    Yes, exactly. For example, if your SSID shows in: sudo iwlist scan as ESSID:"nx2.4", then the correct line would be: wpa-ssid nx2.4
    – chili555
    Jun 12, 2016 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .