Solved Network card is not enabled

What does pkg query '%At:%Av' drm-515-kmod tell you?

From a different Mac, which I used for an earlier test:

Code:
root@mowa219-gjp4-macbookpro83-20240708:~ # pkg query '%At:%Av' drm-515-kmod
FreeBSD_version:1400097
build_timestamp:2024-04-09T01:07:59+0000
built_by:poudriere-git-3.4.1-1-g1e9f97d6
port_checkout_unclean:no
port_git_hash:b3aa1ea86
ports_top_checkout_unclean:no
ports_top_git_hash:c5cd82114
repo_type:binary
repository:FreeBSD_install_cdrom
root@mowa219-gjp4-macbookpro83-20240708:~ #

Not specially built for 1401000.
 
That's good, now configure the network interface to get an IP.

I assume the machine is connected to a router or internet modem with a DHCP server.
Yes, my rooter is configured for DHCP.
/etc/rc.conf
Code:
ifconfig_re0="DHCP"
Start service: service netif restart

After sysrc ifconfig_re0="DHCP" and service netif restart “Network card is not enabled”. Rebooting did not help. However, after switching off WiFi, the network icon finally lit up — unfortunately, for minute or two. I did not find any message in syslog. ifconfig has now included one paragraph for Ethernet, with a correct IP and MAC, yet without Realtek RTL8125. Maybe I should disable WiFi somehow? There is no such hardware switch.
 
Finally, I manage to keep my Ethernet connection from going down after a minute. I do not know why, maybe because I enterd ifconfig_re0="inet 192.168.1.107 netmask 255.255.255.0" instead of ifconfig_re0="DHCP" in rc.conf.

Unfortunately, until the reboot. No means prevent a non-working WiFi from being loaded and turned on instead of Ethernet. Here is the network part from my rc.conf:
Code:
if_wlan_load="NO"
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
ifconfig_wlan0="NOAUTO"
# wlans_iwlwifi0="wlan0"
# create_args_wlan0="down country LT"
# ifconfig_wlan0="up scan WPA DHCP"
# ifconfig_wlan0_ipv6="inet6 accept_rtadv"
ifconfig_re0_ipv6="inet6 accept_rtadv"
ifconfig_re0="inet 192.168.1.107 netmask 255.255.255.0"
defaultrouter="192.168.1.1"

I have thoroughly read the network and advanced networking chapters in the handbook, ifconfig, iwlwifi, re, dhclient, loader.conf and rc.conf manuals, but I have not found an explanation of what prevents loading RTL8125, why WiFi is preferred to Ethernet, and why my directives to disable a non-working WiFi are ignored and even overwritten.

Interestingly, my directives in rc.conf are executed on boot, but cancelled and rc.conf is overwritten later, after Xorg has been loaded, with no explanation in the syslog.
 
