The Internet does not work until you restart the netif service

Hello everyone, I'm new to FreeBSD, and so I installed FreeBSD 15 (and changed repos from quarterly to latest), but after installation I discovered that the Internet was not working, I restarted the netif service and it appeared, but after rebooting pc i had no internet again, and after rebooting netif it appears, what do you recommend to do to fix this problem?
 
As you are new to FreeBSD, did you install it with ZFS on root? If so, at a command prompt, run:

Code:
bectl list

That will show you how many boot environments that you have available to rollback to if/when you mess things up.

Watch this video and learn from it. It will give you the confidence to make changes and experiment without trashing your system.
View: https://youtu.be/OyxewvZlyjU


Now on to your actual problem...

When you installed FreeBSD, did it run OK when you booted into the freshly installed system? Did it initialize the network connection and gain access to the internet OK? If so, and the number of changes that you have made since the most recent boot environment snapshot are trivial and can be performed manually to recreate them, then the fastest way to repair is to rollback to a working boot environment.

If not, and you have too many changes to apply, then there are two things to do:
1. Fix the problem.
2. Learn how to use ZFS snapshots so that you can snapshot your filesystems before making any configuration change, installing any package or updating any package. Boot Environments use snapshots and are great for a last resort when you forgot to do a manual snapshot.

View: https://youtu.be/rUgp0jmkktc


I am guessing from what you describe is that your FreeBSD system is using DHCP to obtain an IP address from a DHCP service present on the connected network. Sometimes, obtaining the IP address can be slow and the rest of your system is ready before IP. If this is the case a simple change to /etc/rc.conf could fix this.

Edit /etc/rc.conf with root privilege.

E.g.
Code:
sudo zfs snapshot -r zroot@dhcpfix
sudo zfs list -t snapshot | grep @dhcpfix
sudo nano /etc/rc.conf

Edit the ifconfig line that contains DHCP and change DHCP to SYNCDHCP. Save the change and reboot to test.
 
If this fixes your system and you no longer need the snapshot to rollback to, you can delete the snapshot using:

Code:
sudo zfs destroy -r zroot@dhcpfix
 
Dear vmb , your intentions are good , your advice is not . There is a chronological logical way to solve problems. And playing with zfs is not the first for solving IP problems. Certainly not youtube links.
 
The first lesson any newcomer to ZFS/FreeBSD should learn is how to rollback their broken system to a working state. From that point, they are learning from their own mistakes and can often fix it themselves. Keeping it simple, SYNCDHCP is likely the problem if restarting netif cures it.
 
So you say already his system is broken. You could be right. But, currently we only know there is an IP problem. Dont fix what does not need to be fixed. Because if you do it wrong, you can "super-break" your system :)
 
So you say already his system is broken
I didn't actually say the system was broken. I just let the OP know that there is a quick and easy way of getting a ZFS/FreeBSD system back to a known working state.

From my own experience, FreeBSD can be sensitive to some DHCP Servers and not pick up an IP address before system initialization completes. This isn't necessarily a problem with FreeBSD, obtaining an IP from another DHCP server in another network may work just fine.

Using SYNCDHCP instead of DHCP slows the startup sequence a little by ensuring that FreeBSD has an IP address from DHCP before continuing. A system that doesn't use SYNCDHCP in network environment that creates this sensitivity can often be fixed by restarting netif after login.
 
The first lesson any newcomer to ZFS/FreeBSD should learn is how to rollback their broken system to a working state.
I never learned that :p (heard of bectl but haven't used it)


I've seen oddities with local_unbound (not sure if DHCP vs SYNCDHCP) and restarting netif mysteriously fixed it sometimes (iirc there was another or 3 different network commands for restarting network); I eventually stopped enabling that and doing static IP on IPv4 at install-time. I do auto IPv6 with SLAAC.

During install there's a network part that asks for search domains(?) and IPv4/6 DNS; I use defaults (everything blank except auto-filled IPv6 DNS). Not sure if any of that would be applicable, but I found that config to work the most consistently.
 
I just let the OP know that there is a quick and easy way of getting a ZFS/FreeBSD system back to a known working state.
The thing is, he may not need to roll it back. This might be a simple setting somewhere. If he rolls it back, the problem vanishes only to reappear at another time and a lesson won't be learned.
 
The OP hasn't answered since their first post from last night, so, either they've been busy, or they were a 'bot, or just trollin'. Hopefully, they've just been busy.

Or, several other possible reasons for not responding, whether nefarious or benign. :)
 
The OP hasn't answered since their first post from last night, so, either they've been busy, or they were a 'bot, or just trollin'. Hopefully, they've just been busy.

Or, several other possible reasons for not responding, whether nefarious or benign. :)
The issue was resolved by adding these lines to loader.conf if_re_load="YES"
if_re_name="/boot/modules/if_re.ko", and yesterday I felt bad, but thank you all for your attention
 

Attachments

  • Screenshot_20260330_123129.png
    Screenshot_20260330_123129.png
    120.9 KB · Views: 4
I know that on a Beelink SER5 that I have, The Realtek card was not seen during install nor after install. A second Beelink I have, an SER5 Pro (I don't think I noticed any difference aside from this) which has what seemed to be a slightly older RT8111/8168/8211/8411, din't have the problem, card was seen during install from a boot-only image, while this one has the RL8125 card. For that I did have to install the realtek-re-kmod from packages before it would see the card. This was in July 2025 or so.
 
Back
Top