LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-30-2017, 10:10 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Static IP for a wireless box - Keeps changing back to another IP


Desire a static IP on a wireless Centos6 box. I set it up as such, and it sticks for a while, then I get up in the morning and it has reverted back to another IP. How can I prevent it from changing? Thanks

Code:
[Michael@devserver ~]$ ifconfig
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:42164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42164 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9035715 (8.6 MiB)  TX bytes:9035715 (8.6 MiB)

wlan0     Link encap:Ethernet  HWaddr B8:76:3F:69:31:95
          inet addr:192.168.1.140  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ba76:3fff:fe69:3195/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2569632 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1948026 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:293819716 (280.2 MiB)  TX bytes:225579123 (215.1 MiB)

[Michael@devserver ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=devserver.michaels.lan
[Michael@devserver ~]$ cat /etc/resolv.conf
search michaels.lan hsd1.wa.comcast.net
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
[Michael@devserver ~]$ cat /etc/hosts
127.0.0.1       localhost.localdomain   localhost.localdomain   localhost4      localhost4.localdomain4 localhost       devserver
::1     localhost.localdomain   localhost.localdomain   localhost6      localhost6.localdomain6 localhost       devserver
[Michael@devserver ~]$ cat /etc/sysconfig/network-scripts/ifcfg-wlan0
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
GATEWAY=192.168.1.1
DEVICE=wlan0
BOOTPROTO=none
NETMASK=255.255.255.0
#TYPE=Ethernet
TYPE=wireless
HWADDR=b8:76:3f:69:31:95
IPADDR=192.168.1.10
NM_CONTROLLED=no
ONBOOT=yes
PEERDNS=no
IPV6INIT=no
USERCTL=no
DNS2=8.8.4.4
DNS1=8.8.8.8
[Michael@devserver ~]$
 
Old 07-30-2017, 10:19 AM   #2
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,972
Blog Entries: 32

Rep: Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465
NotionCommotion,

https://unix.stackexchange.com/quest...-wifi-centos-7
 
Old 07-30-2017, 10:58 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Thanks beachboy2, but as shown in my original post, I've already done so. Note that my /etc/sysconfig/network-scripts/ifcfg-wlan0 additionally includes the following:
Code:
GATEWAY=192.168.1.1
TYPE=wireless
HWADDR=b8:76:3f:69:31:95
NM_CONTROLLED=no
PEERDNS=no
IPV6INIT=no
USERCTL=no
DNS2=8.8.4.4
DNS1=8.8.8.8
I think the issue might have nothing to do with the centos machine, but I think I forgot to setup my router with an IP range where it will accept self assigned IPs, and centos is forgoing its static ip to use a dhcp ip.. Strange though how centos will ignore its own static ip config to adapt to the routers assignment.
 
Old 07-30-2017, 11:10 AM   #4
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,972
Blog Entries: 32

Rep: Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465
NotionCommotion,

I must get my money back on that speed-reading course!
 
Old 07-30-2017, 11:25 AM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
@Beachboy2, No worries, and thanks! One of the comments reminded me about dhcp reservations. Now, 192.168.1.10 sticks! Funny though, my router shows it having two IPs now where one is 192.168.1.140. Guess that is what I get for using static ips on wireless devices!
 
Old 07-30-2017, 11:55 AM   #6
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
___

NotionCommotion:

Should the problem recur, take this note.

-----
1. NM must control the IP to peg it in one static IP value, to avoid the manager behaving like an idiot on-call it follows whatever the dhcp entices it to accept.
2. Control the IPs from the dhcp side (usually the router) login to it and bind
HWADDR=b8:76:3f:69:31:95 to IP # 192.168.1.xxx (whatever you like.)
Refresh the network script (restart)
Refresh the dhcp as well.

Hope that helps. Good luck.

m.m.

Last edited by malekmustaq; 08-01-2017 at 07:54 AM.
 
1 members found this post helpful.
Old 07-30-2017, 09:46 PM   #7
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Yes helpful, nm is network manager? How do I keep behaving like a whore?
 
Old 07-31-2017, 06:34 AM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
NotionCommotion:

malekmustag:

Per the LQ Rules, Do not post any messages that are obscene, vulgar, sexually-orientated, hateful, threatening, hostile or insulting.

While I realize there are worse words for one to post, I also fail to see any reference towards this subject.

Please stay on topic and even if self admonishing yourself, please do not bring the conversation to a level violating the LQ rule cited.

EDIT: I incorrectly noted NotionCommotion's comment failing to realize malekmustag's comment. Apologies.

Last edited by rtmistler; 07-31-2017 at 08:08 AM.
 
Old 07-31-2017, 08:03 AM   #9
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
@rtmistler, Understood. And while I fully agree LQ Rules are appropriate and I would never wish to promote any of the negative qualities which they are meant to prevent, I must say the use of the word does have reference.
 
Old 07-31-2017, 08:10 AM   #10
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by NotionCommotion View Post
@rtmistler, Understood. And while I fully agree LQ Rules are appropriate and I would never wish to promote any of the negative qualities which they are meant to prevent, I must say the use of the word does have reference.
You are quite correct, apologies.

malekmustag:

Please find more appropriate means to describe software behavior.

As you can see, another member possibly felt that this comment was personally directed versus meant to describe software.
 
Old 08-01-2017, 07:53 AM   #11
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
As you can see, another member possibly felt that this comment was personally directed versus meant to describe software.
Yes Mod. My sincere apology.

I really had that same problem once and I yelled at my NM (Network Manager) for behaving that way, it follows whatever wherever the dhcp took it. After a sober moment I realized it was my mistake for letting her be.

Again, NotionCommotion my post was about the "NM" network manager. There is no way a good english user shall mistake the subject and predicate.

Did it help? Please post freely again. Everyone here is eager to help.

Good luck.

m.m.
 
Old 08-01-2017, 02:49 PM   #12
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
I second the recommendation to use DHCP reservations for assigning specific IP addresses. It centralizes management, making it a lot simpler to make changes.

Cheers :-)
 
  


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
Can't log back in after changing runlevels from init 3 to 1 back to 3 manwichmakesameal Slackware 5 06-29-2009 11:36 AM
static ip on F10 box andy1974 Fedora 13 01-27-2009 08:03 PM
static ip keep changing. robin_2802 Linux - Newbie 4 10-26-2008 09:52 AM
From DHCP back to static addresses energiza Linux - Networking 2 08-10-2006 11:57 AM
Static IP keeps changing pruhnke Linux - Networking 2 10-16-2005 10:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:52 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