100% CPU usage caused by DHCPv6 Client

Hey All,

My network speeds were 1/8th of what ISP gave me, so I looked into my Rpi4 (4gb) and all CPU cores were peaking at 100% 1.5ghz.
I restarted it last night, and now checked again, 100% CPU.
On the top of the list, it was dhcpv6 client, so I've disabled that interface, lo and behold, CPU is now at almost 0% on all cores. Any idea why could that be? Did I mess something up with dhcpv6?

Thanks,
Mark

Hard to say, without seeing your config files...

@eduperez makes sense sorry, it's close to base config.

config interface 'wan6'
	option ifname 'br-lan'
	option proto 'dhcpv6'
	option reqaddress 'try'
	option reqprefix 'auto'
	option auto '0'

Why is your WAN6 network tied to your LAN interface?

3 Likes

Are you running on a smart switch? Could you have a network loop that makes it process packets , like it sends dhcp6 and then somehow it receives its own request and replies to it?

2 Likes

I honestly think I messed something up, route is ISP --> Rpi4 -->AP
The loop could be happening between ISP and Rpi4. @dlakelan
@eduperez I aimed to use the same interface that I'm using for wan. Thing is, I haven't had time to properly configure this one due to work, but simply having wan on eth0, it doesn't connect to pppoe, (nor with eth1) but if it's on br-lan which is the same interface as eth0, then it works.
Again, i'm 110% it's misconfiguration from my end.. I'm a noob in networking.

Drop the whole networking config in here and let's see where you went wrong

Appreciate it! There you go:

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix ‘——————‘

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.8'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option gateway '192.168.1.1'
	option broadcast '192.168.1.255'
	option ifname 'eth0 eth1'
	list dns '1.1.1.1'

config interface 'wan'
	option ifname 'br-lan'
	option proto 'pppoe'
	option username ‘—————————
	option ipv6 'auto'
	list dns '1.1.1.1'
	list dns '1.0.0.1'
	option peerdns '0'
	option password ‘—————‘

config interface 'wan6'
	option ifname 'br-lan'
	option proto 'dhcpv6'
	option reqaddress 'try'
	option reqprefix 'auto'
	option auto '0'

Yeah, you've definitely gone wrong :smiley: good news is it should be pretty easy to fix.

I'm going to assume that eth0 is your onboard ethernet, and that you have a USB ethernet that's eth1

I'm going to change your network numbering because it looks like maybe your ISP uses the 192.168.1.0/24 which is why you're doing 192.168.1.8 as your IP address, I'm not sure.

I'm going to assume you have your ISP connected to eth1, the USB ethernet. That's a good plan.

So br-lan should be a bridge containing ONLY eth0.

and wan should be directly connected to eth1

also on lan, you should probably use openwrt as your DNS, and let it look up stuff on 1.1.1.1... so I made that change too. And you really want to ip6assign /64 not /60

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix ‘——————‘

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.2.1'
	option netmask '255.255.255.0'
	option ip6assign '64'
	option broadcast '192.168.2.255'
	option ifname 'eth0'


config interface 'wan'
	option ifname 'eth1'
	option proto 'pppoe'
	option username ‘—————————
	option ipv6 'auto'
	list dns '1.1.1.1'
	list dns '1.0.0.1'
	option peerdns '0'
	option password ‘—————‘

config interface 'wan6'
	option ifname '@wan'
	option proto 'dhcpv6'
	option reqaddress 'try'
	option reqprefix 'auto'
	option auto '0'

keep a backup of your current settings, and then replace your network file with my file, and type in the right thing with the __________ values

3 Likes

Yeah I guessed so.. :smiley:
Assumptions are wrong though, but let me know if there's any advantage of having the AP on the onboard ethernet, while wan(ISP) would be on USB ethernet.

So this matters even with dhcp handled by the Pi?

I also have every feature turned off on the ISP box, not to intervene with anything on the router, but in that case I'll use a new subnet as suggested.

Thank you also on the DNS tip :slight_smile:

I appreciate the time you took to fix this! Thank you!

The thing to understand about a router is that it routes between different network segments.... it's like a doorway between two different rooms. Each room has its own "address" so imagine that you've got a conference room and a kitchen next to each other, but they both have the same room number... how would you tell the food service delivery person which room to drop the flats of coffee in?

Each network segment needs a separate address space.

Also, there's an advantage to having WAN be on the USB device, because if the USB device malfunctions, gets unplugged, etc you can always connect to the LAN still and debug what's wrong on your Pi.

1 Like

This is not wrong. If another router in the lan requests a prefix from the dhcp6d of OpenWrt, it won't get anything with a /64 in the lan.
Also I don't see the point for option auto '0' in wan6. This disables the interface on boot.

Makes sense, thank you for the explanation!
@trendy I put that there so that it stays disabled until it's fixed.

That's fine, just don't forget it when you apply the updated configuration.

1 Like

I'll make sure not to forget that :slight_smile: Thanks!

Yeah, but anyone who has cascaded routers in their LAN would know that, and using /60 by default can cause problems if all you have is a /60 or /64, which is a thing at many ISPs.

I get a /56 from ISP, on my Primary router I have /60 in the lan and on the secondary router wan6 is with defaults. Secondary router wan6 gets a /62.
On secondary router lan has ip6assign /60, then the lan will use the whole /62 for itself, but will use /60 from the ULA.
The only problem would be that other interfaces don't get a prefix, but this is per case. Here there is only lan so if the delegated prefix is /60 or bigger, lan will get /60. If it is smaller, lan will get the smaller one.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.