Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
disable network interface for startup [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Fri May 05, 2023 5:56 am    Post subject: disable network interface for startup [solved] Reply with quote

I use openrc as init.
My system has two wired network interfaces (net.enp39s0, net.enp38s0) where only one is plugged in (currently enp38s0)

in /etc/rc.conf i have set
rc_hotplug="* !net.*"

Still during boot also enp39s0 is started, trying dhcp and waiting for carrier delaying boot.
I also seems to be occuring on every boot.

Is there a way to have this only started if i manually add it to a runlevel (as intended with the !hotplug). Any ideas what can be the reason, what to check?


Quote:
rc-config list | grep net
net-online
net.enp38s0 default
net.enp39s0
net.enp42s0f3u2
net.lo boot
net.wlo1
netmount default
xinetd


Quote:
cat /etc/conf.d/netmount | grep -v ^#
rc_need="dhcpcd"
rc_need="net.enp38s0"


Quote:

Dynamic Runlevel: hotplugged
net.enp39s0 [ stopped ]
net.wlo1 [ stopped ]
net.enp38s0 [ started ]


From rc.log
Quote:


* Bringing up interface enp39s0
* Caching network module dependencies
* config_enp39s0 not specified; defaulting to DHCP
* dhcp ...
* Running dhcpcd ...
dhcpcd-9.4.1 starting
DUID 00:01....26:0c
enp39s0: IAID 42:a5:3c:c3
enp39s0: adding address fe80::ac19:...:a322:5edb
enp39s0: carrier lost
enp39s0: deleting address fe80::ac19:...:a322:5edb
timed out
dhcpcd exited
[ !! ]
[ !! ]
* ERROR: net.enp39s0 failed to start
* Bringing up interface wlo1
* Starting wpa_supplicant on wlo1 ...
* start-stop-daemon: /usr/sbin/wpa_supplicant is already running
[ !! ]
* ERROR: net.wlo1 failed to start

Thanks a lot
s|mon


Last edited by s|mon on Fri May 05, 2023 6:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Fri May 05, 2023 7:04 am    Post subject: Reply with quote

s|mon,

You need a small edit in /etc/rc.conf. Te comments will guide you.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Fri May 05, 2023 10:58 am    Post subject: Reply with quote

i think/hope that it might be the order "* !net.*" should be rather "!net.* *" will test once next reboot is possible.
If that works thanks for the subtle hint :wink:!
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1660

PostPosted: Fri May 05, 2023 12:28 pm    Post subject: Reply with quote

Is this physical removal of the device (not the cable)? Then continue working on this path.

If you are looking for cable detection, then just install sys-apps/netplug or sys-apps/ifplugd and they will be automatically used for cable detection. This bypasses any DHCP request when not plugged in.
Back to top
View user's profile Send private message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Fri May 05, 2023 6:29 pm    Post subject: Reply with quote

No it is just cable detection (during boot, because there it slows down startup) as both are physically on the mainboard and can not be deactived individually in BIOS (at least i did not find it).

The change worked. Will now also try netplug, thanks for the hint.

[edit] Tried netplug, works as well. Thanks!
Back to top
View user's profile Send private message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Mon May 15, 2023 5:51 am    Post subject: Reply with quote

One more point to netplug in case someone still reads this.
I observed that now with this active after a suspend resume cycle all my network nfs mounts are gone and i neet to issue 'mount -t nfs -a' to have them back.
Is there a workaround or solution for that?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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