ifconfig on startup fails because usb ethernet adapter is not initialized yet

I have an ethernet adapter connected via usb-c. I added my ifconfig_ue0="" to /etc/rc.conf but it doesn't work because the USB devices are loaded afterwards.
Is there a way to create a dependency or delay startup or so?
 
I have an ethernet adapter connected via usb-c. I added my ifconfig_ue0="" to /etc/rc.conf but it doesn't work because the USB devices are loaded afterwards.
Is there a way to create a dependency or delay startup or so?
I tried to add netwait to my rc.conf but with little success.
This is the output of dmesg -a | grep ue0
Code:
dmesg -a | grep ue0
ue0: <USB Ethernet> on ure0
ue0: Ethernet address: 58:ef:68:7f:a3:d8
ue0: link state changed to DOWN
Starting Network: ue0.
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ue0: link state changed to UP
ue0: link state changed to DOWN
ue0: link state changed to UP
ue0: link state changed to DOWN
ue0: promiscuous mode enabled
ue0: link state changed to UP
ue0: promiscuous mode disabled
ifconfig: BRDGADD ue0: No such file or directory
ue0: <USB Ethernet> on ure0
ue0: Ethernet address: 58:ef:68:7f:a3:d8
ue0: link state changed to DOWN
Starting Network: ue0.
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
Waiting for ue0, interface present
ue0: link state changed to UP
ue0: promiscuous mode enabled
ifconfig: BRDGADD ue0: No such file or directory
ue0: <USB Ethernet> on ure0
ue0: Ethernet address: 58:ef:68:7f:a3:d8
ue0: link state changed to DOWN
Starting Network: ue0.
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
Waiting for ue0, interface present
ue0: link state changed to UP
ifconfig: BRDGADD ue0: No such file or directory
ue0: <USB Ethernet> on ure0
ue0: Ethernet address: 58:ef:68:7f:a3:d8
ue0: link state changed to DOWN
Starting Network: ue0.
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ue0: link state changed to UP
ue0: promiscuous mode enabled
It seems the devices comes up and down multiple times and two times I can see an error when it tries to add the device to the bridge. The last time however there is no error but the device is not added to the bridge.
I also wonder what this ure0 device is.

Code:
ure0 on uhub1
ure0: <Belkin Belkin USB-C LAN, class 0/0, rev 3.00/30.00, addr 1> on usbus1
Not sure what this tells me.

> You could put an ifconfig command in your ~/.login or .cshrc file or in your window managers autostart file.

It's intended to run on a server without anyone to login. Not sure this will work then.
 
Thanks for the input!
I changed my plan and ditched the USB ethernet completely. Not sure why but running pppoe over that usb ethernet interface maxed out at around 100Mbit/s even if the dongle managed to easily transfer 1GBit/s when used in a "normal" network scenario.

> Take a look at netwait_if in rc.conf(5). Alternatively, it's very simple to create your own rc.d script to handle this; see Practical rc.d scripting in BSD or just copy something from /etc/rc.d.

I guess I would have done something like that.

> Maybe you need to point to the ure(4) driver instead

I think I tried that but that also did not work. It was not recognized as a network interface. Only ue0 was but on startup it was toggled on/off a couple of times every time.
 
Back
Top