View previous topic :: View next topic |
Author |
Message |
costantino n00b
Joined: 17 Jan 2025 Posts: 3
|
Posted: Fri Jan 17, 2025 11:06 am Post subject: Unexpected network behavior |
|
|
Hi, All
I need small Gentoo system and just installed it. Work normally, but I need static IP-address, and my system activate dhcpcd. DHCPcd was not installed by mine, but activated.
I can’t delete dhcpcd: rc-update del dhcpcd
* rc-update: service ‘dhcpcd’ is not in the runlevel ‘default’
Rc-update says doesn’t have dhcpcd at any run level:
…
devfs | sysinit
dmesg | sysinit
fsck | boot
…
but rc-service –list says:
…
device-mapper
dhcpcd
dmesg
…
i.e. dhcpcd exists in services list. how to remove it? Or doesn’t run it?
Yes, I can install dhcpcd and deinstall it, but in this case network doesn’t start:
* ERROR netmount needs service(s) net
Configured /etc/conf.d/net ignores or doesn’t accepts and, then I configures network from cli:
ip address add 192.168.1.100/24 dev ens33 // this command accepts
but ip route add default via 192.168.1.1 returns “Error: Next hot has invalid gateway”
Rc-update negates service ens33 or net.ens33 (even its started when dhcpcd works):
* rc-service: service net.ens32 does not exist
(symbolic link net.ens33 exists)
It is not a first try, other installations works identically
How to fix net behavior? Whats wrong? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54725 Location: 56N 3W
|
Posted: Fri Jan 17, 2025 11:56 am Post subject: |
|
|
costantino,
Welcome to Gentoo.
Don't you hate the autoblackmagic, I do too?
The right way to do this is to continue to use DHCP but fix the allocated IP address in your DHCP server, so the same address is always allocated. That is, it appears to be static.
If you really really must have a static IP, go into your DHCP server and restrict the range of addresses that DHCP is permitted to allocate.
Now you can allocate an address statically from the reserved range without horrible things happening when two hosts try to use the same address.
Create your /etc/conf.d/net file
Code: | modules="iproute2"
# dhcpcd is IPv6 only
config_eth0="dhcp"
config_eth0="192.168.100.25/24"
# Pi_router
routes_eth0="default via 192.168.100.252" | My interface is called eth0.
Go to less and make a symbolic link
Now you can add net.eth0 to the default runlevel. As net.eth0 is manually configured, DHCP will not be used.
Reboot to test.
You will need to change names and IP address to suit your system. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1990
|
Posted: Fri Jan 17, 2025 1:28 pm Post subject: |
|
|
costantino wrote: |
Rc-update negates service ens33 or net.ens33 (even its started when dhcpcd works):
* rc-service: service net.ens32 does not exist
(symbolic link net.ens33 exists) |
Please show: ls -l /etc/init.d/net.* and ip link outputs.
Also, notice you keep saying ens33 but you tried to add net.ens32 to the runlevel. |
|
Back to top |
|
|
costantino n00b
Joined: 17 Jan 2025 Posts: 3
|
Posted: Fri Jan 17, 2025 3:18 pm Post subject: |
|
|
[quote="NeddySeagoon"]
I know these jokes w/DHCP server, but I would like to make clean static IP configuration
[quote="grknight"]
ens32/ens33 used in different installation and I a bit confused. but in each installation uses right network adapter
on "ls -l..." result is blinking "net.ens33 -> net.lo"
I can't make copy/paste by ssh, because this system has excluded dhcpcd (by install/uninstall) and network completely not working here
ip link: buffff..., I copyed by hand:
1: lo: <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: <BROADCAST,MULTYCAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 00:0c:29:bc:4d:1b brd ff:ff:ff:ff:ff:ff
altname enp2s1
can I attach screenshot here?
if use altname/enp2s1 - stil no result |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54725 Location: 56N 3W
|
Posted: Fri Jan 17, 2025 3:22 pm Post subject: |
|
|
costantino,
Quote: | "ls -l..." result is blinking "net.ens33 -> net.lo" |
blinking means that the link is broken - it points to nothing.
It should be a steady Cyan colour, like linux in _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
costantino n00b
Joined: 17 Jan 2025 Posts: 3
|
Posted: Fri Jan 17, 2025 3:38 pm Post subject: |
|
|
I think logic it's broken, because network not started
hmmmm... on installation w/dhcpcd started and network functioned link also broken |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1990
|
Posted: Fri Jan 17, 2025 3:57 pm Post subject: |
|
|
Make sure that net-misc/netifrc is installed in order to use /etc/conf.d/net. That package provides /etc/init.d/net.lo |
|
Back to top |
|
|
|