LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Ethernet cable does not connect internet. (https://www.linuxquestions.org/questions/linux-newbie-8/ethernet-cable-does-not-connect-internet-4175615006/)

bmohanraj91 10-04-2017 01:50 AM

Ethernet cable does not connect internet.
 
Hi,

Expected: Want to connect to internet using Ethernet cable.

Observed:
Unable to connect to internet using Ethernet connection. I am new to linux, below I have mentioned few configuration details.

ifcongif -a
docker0 Link encap:Ethernet HWaddr 02:42:cd:46:e3:2b
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

enp0s26u1u2 Link encap:Ethernet HWaddr 02:06:57:00:39:36
inet addr:192.168.42.150 Bcast:192.168.42.255 Mask:255.255.255.0
inet6 addr: 2405:204:738a:23e1:7d3f:6a02:f893:4af7/64 Scope:Global
inet6 addr: 2405:204:738a:23e1:3cc7:85b1:125b:e7b2/64 Scope:Global
inet6 addr: fe80::165b:c9f7:a4db:c53d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1951 errors:0 dropped:0 overruns:0 frame:0
TX packets:2066 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1061262 (1.0 MB) TX bytes:382706 (382.7 KB)

enp4s0f2 Link encap:Ethernet HWaddr 08:9e:01:96:60:cc
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:342 errors:1 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:62060 (62.0 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:82421 errors:0 dropped:0 overruns:0 frame:0
TX packets:82421 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:4555644 (4.5 MB) TX bytes:4555644 (4.5 MB)

virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

virbr0-nic Link encap:Ethernet HWaddr 52:54:00:6e:9a:ad
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

sudo nano /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

other details:
OS: Linux Peppermint 7
My computer does not have any WiFi adapter attached, so basically I connect my system through USB tethering from my phone. Now I want to use Ethernet connection.

Thanks,
Mohan

jsbjsb001 10-04-2017 02:03 AM

It looks like you are not getting a gateway with your first network connection (docker0).

What are you plugging your ethernet into on the other end? (eg. a router)

Which ethernet interface are you using to try and get a connection?

Are you trying to use a virtual machine for Internet browsing?

bmohanraj91 10-04-2017 02:33 AM

Other End is router only

I am not sure about the name of my ethernet interface, but might be this enp4s0f2 or I dont know.

I have been using docker container for the GNS3 app for network simulation but no VM installed separately.

Quote:

Originally Posted by jsbjsb001 (Post 5766020)
It looks like you are not getting a gateway with your first network connection (docker0).

What are you plugging your ethernet into on the other end? (eg. a router)

Which ethernet interface are you using to try and get a connection?

Are you trying to use a virtual machine for Internet browsing?


jsbjsb001 10-04-2017 03:13 AM

What does the output of the following commands tell you? (post the output, using CODE tags)

Code:

ping 8.8.8.8
Also,

Code:

ping google.com
If your not sure how to use CODE tags, look at: https://www.linuxquestions.org/quest...do=bbcode#code

bmohanraj91 10-04-2017 04:00 AM

ping google.com
ping: unknown host google.com

ping 8.8.8.8
connect: Network is unreachable

jsbjsb001 10-04-2017 04:05 AM

Quote:

Originally Posted by bmohanraj91 (Post 5766062)
ping google.com
ping: unknown host google.com

ping 8.8.8.8
connect: Network is unreachable

It looks like there's a problem with your gateway and/or your router.

bmohanraj91 10-04-2017 04:07 AM

Router working fine as I connected this ethernet cable with another windows machine, network working fine. In my linux system only its not connecting, ant fix would be helpful.

jsbjsb001 10-04-2017 04:11 AM

Quote:

Originally Posted by bmohanraj91 (Post 5766068)
Router working fine as I connected this ethernet cable with another windows machine, network working fine. In my linux system only its not connecting, ant fix would be helpful.

Are you plugging in both your ethernet cables to your router and Linux machine?

Edit:

If you are, this could cause problems.

bmohanraj91 10-04-2017 04:31 AM

Yes, I have plugged one side to router and other to the linux machine. In my linux machine the network icon loading and not connecting .

jsbjsb001 10-04-2017 04:54 AM

Quote:

Originally Posted by bmohanraj91 (Post 5766081)
Yes, I have plugged one side to router and other to the linux machine. In my linux machine the network icon loading and not connecting .

No, I meant; are you plugging two different ethernet cables into both your ethernet ports on your PC and into two different ports on the same router?

Shadow_7 10-04-2017 05:28 AM

There's many aspects to having a connection. The physical part you've covered with the cable (assuming that it's plugged in). The driver for the ethernet device likely exists and works under linux. Then you need an IP assigned and a ROUTE. DHCP can do most of this for you. Along with DNS entries to translate names to IPs (the /etc/resolv.conf file), also filled out with DHCP.

# dhclient -4 -v enp4s0f2

# ping -c 2 8.8.8.8

# ping -c 2 google.com

$ ip addr show
$ ip link show
$ ip route show

# netstat -r
# route -n

And various other ways, some deprecated, to get the deets on your setup. But throw in virtualization and docker and the methods get "different".

bmohanraj91 10-04-2017 07:19 AM

Quote:

Originally Posted by jsbjsb001 (Post 5766084)
No, I meant; are you plugging two different ethernet cables into both your ethernet ports on your PC and into two different ports on the same router?

My machine has only one ethernet port and I have connected my machine with router with one cable only.

jsbjsb001 10-04-2017 08:36 AM

Quote:

Originally Posted by bmohanraj91 (Post 5766111)
My machine has only one ethernet port and I have connected my machine with router with one cable only.

Your initial output states two ethernet interfaces. (being enp0s26u1u2 and enp4s0f2)

Are you sure your PC has only one ethernet card?

Can you post the model and brand of your PC?

bmohanraj91 10-04-2017 09:50 AM

Quote:

Originally Posted by jsbjsb001 (Post 5766126)
Your initial output states two ethernet interfaces. (being enp0s26u1u2 and enp4s0f2)

Are you sure your PC has only one ethernet card?

Can you post the model and brand of your PC?

Acer Aspire E1 series, but dont know the model name, the sticker has faded out.
I basically use USB tethering for internet connection as my laptop dont have WiFi adapter. Was it because of that another ethernet interface shows.

JJJCR 10-05-2017 02:07 AM

Have you tried this:

Linux renew ip command

The -r flag explicitly releases the current lease, and once the lease has been released, the client exits. For example, open terminal and type the command:
$ sudo dhclient -r

Now obtain fresh IP:
$ sudo dhclient

Above text from this link: https://www.cyberciti.biz/faq/howto-...nt-ip-address/


All times are GMT -5. The time now is 03:04 PM.