TransWikia.com

ip is assigned, local netowrk works but the external network is unreachable

Unix & Linux Asked by Arghavan Mohammadhassani on November 9, 2021

I am using mint18.3 on my system which is based on ubuntu 16.04. The system is connected to the internet via an ethernet cable. The cable is attached and works but the connection is detected 1 month ago. The problem is that when I attempt to connect to any websites other than the local ones, it fails. ping 8.8.8.8 and ping www.google.com give connect: network unreachable error. The following is the result of the ifconfig command:

enp4s0    inet addr: 192.168.197.18 Bcast: 192.168.207.255 Mask: 255.255.240.0
lo        inet addr: 127.0.0.1 Mask: 255.0.0.0

Contents of the /etc/resolv.conf and /etc/network/interfaces are reported in the following:

/etc/resolv.conf

nameserver 81.31.160.34
search sharif.ir

/etc/network/interfaces

auto lo
iface lo inet loopback

auto enp4s0
allow-hotplug enp4s0
iface enp4s0 inet dhcp

Also, I checked the routing table with the command ip route show. It reported multiple routes as in the below. I am new to network issues and I cannot understand them well.

81.31.160.0/19 via 192.168.192.1 dev enp4s0
169.254.0.0/16 dev enps4s0 scope link metric 1000
172.16.0.0/12 via 192.168.192.1 dev enp4s0
192.168.192.0/20 dev enp4s0 proto kernel scope link src 192.168.197.18
213.233.160.0/19 via 192.168.192.1 dev enp4s0

How can I solve the connection issue?

One Answer

The output of ip route does not show any default route to access networks beyond the few explicitly listed networks. If the machine at 192.168.192.1 provides full internet connectivity, you'd want to add it as your default route by executing (sudo)

ip route add default via 192.168.192.1 dev enp4s0

after which ip route should show this as the first entry in the output, and you should be able to access any machines which can be reached from this gateway.

Answered by user4556274 on November 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP