Sometimes I get no default route error out of the blue

I use a USB ethernet dongle to connect to the internet. Sometimes with this I get no default route, so no internet. Then I do route add default 192.168.1.1, only then I can connect. Why does it do this? The device gets an 192.168.1.xx ip anyway, just do 192.168.1.1 why can't it do on it's own?
 
If you are using static IP configuration, maybe make it permanent so it wouldn't occur anymore. Try setting the defaultrouter variable in rc.conf to the router's IP. If you are using DHCP, I don't know why that happens.
 
We need more information about the network topology and configuration to understand your situation.

Please describe your network, and any appliance that connects your network to the Internet.

It would help to see the contents of /etc/rc.conf, /etc/resolv.conf and the output from the commands ifconfig -a and netstat -rn.
 
We still need more information from kriptomahsun. e.g. some USB NICs don't initialise before they need to be used at boot time. I have an old fix for that (not sure if it's optimal). So, amongst other things, we need to know if the problem is random or only happens immediately after boot.
 
We still need more information from kriptomahsun. e.g. some USB NICs don't initialise before they need to be used at boot time. I have an old fix for that (not sure if it's optimal). So, amongst other things, we need to know if the problem is random or only happens immediately after boot.
I found out I think. I have 2 ethernet ports, one USB one is actual PCI ethernet. So if I plug something to the PCI, default route is lost.
 
Back
Top