LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-04-2017, 01:50 AM   #1
bmohanraj91
LQ Newbie
 
Registered: Apr 2017
Posts: 14

Rep: Reputation: Disabled
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
 
Old 10-04-2017, 02:03 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
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?

Last edited by jsbjsb001; 10-04-2017 at 02:07 AM. Reason: typo/added question
 
1 members found this post helpful.
Old 10-04-2017, 02:33 AM   #3
bmohanraj91
LQ Newbie
 
Registered: Apr 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
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 View Post
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?
 
Old 10-04-2017, 03:13 AM   #4
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
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
 
Old 10-04-2017, 04:00 AM   #5
bmohanraj91
LQ Newbie
 
Registered: Apr 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
ping google.com
ping: unknown host google.com

ping 8.8.8.8
connect: Network is unreachable
 
Old 10-04-2017, 04:05 AM   #6
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by bmohanraj91 View Post
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.
 
Old 10-04-2017, 04:07 AM   #7
bmohanraj91
LQ Newbie
 
Registered: Apr 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
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.
 
Old 10-04-2017, 04:11 AM   #8
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by bmohanraj91 View Post
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.

Last edited by jsbjsb001; 10-04-2017 at 04:24 AM. Reason: added comment
 
1 members found this post helpful.
Old 10-04-2017, 04:31 AM   #9
bmohanraj91
LQ Newbie
 
Registered: Apr 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
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 .
 
Old 10-04-2017, 04:54 AM   #10
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by bmohanraj91 View Post
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?
 
Old 10-04-2017, 05:28 AM   #11
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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".
 
Old 10-04-2017, 07:19 AM   #12
bmohanraj91
LQ Newbie
 
Registered: Apr 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
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.
 
Old 10-04-2017, 08:36 AM   #13
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by bmohanraj91 View Post
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?
 
Old 10-04-2017, 09:50 AM   #14
bmohanraj91
LQ Newbie
 
Registered: Apr 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
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.
 
Old 10-05-2017, 02:07 AM   #15
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,162

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
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/
 
  


Reply

Tags
ethernet, network connectivity



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to share Internet Access through ethernet cable prompt32 Linux - Networking 7 11-16-2014 06:33 PM
How to share internet through ethernet cable? ThemePark Linux - Networking 9 09-18-2013 07:10 PM
[SOLVED] Old Pentium II computer connect to internet via a Serial (IOIOI) to Ethernet cable LexMK Linux - Networking 13 11-27-2012 08:30 PM
Can't connect 2 computers through crossover ethernet cable silencestone Linux - Networking 1 05-28-2008 10:32 AM
can't connect internet via cable modem after activating an ethernet card huseyin Linux - Networking 5 11-02-2003 07:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration