View previous topic :: View next topic |
Author |
Message |
lonex Tux's lil' helper
Joined: 22 Aug 2004 Posts: 107 Location: Karlsruhe, Germany
|
Posted: Thu Sep 05, 2013 7:51 pm Post subject: [solved]After reboot: System uses DHCP despite static config |
|
|
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):
Code: | 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):
Code: | 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? _________________ There are no dumb questions, just dumb answers. So please help users that are new to linux/gentoo by answering unanswered questions.
Last edited by lonex on Thu Sep 05, 2013 8:48 pm; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54097 Location: 56N 3W
|
Posted: Thu Sep 05, 2013 8:31 pm Post subject: |
|
|
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.
Code: | # 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 |
_________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
lonex Tux's lil' helper
Joined: 22 Aug 2004 Posts: 107 Location: Karlsruhe, Germany
|
Posted: Thu Sep 05, 2013 8:50 pm Post subject: |
|
|
Hi NeddySeagoon,
thank you. Yes, it is indeed OVH.
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. _________________ There are no dumb questions, just dumb answers. So please help users that are new to linux/gentoo by answering unanswered questions. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|