# Static IP resets on boot [Solved]

## kenny_w

Hi everybody, new user to Gentoo here. I just installed Gentoo & networkmanager +nm-applet & set a static IP in the GUI settings but for some reason every time I boot up its stuck at a different IP address... 

How do I solve this? Do I have to disable some other non-gui networking program that is setting the IP address upon boot-up?Last edited by kenny_w on Tue Dec 12, 2017 9:51 pm; edited 1 time in total

----------

## lwlvl

Hey Kenny,

on what type of IP does it "get stuck"?

169.x.x.x or 192.168.x.x?

169.x.x.x means, that there was neither a static configuration nor an successful DHCP-config.

192.168.x.x means, the interface was configured by DHCP (I would leave it this way and simply give the computer a fixed address in the DHCP-Server/Router)

Regards,

Jan

----------

## kenny_w

 *lwlvl wrote:*   

> Hey Kenny,
> 
> on what type of IP does it "get stuck"?
> 
> 169.x.x.x or 192.168.x.x?
> ...

 

its 192.168.1.100, I set it to 28 but when I boot its on .100, if I click disconnect and then connect it will go back to 28. 

The interface was configured by DHCP? Ok, so how do I make it not do that? I have networkmanager and nm-applet installed

I wanna be able to change my IP or network connections without having to go into a config file. I'd like to disable whatever is doing this DHCP thing because I assume I don't really need it on since I have networkmanager & nm-applet

----------

## Jaglover

What does rc-status print?

----------

## NeddySeagoon

kenny_w,

You probably don't want a static IP unless the system is only ever connected to one network.

Things break horribly when you have two systems with the same IP.

DHCP makes sure that doesn't happen.

It sounds like you have several things trying to control your network interface.

That will all end in tears too.

Disable daemons and applications that control network interfaces until you don't get an IP address at boot.

When that happens, they are all disabled.

Now start exactly one.

----------

## kenny_w

 *NeddySeagoon wrote:*   

> kenny_w,
> 
> You probably don't want a static IP unless the system is only ever connected to one network.
> 
> Things break horribly when you have two systems with the same IP.
> ...

 

Ok, but HOW? I don't understand how to disable this thing... all I have is networkmanager & nm-applet, how do I disable the one that gentoo comes with???????????

That's what I'm asking.. I don't know what daemon its using!

and I can change it from a static IP to an auto-DHCP in one click with nm-applet, that's why I like networkmanager+nm-applet!

```

Runlevel: default

 NetworkManager                                                                                                                         [  started  ]

 net.enp4s0                                                                                                                             [  started  ]

 net.eth0                                                                                                                               [  stopped  ]

 netmount                                                                                                                               [  stopped  ]

 xdm                                                                                                                                    [  started  ]

 syslog-ng                                                                                                                              [  started  ]

 sshd                                                                                                                                   [  started  ]

 local                                                                                                                                  [  started  ]

Dynamic Runlevel: hotplugged

Dynamic Runlevel: needed/wanted

 dbus                                                                                                                                   [  started  ]

 xdm-setup                                                                                                                              [  started  ]

 modules-load                                                                                                                           [  started  ]

Dynamic Runlevel: manual

```

Edit: oooooooooh, its net.eth0 / net.enp4s0

I forgot this was a thing I added to OpenRC while installing Gentoo, thanks a bunch guys! Its been solved!

How do I mark this thread as solved? Do these forums not work like that?

----------

## NeddySeagoon

kenny_w,

Gentoo does not come with any network daemon. You have to configure it. 

Edit the title in your first post to the topic. Add [solved] at the end.

----------

## lwlvl

Kenny, I agree to NeddySeagoon.

Having a static IP is only useful for a handfull of purposes.

Seems like your system is autoconfiguring the NIC via DHCP.

I would suggest to use that feature and give the machine a static dhcp-lease in your router.

This is normally done by adding the MAC-Address to the specific table.

As I don't use any additional GUI-Tools to configure my network, I can't help you further with them.

Conclusion: Use DHCP with static lease.

Regards,

Jan

----------

## Jaglover

Install DHCP client and run it only to get a static address? Not what I call simple. And I like simple.

----------

## Hu

A DHCP reservation is less simple than statically configuring the client, but it has the advantage that it keeps the client system simple and moves all the complexity to the DHCP server.  That makes it easier to administer a network with more than one computer, since the DHCP server is authoritative in address assignments.  It also protects against IP address collisions if the client is ever moved elsewhere, as the new network can issue it a different address.  Properly configured, this can also provide the other benefits of DHCP, such as keeping a single master list of DNS servers.  If you configure the client statically, and your DNS administrator decides to move the DNS servers to new addresses, you must fix the configuration on every client that had been configured with the old addresses.  With DHCP, you update the DHCP server configuration, and new addresses roll out with the next DHCP lease renewal.

All that said, I will agree that a client-side static configuration is the simplest to set up.  You may pay for it later if your network becomes complicated.  I prefer to pay the slight complexity cost up front with a DHCP reservation, rather than deal with a mess when the network grows to have so many client-side static addresses that management becomes complicated.

----------

