LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2018, 12:46 PM   #1
dmchess
Member
 
Registered: Jan 2005
Posts: 244

Rep: Reputation: 43
Trying to set static ip address


I am trying to set up a static ip address on my network. And it did kind of work, but locked out my email which is Evolution, the web worked afterwards. TTrying to set static ip addresshis is on a LinuxMint 18.3 box. I need it to be static because it will be my samba server.

# interfaces(5) file used by ifup(8) and ifdowTrying to set static ip addressn(8)
auto lo
iface lo inet loopback
auto enp6s0
#iface enp6s0 inet static
#address 192.168.0.120
#netmask 255.255.255.0
#gateway 192.168.0.1
#dns-nameservers 208.67.222.222
#dns-nameservers 208.67.220.220
#dns-search itzgeek.local

I took this file and commented out the fourth line and uncommented the lines below that. So I translatesdtranslatesid a little research. Going back to previous state my settings are:

IP Address: 192.168.0.14
Netmask: 255.255.255.0
Gateway: 192.168.0.1
DNS: 192.168.0.1

My Internet Provider is Mediacom and I think the router updates the gateway and dns server addresses to the local computer. I tried setting the dns-nameservers to 192.168.0.1, but that did not work. Any suggestions?Trying to set static ip address

Evolution is set to Defer to Desktop Settings
Trying to set static ip address
Thanks in advance, Terry
 
Old 05-08-2018, 01:56 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
My static configuration in /etc/sysconfig/network-scripts/ifcfg-enp3s0
Code:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=enp3s0
DEVICE=enp3s0
ONBOOT=yes
IPADDR=192.168.0.55
PREFIX=24
GATEWAY=192.168.0.1
DNS1=68.2.16.30
DNS2=68.6.16.30
DNS3=8.8.8.8
ZONE=public
Note the names for the variables. For example, it's IPADDR not "IP Address"
And it's VARIABLE=value, not VARIABLE: value

DNS is that of my ISP (Cox Communications)

Last edited by scasey; 05-08-2018 at 01:59 PM.
 
Old 05-08-2018, 03:41 PM   #3
dmchess
Member
 
Registered: Jan 2005
Posts: 244

Original Poster
Rep: Reputation: 43
No that did not seem to work, no IP Address even showed up. This is what I had:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
#auto enp6s0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=enp6s0
DEVICE=enp6s0
ONBOOT=yes
IPADDR=192.168.0.120
PREFIX=24
GATEWAY=192.168.0.1
DNS1= 208.67.222.222
DNS2= 208.67.220.220
DNS3=8.8.8.8
ZONE=public

Thoose two first dns addresses are what I am using on my old desktop, the one this is to replace. I believe it is OpenDNS.
 
Old 05-08-2018, 05:26 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,709

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
/etc/network/interfaces configuration file is typically used by debian and its derivatives.

/etc/sysconfig/network-scripts/ifcfg-xxxx is typically used by Red Hat,SuSE and their derivatives.

They are not interchangeable and therefore what you posted will not work for the OP. I assume that Network Manager is running which if not disabled will conflict with trying to setup a static IP address via the interfaces file. You should be able to setup a static IP address using Network Manager as well as an address reservation in your router's DHCP server.
 
1 members found this post helpful.
Old 05-08-2018, 07:41 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Noted. I'm only familiar with Red Hat and it's derivatives (I use CentOS). I apologize for confusing the OP. Yes, they should probably use Network Manager. I've always done network setup by editing the ifcfg-* files, so can't help there.

You make an excellent point about the router's dhcp setup, however. One cannot establish a static IP address if the address being used is within the router's dynamic range, which I would expect 192.168.0.14 to be, by default.
 
Old 05-08-2018, 09:04 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,326
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I need to work on my reading comprehension. . . .

Last edited by frankbell; 05-08-2018 at 09:05 PM.
 
Old 05-08-2018, 09:10 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,709

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Quote:
Trying to set static ip addresshis is on a LinuxMint 18.3 box.
Most SoHo router's that I've played with recently have x.x.x.100 as the start of the DHCP address range.
 
  


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
[SOLVED] how do i set a static ip address? oznola Linux - Networking 10 03-16-2010 04:28 PM
How to set static ip address in slackware vitalstrike82 Linux - Networking 2 05-23-2009 01:56 PM
Set IP address to static from DHCP assigned address jborn Linux - Networking 4 02-02-2007 08:38 PM
How to set a static IP address? dx0r515t Slackware 12 04-17-2005 01:33 PM
how to set a static ip address or do port forwarding? cd1680 Linux - Networking 13 03-27-2005 06:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:03 AM.

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