You are not logged in.

#1 2018-04-23 15:46:10

copper
Member
Registered: 2018-04-17
Posts: 6

Wired connection fails when I power-on my pc

Hi:

When I power-on my computer (desktop) every morning, it is trying to connect to the network for several minutes (wired connection). So I must unplug the modem to plug it again... after that my computer gets connected to the network and I can use internet. This only happens when I power-on the computer by the first time every day.

The connection settings say this:

https://orig00.deviantart.net/3ecd/f/20 … c9mnem.png

And when I check /etc/network/interfaces it shows this:

auto lo
iface lo inet loopback

If I add this:

auto eth0
iface eth0 inet dhcp

then I can't connect to internet.

What another thing should I check?

Thanks

Last edited by Head_on_a_Stick (2018-04-24 18:10:27)

Offline

#2 2018-04-23 17:33:51

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Wired connection fails when I power-on my pc

copper wrote:

If I add this:

auto eth0
iface eth0 inet dhcp

then I can't connect to internet.

Is the interface actually called eth0?

List all interfaces with

ip link

If you use this method it will stop NetworkManager (the connection icon in the systray) from managing the connection and you will have to use the command line instead, is that what you want?

NetworkManager is usually very reliable (albeit entirely unnecessary with a wired connection) so we should probably investigate why it's failing.

You can check the journal for the current boot:

sudo journalctl -xe

What is your hardware and drivers?

lspci -knn | grep -iA2 net

There are several types of cards that just don't work very well with GNU/Linux, unfortunately.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2018-04-24 13:07:47

copper
Member
Registered: 2018-04-17
Posts: 6

Re: Wired connection fails when I power-on my pc

Hi:

Head_on_a_Stick wrote:

Is the interface actually called eth0?

List all interfaces with

ip link

Yes, ip link shows "lo" and "eth0"

If you use this method it will stop NetworkManager (the connection icon in the systray) from managing the connection and you will have to use the command line instead, is that what you want?

NetworkManager is usually very reliable (albeit entirely unnecessary with a wired connection) so we should probably investigate why it's failing.

I just realised that about NetworkManaging.

You can check the journal for the current boot:

sudo journalctl -xe

That command shows this:

abr 24 09:49:43 debian systemd[1]: Time has been changed
-- Subject: Time change
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The system clock has been changed to REALTIME microseconds after January 1st, 1970.
abr 24 09:49:43 debian systemd[591]: Time has been changed
-- Subject: Time change
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The system clock has been changed to REALTIME microseconds after January 1st, 1970.
abr 24 09:50:25 debian sudo[1230]: copper : TTY=pts/0 ; PWD=/home/copper ; USER=root ; COMMAND=/usr/bin/nano /etc/network/interfaces
abr 24 09:50:25 debian sudo[1230]: pam_unix(sudo:session): session opened for user root by copper(uid=0)
abr 24 09:50:34 debian sudo[1230]: pam_unix(sudo:session): session closed for user root
abr 24 09:54:49 debian sudo[1342]: copper : TTY=pts/0 ; PWD=/home/copper ; USER=root ; COMMAND=/bin/journalctl -xe
abr 24 09:54:49 debian sudo[1342]: pam_unix(sudo:session): session opened for user root by copper(uid=0)

What is your hardware and drivers?

lspci -knn | grep -iA2 net

There are several types of cards that just don't work very well with GNU/Linux, unfortunately.

00:04.0 Ethernet controller [0200]: Silicon Integrated Systems [SiS] 190 Ethernet Adapter [1039:0190]
	Subsystem: Silicon Integrated Systems [SiS] Device [1039:0191]
	Kernel driver in use: sis190

My computer is a bit old

And I just realised that I don't need unplug the modem... if I do /etc/init.d/networking restart so I can recover the connection.

Offline

#4 2018-04-24 18:09:48

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Wired connection fails when I power-on my pc

copper wrote:

You can check the journal for the current boot:

sudo journalctl -xe

That command shows this:

There should be more output than that, you can use the arrow keys to scroll around or

sudo journalctl -xe --no-pager

“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#5 2018-04-24 18:12:13

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,238

Re: Wired connection fails when I power-on my pc

You should check journalctl -u NetworkManager since it's probably the garbage built-in DHCP client which fails to get/renew the lease. I've had the same problem with several routers. The solution was to install dhclient and configure in /etc/NetworkManager/conf.d/dhcp-client.conf

[main]
dhcp=dhclient

then reboot or restart the service. Symptomatic for my problems were

1. ip link → network interface was UP but

2. ip addr → no network address

3. journalctl -u NetworkManager showed DHCP timeouts.

Check by just executing sudo dhclient $interface when you reproduce the problem.


Im grünen Wald, dort wo die Drossel singt…

Offline

#6 2018-04-24 23:17:05

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 544

Re: Wired connection fails when I power-on my pc

There's times where dhclient just dies for some reason and thus losing the connection. Can you simply reconnect with sudo dhclient $interface where interface is what you using to connect?


Real Men Use Linux

Offline

#7 2018-04-25 06:02:39

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Wired connection fails when I power-on my pc

Or ditch dhcp entirely and assign static IPs.

# /etc/network/interfaces

auto eth0
iface etho inet static
    address $address
    netmask $netmask
    gateway $gateway

Replace $address with the desired IP address (run `ip r` to see the address being used currently), $netmask with the netmask (probably 255.255.255.0, or add the CIDR after the address) and $gateway with the IP address of your router.

Last edited by Head_on_a_Stick (2018-04-25 06:06:38)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#8 2018-04-25 13:30:37

earlybird
ほやほや
Registered: 2015-12-16
Posts: 608
Website

Re: Wired connection fails when I power-on my pc

DeepDayze wrote:

There's times where dhclient just dies for some reason and thus losing the connection. Can you simply reconnect with sudo dhclient $interface where interface is what you using to connect?

It shouldn't die but daemonize (fork to background).

The best way to call dhclient again – IF you want to do it manually and without e.g. network-manager's supervision – you should do

dhclient -r ; dhclient ${interface}

in order to first release the DHCP lease and then get a new one. dhclient -d will force dhclient to stay in the foreground, if that's what you want.

Offline

#9 2018-04-25 14:31:41

copper
Member
Registered: 2018-04-17
Posts: 6

Re: Wired connection fails when I power-on my pc

Hi:

Thank you all for the answers. I am not sure but it seems NTP was generating some type of conflict. So I disabled NTP and setted date and time manually... and this morning my PC didn't have problems connecting to the net. I'll check it again tomorrow.

Edited: I was right... the problem with the wired connection is gone after diabling NTP.

Last edited by copper (2018-04-26 12:28:07)

Offline

Board footer

Powered by FluxBB