Here is the network part from my rc.conf:
Code:
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
This might be the problem already. According to my FreeBSD instincts (confirmed by the port's pkg-message) those two lines should go into /boot/loader.conf. If you want to use rc.conf, you should use:
Code:
kld_list="/boot/modules/if_re.ko"
 
Here is the network part from my rc.conf:
Code:
if_wlan_load="NO"
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"

Code:
if_wlan_load="NO"
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
those settings belong in /boot/loader.conf

if_wlan_load="NO" even set correctly has no effect, the wlan module is not load anyway.

Code:
ifconfig_wlan0="NOAUTO"
must be
Code:
ifconfig_iwlwifi0="NOAUTO"

my diretives in rc.conf are executed on boot, but cancelled and rc.conf is overwritten later, after Xorg has been loaded,
They are not cancelled, they are ignored, see above explanation.

It's impossible that a configuration in /etc/rc.conf is overwritten automatically, such an option is not provided from FreeBSD base or installed packages.
 
Code:
ifconfig_wlan0="NOAUTO"
must be
Code:
ifconfig_iwlwifi0="NOAUTO"
I know, I have tested NOAUTO — ignored, so I tried NO. I have reverted it now, but that does not help.

It's impossible that a configuration in /etc/rc.conf is overwritten automatically, such an option is not provided from FreeBSD base or installed packages.
That would be logical, but surely the entries I have deleted (commented out) are written back to rc.conf automatically on reboot, without asking for my permission.

those settings belong in /boot/loader.conf
I know, but iwlwifi() ignores loader.conf. And rc.conf seems to accept and understand these entries.

kld_list="/boot/modules/if_re.ko"
I am going to test this right away, thank you very much!
 
I know, I have tested NOAUTO — ignored, so I tried NO. I have reverted it now, but that does not help.
Have you set NOAUTO to ifconfig_iwlwifi0 ( not ifconfig_wlan0 )?

That would be logical, but surely the entries I have deleted (commented out) are written back to rc.conf automatically on reboot, without asking for my permission.
Are you sure you have saved rc.conf after edit? There is no way some function would overwrite it.

Code:
if_re_name="/boot/modules/if_re.ko"
I am going to test this right away

Both of them
Code:
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
 
kld_list="/boot/modules/if_re.ko" neither fixed nor broke. NOAUTO for ifconfig_iwlwifi0 instead of ifconfig_wlan0 reverted the previous condition when Ethernet is being disabled shortly after activation. However, I am not sure if that is the case.

Are you sure you have saved rc.conf after edit?
Yes, of course.

There is no way some function would overwrite it.
I would guess this is NomadBSD's behaviour. Because in the boot log I clearly see WiFi disabled, only lo0 and re0 enabled, with correct networking data. And no error warnings, no changes up to the graphical login.

For now, the best solution is to disable the Network Manager via its icon menu, then revert rc.conf, service netif restart && service routing restart, and finally dhclient re0.
 
kld_list="/boot/modules/if_re.ko" neither fixed nor broke.
The specific module provided by the package must be set explicitly or else the system kernel module is used (/boot/kernel/if_re.ko) ... don't know how NomadBSD this handles.

There is no way some function would overwrite it.
I would guess this is NomadBSD's behaviour. Because in the boot log I clearly see WiFi disabled, only lo0 and re0 enabled, with correct networking data. And no error warnings, no changes up to the graphical login.

... Network Manager ...
Maybe that network manager is messing with rc.conf.

the best solution is to disable the Network Manager via its icon menu, then revert rc.conf, service netif restart && service routing restart, and finally dhclient re0.

Doesn't the network manger have a preferred network setting?

NOAUTO for ifconfig_iwlwifi0 instead of ifconfig_wlan0 reverted the previous condition when Ethernet is being disabled shortly after activation.
You could try blocking the iwlwifi driver being loaded and attached to the device:

/etc/rc.conf
Code:
devmatch_blocklist="if_iwlwifi"
 
#37 T-Daemon:
You could try blocking the iwlwifi driver being loaded and attached to the device.
Indeed, no WiFi traces were left during the boot process. However, when the boot completed, WiFi returned back to both the network manager and rc.conf. :oops:
 
I eventually installed NomadBSD from USB to an internal SSD of my miniPC — the same behaviour. Workable, just annoying interference after reboots.
I'm using plain FreeBSD 14.1-RELEASE with x11-wm/xfce4 for the desktop environment
Maybe I will move from NomadBSD to pure FreeBSD, too. Possibly with OpenBox instead of Xfce. Many thanks to bsdcode, T-Daemon, Tieks, adorno, Cath O'Deray, and of course SirDice — the true masters of the right OS. With such a skilful, helpful, and strong community, you will never get lost!
 
… No means prevent a non-working WiFi from being loaded and turned on …

NomadBSD aside,

grep -B 4 -A 3 key_mgmt=NONE /etc/wpa_supplicant.conf

If you have an unwanted key_mgmt=NONE section, aim to remove it.

Found recently on an updated installation of 14.0-RELEASE:

Code:
network={
    priority=0
    key_mgmt=NONE
}

Its origin is a mystery.
 
If you have an unwanted key_mgmt=NONE section, aim to remove it.
No, wpa_supplicant.conf was not present when installed, it does not seem to be necessary. Wi-Fi 6 AX200 sees neighbouring wireless spots, puts my "hq" first, asks for password (PSK) when connecting, but gets stuck, something does not negotiate (errors are logged, but I do not understand them). I handwrote wpa_supplicant.conf, though a very simple one:
Code:
network={
  ssid="hq"
  psk="…"
}

256957 – Wi-Fi: rc.conf(5) NOAUTO, ifconfig(8) up and unwanted WLAN connections to open networks
OK, I removed the NOAUTO, it has not been working anyway.
 
Its origin is a mystery.

1720775956808.png


Found, thanks to a security researcher:​

This aspect of installation – connect to any open network – seems inconsistent with descriptions of FreeBSD as "Secure by Design".
 
I found the easiest way. After the computer boots up, wait a minute or so for the rc.conf(5) to be automatically overwritten. To avoid waiting, it is better not to fight with the network manager at all, but rather to remove all barriers for loading WiFi. Once the loading is complete, a single command dhclient re0 is enough!

Now it seems to me that the cause is a minor bug in the iwlwifi(4) driver. On my old laptop, the same net-mgmt/networkmgr seamlessly switches from wireless to wired communication if WiFi is sometimes down, “no carrier”. But this Intel AX200 does not get “no carrier”, it sees the wireless environment, it just can not connect because of some negotiation mismatch. And thus it gets stuck without passing the connection over the wire.

I do not know how to code, fix iwlwifi(4) — in meanwhile, is there any way to put dhclient re0 somewhere at the end of loader.conf(5)?
 
I may be late to this conversation, but I did find a usable solution:

I've got a 15-CURRENT VBox VM with ports that I created from a 15-CURRENT snapshot dated Oct. 24... I used that to compile the driver net/realtek-re-kmod. I created a package with make package, and moved that to the metal that has the Realtek hardware and 15-CURRENT snapshot. And now my hardware has working ethernet on 15-CURRENT (snapshot dated Dec. 7)

My hardware: Asus Prime B650-M, with a Realtek 2.5 GB/s ethernet connection. Processor: Ryzen 5 7600. 32 GB of RAM.
 
Back
Top