Can anybody tell me what do the numbers stored in that file mean? As of late, it takes 2-3 minutes for internet connection to be established after the boot has been completed and I want to find out why.
Can anybody tell me what do the numbers stored in that file mean? As of late, it takes 2-3 minutes for internet connection to be established after the boot has been completed and I want to find out why.
From my observations, there are two files that have meaning there in
/sys/class/net/eth0/
together. The first one beingcarrier
and the second beingcarrier_changes
. These files have nothing to do with your internet taking 2-3 minutes to connect.From my testing it looks as though when you unplug a cable from your eth0 port, the
carrier
file shows a0
and thecarrier_changes
increases by one. Plugging the cable back in changedcarrier
to1
stating it has connection, andcarrier_changes
increase by a count of one again. Example below:Starting with cable connected:
Removed cable:
Reconnected cable:
So, as it looks,
carrier_changes
keeps track of how many times the cable is removed and connected with the system up or a possible network change has been performed.Other possible reasons or solutions to why you might have slow connecting times:
Cable / connectors on cable might be bad. Try another cable to router.
Another thing you can possibly look at is how long it takes for your
eth0
to actually get an IP address. Maybe perform awatch
command onifconfig
eg:watch -n 5 'ifconfig eth0'
Maybe look at how long your router has DHCP leases set for. Maybe you're low on IP addresses in your scope on your router and it is waiting until another is free.
Maybe try a power reset on your system by removing all power from the system then pressing the power button a few times to drain all remaining power from the system. Then plug it back in and power it on.
Hope this helps!
This can also happen if you connect two gigabit ethernet interfaces with a Cat5 ethernet cable (gigabit connection needs Cat6 cables).
You can test disabling the auto-negotiation and fixing the connection to fast ethernet:
In order to make this permanent over reboot, the way changes depending on the Linux distribution you're using, have a look here, here and here.