0

I am using Ubuntu 23.10 and an ethernet connection to my router. However, sometimes during the day, my Internet connection gets "lost" for periods that can reach 1 hour sometimes. I can still access the router admin page, but no any other page on the Internet. The Ethernet icon in my system is still as it is (displaying "Connected"), but I don't really have access to the Internet.

It usually happens every morning at 8:30 AM. Sometimes it happens in the afternoon at 1 PM, and sometimes at 8-10 PM as well.

I have checked with my other devices when this happens, and they can access the Internet just fine. So this is not an issue in my router, but perhaps, my Linux/computer. My ability to access the router admin page proves it is not a physical link issue.

How can I debug such a problem when it happens? I don't even know where to start looking.

user$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 04:(redacted_for_privacy):42:8a brd ff:ff:ff:ff:ff:ff

Another command:

user$ dig google.com

; <<>> DiG 9.18.18-0ubuntu2.1-Ubuntu <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 440
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.            IN  A

;; ANSWER SECTION:
google.com.     243 IN  A   216.58.212.46

;; Query time: 14 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Thu Feb 22 21:30:10 +03 2024
;; MSG SIZE  rcvd: 55

This is ip add output:

myusername$ ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 04:(redacted_for_privacy):8a brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.55/24 brd 192.168.1.255 scope global noprefixroute enp8s0
       valid_lft forever preferred_lft forever
2
  • What does the Router Connection page you can get to show as a WAN IP address when the connection fails? Also your hosts file should contain your LAN IP Address Commented Feb 22, 2024 at 22:52
  • @eyoung100 my router still shows that an IP address was assigned to me correctly. My hosts file contain only this: 127.0.0.1 localhost 127.0.1.1 myhostname Commented Feb 23, 2024 at 5:23

1 Answer 1

1

Loopback Address

See: What is the use of a loopback address in IPv4?

A loopback address or 'localhost' is an IPv4 address that is reserved for something called a 'loopback'. For loopback, IP addresses ranging from 127.0. 0.0 to 127.255. 255.255. (i.e. from 0-255). Class A network number 127 is assigned the “loopback” function.

This means that a data set sent by a higher-level protocol to a network 127 address should be taken back to the host. A data set sent to a network 127 address should never show up on any network. It is the host's address and is both run by and within the operating system or OS. You can find a loopback address on devices, networks, and even routers. The reason people need a loopback IP is that even without having a physical network in place, it gives a dependable way to evaluate the functionality of the Ethernet drivers and software.

With the above quote in mind, remember that by putting your Router in the mix you have now moved one level above the Loopback Address. Your Hosts file, needs to be updated to reflect that like so. I've now commented out the loopback addresses because your Private IP Address is now serving in the loopback address's place (See Also - RFC1918):

# /etc/hosts
## Distribution Specific Comments Here
## IPv4 Section Goes Below

192.168.1.55    myhostname.mydomainnameorISP.com    myhostname    localhost

## Ubuntu's Entries (IPv4)
# 127.0.1.1    myhostname
# 127.0.0.1    localhost

## IPv6 Section
# Only fill in if you need IPv6.  You may need to convert your IPv4
# entries using one of the many online conversion tools


## This excerpt taken from RFC 1918-Section 3-Private Address Spaces
## The Internet Assigned Numbers Authority (IANA) has reserved the
## following three blocks of the IP address space for private internets:

##     10.0.0.0        -   10.255.255.255  (10/8 prefix)
##     172.16.0.0      -   172.31.255.255  (172.16/12 prefix)
##     192.168.0.0     -   192.168.255.255 (192.168/16 prefix)
## -- EOF --

The above hosts assignment assumes your router's DHCP server is assigning class C addresses. If not Please adjust. While in your router find the section for MAC Address Filtering. Assign your Redacted MAC address to the address now in the hosts file, and make sure the Accepted box is selected(Selecting Deny will lock you out, so be cautious/verify the setting before applying it). This ensures the DHCP server always assigns you the same IP address so that the hosts file only needs one modification. The lo interface at 127.0.0.1 is still usable but only serves as the transport method for data between the Private IP address in the hosts file, and the machine itself.

Need Clarification

  1. Did your ISP give you a modem/router combo?
  2. Are you using your own Router in spite of the combo?
  3. If #2 is True, have you bridged the ISP's device?
  4. Optional: Describe your network, i.e., Outside --> ISP Modem --> etc

Answer via comment here, or Edit your question above and we'll continue.

5
  • Thank you for the help. I applied the changes you said and I will see if the problem happens again and will report accordingly. I use the same router given by my ISP, they are the ones who set it up (not me). I don't use a bridge. My ISP is TTNET of Turkey, so the hostnames assigned by it are in the form of xx.xxx.x.xx.dynamic.ttnet.com.trwhere the first part is a random IP assigned for me on each router restart (random IP, not static). I still wrote in that line you gave me: myhostname.dynamic.ttnet.com.tr cause I can't have a fixed IP, but I don't know if that actually works or not. Commented Feb 23, 2024 at 19:10
  • Is the IP of your computer in one of the classes described in RFC1918. The one showin in your router status that you commented with is the WAN IP address. We need the LAN IP adresss? What does ip add report? Commented Feb 23, 2024 at 20:01
  • I don't know what's that, but I have added the output of ip add command to the post. Commented Feb 24, 2024 at 4:36
  • Apparently, the issue is gone so far. I'll accept this answer. Thank you for the help! Commented Feb 24, 2024 at 16:38
  • 1
    I've added your actual private IP. Copy this as your hosts file and assign 192.168.1.55 as a static IP to your machine and disable DHCP since MAC filtering would be a bit tough Commented Feb 25, 2024 at 2:09

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.