# [solved]After reboot: System uses DHCP despite static config

## lonex

I'm setting up a remote server, which isn't even my first one, but the first one recently. I have a strange network behaviour that I can't seem to figure out.

It's a small server with just one on-board NIC. The new default device name on the freshly installed Gentoo system is "enp1s0". I created the necessary symlink net.enp1s0 -> net.lo and put a static configuration in place:

My /etc/conf.d/net looks as follows (just x-ed out some digits for privacy reasons):

```
config_enp1s0="37.187.xxx.xxx/24 2001:41D0:xxxx:xxxx::1/64"

routes_enp1s0="default via 37.187.xxx.xxx"

routes_enp1s0="2001:41D0:xxxx:xxxx:ff:ff:ff:ff dev eth0"

routes_enp1s0="default via 2001:41D0:xxxx:xxxx:ff:ff:ff:ff"
```

The original net-config from the pre-installed Gentoo system by my provider was (I changed it from the deprecated bash-style arrays):

```
config_eth0=( 

"37.187.xxx.xxx/24"

"2001:41D0:xxxx:xxxx::1/64"

)

routes_eth0=( 

"default via 37.187.xxx.xxx" 

"2001:41D0:xxxx:xxxx:ff:ff:ff:ff dev eth0"

"default via 2001:41D0:xxxx:xxxx:ff:ff:ff:ff" 

)
```

The 2nd one on the original system worked perfectly.

On my own re-installed system though, when I boot the system, dhcpcd gets started and configures the device. DHCP gives the correct IPv4 but no IPv6, that's how I noticed in the first place. When I shut down dhcpcd, the interface is down.

But when I don't shut down dhcpcd, but just restart net.enp1s0, I get the normal static network config, including IPv6, that I have configured in /etc/conf.d/net (the first example in this post).

So if the static config in general seems to work fine when I manually restart the device - why doesn't it work when booting the system, and even more curious, why does dhcpcd take over?

Does anyone have an idea to get me on the right track here?

----------

## NeddySeagoon

lonex,

Your provider needs to be taken out and shot.  I just know its OVH. I set up a server there last Christmas.

Nobody else provides antique Gentoo.  Throwing it away and starting again is the right thing to do.

Did you add net.enp1s0 to the default runlevel so the interface is started by the startup scripts rather than by udev.

I'm not sure that the multiple routes_enp1s0 statements are additive.

Heres my net file from my OVH server.

```
# make sure use use iproute2

modules="iproute2"

# baselayout 2

# no brackets for baselayout2

config_eth0="5.135.178.112/24 brd 5.135.178.255

             2001:41d0:8:b970::2/56"

# we only have a /64 but need to use /56 here so the router can be reached

# otherwise the default route is out of our network

routes_eth0="default via 5.135.178.254

             default via 2001:41d0:8:b9ff:ff:ff:ff:fd"

# The router (default gateway) for each IPv6 is always on IP:v:6:FF:FF:FF:FF:FF

# except when it isn't
```

----------

## lonex

Hi NeddySeagoon,

thank you. Yes, it is indeed OVH.  :Wink: 

Two things were wrong ... 1) I guess the way I specified the routes was wrong indeed. 2) I actually had put net.eth0 into the default runlevel, but after I realized the device's name was different and I renamed the symlink, I forgot to re-add it there. So it wasn't in the neccessary runlevel.

Thanks for your help, all works as expected now.  :Smile: 

----------

