Static IP doesn't take effect after reboot

Yesterday i had do a “zypper up” remoted
and then i reboot the server.
the connection lost

then i went to the data center and check on the server,
found out that the IP for eth0 and eth1 all gone.

i checked in YAST, both cards the settings still remain there
but in “ifconfig”, it shows nth…

any idea what cause this to happen ?

how do i get the static ip working again ?

lordlaw wrote:
> Yesterday i had do a “zypper up” remoted
> and then i reboot the server.
> the connection lost
>
> then i went to the data center and check on the server,
> found out that the IP for eth0 and eth1 all gone.
>
> i checked in YAST, both cards the settings still remain there
> but in “ifconfig”, it shows nth…
>
> any idea what cause this to happen ?
>
> how do i get the static ip working again ?

What OS version? What is ‘nth…’? Please post code output

OS Version 12.1
CodeName: Asparagus

#ifconfig
eth0 inet addr: 192.168.1.110 Bcast:192.168.1.255 Mask:255.255.255.0

in YAST
eth0

(x) Statically assigned IP Address

IP Address
203.226.159.244 / 28


between, just now i tried

#ifconfig eth0 203.223.159.244 netmask 255.255.255.240

it works. but when i reboot. the IP gone missing again.

looks like it cant bind the static ip.

Is the IP address written to /etc/sysconfig/network/ifcfg-eth0? (probably, since YaST does show it correctly)

Is some dhcp client running?

ps aux |egrep "(dh|dhcp)"

A shot in the dark is that you might have Network Manager configured to run instead of “Classic IFUP/IFDOWN” – That would be a setting which would change your connection type on next boot if <you’re certain> you’ve configured your static connection properly.
In fact, if you have a Desktop installed, you might search to see if any NM packages are installed… Obviously if you’re not using NM, those packages can probably be removed safely.

Or,
An alternative might be to go ahead and use Network Manager, just set up a network connection with a static address and be sure that “system startup” (or similar) is checked for your connection to be active on boot instead of on logon (which is default).

HTH,
TSU

This probably has to do with a changed scheme for naming network devices. Check whether release-notes says anything relevant.

You can probably get things working with NetworkManager, since how that works is not name-dependent.

i had tried check the /etc/sysconfig/network/ifcfg-eth0, the value in the file remain unchanged even after i use the ifconfig to change the ip value.

i run the

ps aux |egrep "(dh|dhcp)"

it give me some results, not sure what it mean


#ps aux |egrep "(dh|dhcp)"
root 2351 0.0 0.1 8288 5796 ? S 09:10 0:00 /sbin/dhclient -d -4 -sf /usr/lib/nm-dhcp-client.action -pf /var/run/dhclient-eth1.pid -lf /var/lib/dhcp/dhclient-253fcba-edc9-4b22-861e-ff6a28bfdfac-eth1.lease -cf /var/run/nm-dhclient-eth1.conf eth1
root 3096 0.0 0.0 2576 768 tty1 S+ 10:10 0:00 egrep --color=auto (dh|dhcp)

using YAST > network device > network card setup
i had checked, Activate device is “At Boot Time”

i checked also on the YAST > Support > Release note

not found anything related to network device naming.

but the release note showed version 12.3, but my OS is 12.1
and it only mention regarding to no network after installation…guess that one is not related to my problem…

On 2013-12-04 20:36, nrickert wrote:
>
> lordlaw;2605133 Wrote:
>> any idea what cause this to happen ?
>
> This probably has to do with a changed scheme for naming network
> devices. Check whether release-notes says anything relevant.

He did not say he is using 13.1.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

On 2013-12-05 03:26, lordlaw wrote:

> it give me some results, not sure what it mean
>
>
> Code:
> --------------------
>
> #ps aux |egrep “(dh|dhcp)”
> root 2351 0.0 0.1 8288 5796 ? S 09:10 0:00 /sbin/dhclient -d -4 -sf /usr/lib/nm-dhcp-client.action -pf /var/run/dhclient-eth1.pid -lf /var/lib/dhcp/dhclient-253fcba-edc9-4b22-861e-ff6a28bfdfac-eth1.lease -cf /var/run/nm-dhclient-eth1.conf eth1
> root 3096 0.0 0.0 2576 768 tty1 S+ 10:10 0:00 egrep --color=auto (dh|dhcp)
>
> --------------------
>

Well, you do have a dhcp client running, which should be there. That’s
your problem, find out why.

Probably started by network manager (see the filename).


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

I just now tried to find anything related to Network Manager,
but seem like that network manager not working in my server.

so you mean i should disable the network manager ?

sorry, i am very new to linux and i am just a merely programmer who know nth bout OS.
now trying to learn…

On 12/4/2013 10:26 PM, lordlaw wrote:
>
> robin_listas;2605358 Wrote:
>> On 2013-12-05 03:26, lordlaw wrote:
>> Well, you do have a dhcp client running, which should be there. That’s
>> your problem, find out why.
>>
>> Probably started by network manager (see the filename).
>>
>
> I just now tried to find anything related to Network Manager,
> but seem like that network manager not working in my server.
>
> so you mean i should disable the network manager ?
>
> sorry, i am very new to linux and i am just a merely programmer who know
> nth bout OS.
> now trying to learn…
>
>
lordlaw;

openSUSE gets its network configuration from the files in /etc/sysconfig/network. To change these the best way is
through YaST2. YaST is also available in text mode if you do not have a GUI installed. Just enter:


yast

