0

I tried setting up a static IP firstly editing and adding a connection with no luck. Then I did [this][1] Now the connection appears but the internet is not working. These are the steps I followed and my current configuration files:

jab@jab-Meerkat:~$ ifconfig -a
enp0s25   Link encap:Ethernet  HWaddr b8:ae:ed:78:3e:35  
          inet addr:192.168.1.34  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::533a:51cc:79e0:5436/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5296 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4777 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4933463 (4.9 MB)  TX bytes:669741 (669.7 KB)
          Interrupt:20 Memory:aa100000-aa120000 

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:2102 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2102 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:153808 (153.8 KB)  TX bytes:153808 (153.8 KB)

wlp2s0    Link encap:Ethernet  HWaddr 34:13:e8:40:32:b0  
          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)

jab@jab-Meerkat:~$ ip route show
default via 192.168.1.1 dev enp0s25  proto static  metric 100 
169.254.0.0/16 dev enp0s25  scope link  metric 1000 
192.168.1.0/24 dev enp0s25  proto kernel  scope link  src 192.168.1.34  metric 100 


jab@jab-Meerkat:~$ sudo nano /etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile,ofono
#dns=dnsmasq

[ifupdown]
managed=true


jab@jab-Meerkat:~$ sudo nano /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

auto lo
iface lo inet loopback

iface enp0s25 inet static
address 192.168.0.101
gateway 192.168.1.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4

jab@jab-Meerkat:~$ sudo service network-manager restart
jab@jab-Meerkat:~$ sudo service networking restart
jab@jab-Meerkat:~$ sudo service resolvconf restart

jab@jab-Meerkat:~$ ifconfig
enp0s25   Link encap:Ethernet  HWaddr b8:ae:ed:78:3e:35  
          inet addr:192.168.0.101  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::7511:ffb:7266:ce31/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:711 errors:0 dropped:0 overruns:0 frame:0
          TX packets:829 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:617772 (617.7 KB)  TX bytes:100534 (100.5 KB)
          Interrupt:20 Memory:aa100000-aa120000 

I also have rebooted the computer as after restarting the networking services and doing ifconfig the IP did not changed. Furthermore, after reboot was connected automatically to a dynamic IP, how? why? really don't know what is what I am missing. Any help will be appreciated thank you.

Jab
  • 71

1 Answers1

2

I think that your file /etc/network.interfaces is wrong.

You have set your machine's IP address as 192.168.0.101, and the gateway as 192.168.1.1.

Your netmask is 255.255.255.0, which means that the first three dotted decimals in the IP address define the network and the last one defines the machine.

This means that your gateway is on network 192.168.0. and your machine is on network 192.168.1., so in effect the gateway and your computer are on different networks.

Guessing on your network setup, I think that you should change the address line to read address 192.168.1.101

Sourav Ghosh
  • 401
  • 4
  • 13
Nick Sillito
  • 1,596
  • Thank you very much, now it is working. The problem I've got now is that when I restart the system does not connect automatically and furthermore I cannot edit the connection in order to tick the box "automatically connect to this network when is available". Also , why the connection is shown as ifupdown(enp0s25) instead of just enp0s25? Thank you! – Jab Jan 07 '17 at 11:03
  • @Jab that's because NetworkManager ignores interfaces that are defined via the /etc/network/interfaces file (they configure different services). If you want to be able to edit/manage the interface via the NetworkManager GUI, then you should revert your file changes and configure the interface via the GUI. – steeldriver Jan 07 '17 at 12:10
  • I've tried that the problem is that the GUI shows device not managed. I also tried to add the following line in /etc/network/interfaces: auto enp0s25. The problem is that for some reason my computer names the conection ifupdow(enp0s25). I also tried to remove ifupdow in /etc/NetworkManager/NetworkManager.conf so it reads plugins=keyfile,ofono instead of plugins=ifupdown,keyfile,ofono. The result is that the connection stops working. Any idea why the computer names my connection ifupdown( enp0s25)? Thanks! – Jab Jan 07 '17 at 14:35
  • If you want /etc/network/interfaces to control, then you need to change Network Manager to managed=false. Reboot and test. – chili555 Jan 07 '17 at 14:59
  • I tried earlier on and also now again and when I reboot de GUI shows "device not managed". The wired network does not show when ifconfig. Thanks! – Jab Jan 07 '17 at 15:10