LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-17-2016, 02:40 AM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Cool Can't seem to set a static IP on netbook


Hello all,

I have a Gateway LT31 Netbook which I use as mumble server for friends and I. I want to set it's IP to static and I can't seem to figure out what I'm doing wrong.

Here is what I've tried putting in to no avail:

Code:
iface enp3s0 inet static
address 192.168.0.254
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8
A lot of the guides I'm reading seem to also mention broadcast and network as well and I have tried putting those values into the configuration as well with still no luck.

So what happens is that when I save this file and restart networking

Code:
sudo service networking restart
And then do an ifconfig: I just get the following like enp3s0 doesn't even exist anymore. I can set it back to DHCP and then it works just fine again. Not sure what to do.

Code:
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:7400 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7400 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:555800 (555.8 KB)  TX bytes:555800 (555.8 KB)
 
Old 08-17-2016, 03:03 AM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Rep: Reputation: 108Reputation: 108
Hya,

Just a guess, but what happens if
Code:
sudo ifup -verbose enp3s0
and check messages.

cheers
 
1 members found this post helpful.
Old 08-17-2016, 09:38 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
If network manager is running then it is controlling the interface. If running a desktop you can use the network manager applet to configure a static IP. There is also a command line tool nmcli if not running a desktop. You can shutdown network manager and configure the IP manually as above.

However, if you take your netbook outside your LAN you might want to consider adding an address reservation in your router (most do) or DHCP server. Basically you have a static IP using DHCP.
 
1 members found this post helpful.
Old 08-17-2016, 10:26 AM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You may need to add auto enp3s0 on top of your configuration.
 
1 members found this post helpful.
Old 08-17-2016, 05:30 PM   #5
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by kaz2100 View Post
Hya,

Just a guess, but what happens if
Code:
sudo ifup -verbose enp3s0
and check messages.

cheers
It appears to say something about rtnetlink answers: file exists.

I do a search on that, and I don't understand any of the terminology and there appears to be a variety of ways to fix it, and some additional steps may be required. this appears to be a problem with two nics, yet my netbook only has one unless the wlan counts as a nic as well. Furthermore, I'm confused as when this was on 14.04 it worked just fine. There is also mention of ethX, and I have enp3s0. Does that make a difference? Why is not just a standard eth?

Should I just try all of the solutions until one works?
 
Old 08-17-2016, 05:32 PM   #6
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by michaelk View Post
If network manager is running then it is controlling the interface. If running a desktop you can use the network manager applet to configure a static IP. There is also a command line tool nmcli if not running a desktop. You can shutdown network manager and configure the IP manually as above.

However, if you take your netbook outside your LAN you might want to consider adding an address reservation in your router (most do) or DHCP server. Basically you have a static IP using DHCP.
This netbook will live out it's life being a samba server, mumble server and possible a small game server for my friends and I. No need to take it away from the home. It has no GUI on it either, but I will try out that command line tool you mention. Thank you.
 
Old 08-17-2016, 05:32 PM   #7
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by Emerson View Post
You may need to add auto enp3s0 on top of your configuration.
It was actually already in my config file, I just didn't post it, silly me. I'm writing the contents out manually as I lose ssh access to it once I change from dhcp to static and then can no longer retrieve the contents.
 
Old 08-18-2016, 05:55 AM   #8
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,833

Rep: Reputation: 108Reputation: 108
As we are unable to see error messages, we can only guess.

I am not sure if this tread helps.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to setup static Ip on Netbook riyadabc Linux - Networking 2 05-23-2013 05:39 AM
[SOLVED] Set Static IP Quinlan Linux - Newbie 9 09-18-2010 04:18 AM
how do i set a static ip? ninja master Slackware 9 11-20-2008 08:15 PM
How to set Static IP? maverick_29 Linux - Networking 4 05-25-2007 01:07 AM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration