Linux Static IP address not working
#1
Hello

Trying to get an static IP address by editing /etc/network/interfaces isnt working for me. After configuration and reboot the addressing is blank so I had to remove the config to get it back on DHCP.

eth0 is not listed by default in this file for some reason, only the loopback is contemplated in the out of the box config file, is there anywhere else in the OS i should configure this?
Reply
#2
What distro are you using?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
Ubuntu
Reply
#4
I qm not sure if this is something that the ubuntu people have changed, but assuming this is still set in interfaces, could you post what you have in that file?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
Sure, the way it has been working up (couple of years) until now goes like this:

Code:
root@defuentes-Aspire-R3610:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

Notice that there is no mention whatsoever of eth0, and yet it manages to pick up DHCP.

Now, since Im sick and tired of IP change every so often I went ahead and added this:

Code:
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameservers 8.8.8.8 8.8.4.4

And it messes everything up, the interface simply wont take the config for some reason, and Linux/Kodi reports no IP configured.
Reply
#6
make sure you don't use NetworkManager. Given that a default interfaces file without any config for eth0 works for you suggests NetworkManager is running.

edit: and make sure your interfaces is really named "eth0", since thats not common on newer ubuntu versions anymore.
Reply
#7
could we please see the whole output of ifconfig:

Code:
ifconfig | nc termbin.com 9999

and get us the URL you will receive

or probably if pastebinit is installed:

Code:
ifconfig | pastebinit
Reply
#8
I use my dhcp server to set static ip addresses.

However this page https://help.ubuntu.com/lts/serverguide/...ation.html suggests what you are doing should work.

Not sure if the indenting is needed?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#9
I doubt eth0 is your network card name and you could (or i could) make a little script to update things but looks like your using network manager get rid of if you want to do it this way? Altho wouldnt be my first move.

I'm used to good old slackware so i can see why you'd want to edit files manually but just as easy setting static IP's in network manager if you dont want to possibly break something.

Happy to help but i agree with nickr that should work but network manager may be interfering with ur setup.

This is my output from DaVu's ifconfig pipe = http://termbin.com/iuyd

as you see if using network manager theres no eth0 now its enp2s0 but i like network manager because i have a couple of different configs for running through different PC's as my gateway when im doing maintenance still never got my wifi to work on this box.

FYI : Bus 002 Device 002: ID 050d:110a Belkin Components F9L1101v2 802.11abgn Wireless Adapter [Realtek RTL8192DU]

If anyone knows how to get that stuborn bugger to work; You'd think 16.10 would have a driver i've been asking for 4 years! Smile

Cheers

Derek
Reply
#10
That's why I'm asking for the ifconfig output.

Depending on the Ubuntu version (we don't know yet) it might also be possible to let the network manager manage /etc/network/interfaces by editing /etc/NetworkManager/NetworkManager.conf

and change things like

Code:
[main]                                                                                                                      
plugins=ifupdown,keyfile                                                                                                    
                                                                                                                            
[ifupdown]                                                                                                                  
managed=true

Probably that might also help, but not 100% sure about that.
Reply
#11
Sorry for not specifying it before, my version of Ubuntu is:

Code:
root@defuentes-Aspire-R3610:~# lsb_release -a
No LSB modules are available.                                                                                                        
Distributor ID: Ubuntu                                                                                                              
Description:    Ubuntu 14.04.1 LTS - KODIbuntu                                                                                      
Release:        14.04                                                                                                                
Codename:       trusty

And this is my output of ifconfig
Code:
root@defuentes-Aspire-R3610:~# ifconfig                                                                                              
eth0      Link encap:Ethernet  HWaddr 90:fb:a6:2b:c7:c6                                                                              
          inet addr:192.168.1.71  Bcast:192.168.1.255  Mask:255.255.255.0                                                            
          inet6 addr: fe80::92fb:a6ff:fe2b:c7c6/64 Scope:Link                                                                        
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                                                                        
          RX packets:1091 errors:0 dropped:0 overruns:0 frame:0                                                                      
          TX packets:849 errors:0 dropped:0 overruns:0 carrier:0                                                                    
          collisions:0 txqueuelen:1000                                                                                              
          RX bytes:852049 (852.0 KB)  TX bytes:99945 (99.9 KB)                                                                      
                                                                                                                                    
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:241 errors:0 dropped:0 overruns:0 frame:0                                                                      
          TX packets:241 errors:0 dropped:0 overruns:0 carrier:0                                                                    
          collisions:0 txqueuelen:0
          RX bytes:17489 (17.4 KB)  TX bytes:17489 (17.4 KB)

wlan0     Link encap:Ethernet  HWaddr 90:4c:e5:4e:16:7a  
          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)


Finally this is what I have configured on /etc/NetworkManager/NetworkManager.conf

Code:
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false
Reply
#12
Found the solution here:

http://www.sudo-juice.com/how-to-set-a-s...rguration/

Thanks to everyone who posted trying to help out
Reply

Logout Mark Read Team Forum Stats Members Help
Static IP address not working0