Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hot plugging net0 on a laptop
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 267
Location: Utility Muffin Research Kitchen

PostPosted: Sun May 17, 2020 6:42 am    Post subject: Hot plugging net0 on a laptop Reply with quote

I want to hotplug my ethernet, and use it, any time I like. I couldn't find out how to do this.

I ended up bonding wlan0 and net0, but don't think you can use dhcpcd. This works whether the machine boots with or without net0.

Code:
# rc-update show | egrep "dhcp|wpa|net"
                local |      default nonetwork                 
            net.bond0 |      default                           
             netmount |      default                           
       wpa_supplicant |      default   


Code:
# grep -v '^#' /etc/conf.d/net
config_net0="null"
config_wlan0="null"
modules_bond0="busybox udhcpc"
config_bond0="dhcp"
slaves_bond0="net0 wlan0"


Code:
# grep -v '^#' /etc/modprobe.d/bonding.conf
options bonding mode=1 miimon=100 fail_over_mac=1 primary=net0


The following is the result of pinging the firewall while I unplug and reinserting the RJ45.
Code:

# ping -D -i 2 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
[1589697430.852285] 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.578 ms
[1589697432.882569] 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.363 ms
[1589697434.930741] 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.540 ms
[1589697436.978840] 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.641 ms
[1589697439.026759] 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.548 ms
[1589697441.089486] 64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=15.3 ms
[1589697443.082232] 64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=5.60 ms
[1589697445.083515] 64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=4.13 ms
[1589697447.084654] 64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=2.98 ms
[1589697449.084505] 64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=0.723 ms
[1589697451.122845] 64 bytes from 192.168.1.1: icmp_seq=11 ttl=64 time=0.643 ms
[1589697453.170740] 64 bytes from 192.168.1.1: icmp_seq=12 ttl=64 time=0.541 ms


Last edited by Fog_Watch on Sun May 17, 2020 8:02 am; edited 1 time in total
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Sun May 17, 2020 7:08 am    Post subject: Re: How to hotswap Reply with quote

Fog_Watch wrote:
I want to hotplug my ethernet, and use it, any time I like. I couldn't find out how to do this.

Are you aware that Network management using DHCPCD does not need those workarounds?
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Sun May 17, 2020 12:24 pm    Post subject: Reply with quote

If I'm not mistaken wpa_supplicant also does hotplugging.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 267
Location: Utility Muffin Research Kitchen

PostPosted: Mon May 18, 2020 7:57 am    Post subject: Re: How to hotswap Reply with quote

charles17 wrote:
Are you aware that Network management using DHCPCD does not need those workarounds?

That's better.
Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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