Go to YaST2 > Network Devices > Network Settings. In the “Global Options” tab, choose “Traditional Method with ifup”.
In the “Overview Tab” choose your interface card and “Edit”; In the “General” tab choose “Activate Device” at “At Boot
time” and choose “External Zone” for the firewall; In the “Address Tab” check “Statically assigned IP Address”, fill in
IP, Mask; choose “Next” to accept these changes. In the “Hostname/DNS” tab, fill in your “Hostname”, Domain, Name
Servers and “Domain Search”. In the “Routing Tab” fill in your gateway IP. Finally click “OK”. There are other
settings available but unless you know better leave them at the default values.


P.V.
“We’re all in this together, I’m pulling for you” Red Green

Thanks for your feedback.
but i had done all those settings … and repeating check them multiple times.
still no luck ~~ :frowning:

So somehow NetworkManager is starting and in turn runs the dhcp client, which in turn changes your IP address.
If you want to use NM you would have to configure the static IP address in NM’s config, not YaST. But I think ifup would be better suited for your scenario.

Are you using sysvinit or systemd?

Have you switched to “Traditional method with ifup” in YaST now?

12.1 is a bit old, so I don’t remember all the details anymore…

But 12.1 still used the “NETWORKMANAGER” variable in /etc/sysconfig/network/config, verify that this is set to “no”.

Is there any NetworkManager service in YaST->System->Runlevels? If so, disable it.

As a last resort, you could try to uninstall NetworkManager completely.

Thanks for the feedback

my network setting in YAST is using “Traditional method with ifup”
“NETWORKMANAGER” variable value is “no” in /etc/sysconfig/network/config
There is not network manager service running…

any command i can use to check if the network service is running ?

i use nmcli and it return some results for me

Another indication that NetworkManager is running… :wink:

Well, as I said, I don’t remember all the details of NetworkManager’s setup on 12.1.
And you didn’t tell whether you use sysvinit or systemd.

What does “systemctl status NetworkManager.service” say?
Or, if using sysvinit, try “chkconfig networkmanager” or “chkconfig NetworkManager”.

And again, if you uninstall NetworkManager, it shouldn’t be able to run anymore and your problem should be solved… :wink:

Btw, you stated in your first post that this started after installing updates with “zypper up”. Which updates have that been? 12.1 doesn’t get any official updates anymore since more than 6 months.

am not sure if using sysvinit or systems, any different ?

“chkconfig networkmanager” or “chkconfig NetworkManager” both return “unknown service”

but systemctl status NetworkManager.service returned


NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled)
Active: active running since .....
Main PID: 755 (NetworkManager)
CGroup: name=systemd:/system/NetworkManager.service
             - 755 /usr/sbin/NetworkManager --no-daemon
             - 4199 ......etc....


so that indicate the service manager is running...how to disable it ?
and it won't be restart when reboot........

Of course they are different. Sysvinit is the old init system, systemd is a completely new one (but does support old-style init scripts as well).
On 12.1 you could even choose which one to use at the boot menu.

If you can call “systemctl”, you are using systemd obviously.

but systemctl status NetworkManager.service returned

NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled)
Active: active running since …
Main PID: 755 (NetworkManager)
CGroup: name=systemd:/system/NetworkManager.service
- 755 /usr/sbin/NetworkManager --no-daemon
- 4199 …etc…

so that indicate the service manager is running…how to disable it ?
and it won’t be restart when reboot…

So it is running as expected, and “enabled” means that it is to be started on boot.
You can disable it with “systemctl disable NetworkManager.service”.
But, IIRC on 12.1 the service itself was started in any case. It contained a check for the NETWORKMANAGER variable I mentioned before, and only actually started NetworkManager if that was set to “yes”.

That check and the variable got removed for 12.3 (it was an openSUSE specific patch), so maybe your “zypper up” installed a NetworkManager package intended for a newer openSUSE version?
So please post the output of:

rpm -qi NetworkManager

and

zypper lr -d

On 2013-12-05 09:56, wolfi323 wrote:
> Btw, you stated in your first post that this started after installing
> updates with “zypper up”. Which updates have that been? 12.1 doesn’t get
> any official updates anymore since more than 6 months.

Huh, right!

lordlaw, please post the result of:


zypper lr --details

Please paste it complete, from initial prompt to final prompt, using
code tags (the ‘#’ button).
Posting in
Code Tags - A Guide


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Here is the output of the commands

sorry you have to view from image file

https://www.dropbox.com/sc/036gqwrtynupiwo/ukCz4lFHva

Well, as suspected, you have installed the NetworkManager package for openSUSE 12.3, so NetworkManager gets started unconditionally if NetworkManager.service is enabled.

And your repo list is calling for trouble.
You have added the 12.3 update repo (it’s disabled now, but you surely had enabled it, right?), so your system is a mixture of 12.1 and 12.3 now. Why did you do that?
Then you have some other repos for 12.2 and 11.4 as well.

Since 12.1 is out of support for over 6 months already, I think the best would be to upgrade to 12.2 or 12.3.
Disable/remove all repos and only add the standard ones for the selected version, then run “zypper dup”.
See also SDB:System upgrade - openSUSE.

Disabling NetworkManager or switching back to the 12.1 version would help with this specific problem, but considering the possible state of your system you WILL run into other problems as well most likely.
You could of course enable the 12.1-update repo again (and of course remove the 12.3 update repo) and run “zypper dup” to get back to 12.1, but as already mentioned that was end-of-life over half a year ago.

Since you likely do have a lot of 12.3 stuff installed already, I would think completely upgrading to 12.3 would be the best thing to do.