View previous topic :: View next topic |
Author |
Message |
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Fri Dec 09, 2011 4:39 pm Post subject: Cannot connect via ethernet |
|
|
I have been using Linux for a few years, but felt the need for a new challenge. I decided to attempt to install Gentoo, but have fallen at the first fence. I cannot get an internet connection. On my working machine ifconfig eth0 produces the following:
$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:21:97:A2:DD:20
inet addr:192.168.1.65 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::221:97ff:fea2:dd20/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:39681411 errors:0 dropped:156 overruns:0 frame:0
TX packets:42342073 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3950898522 (3767.8 Mb) TX bytes:562407232 (536.3 Mb)
Interrupt:43
but on the machine onto which I am trying to install Gentoo I get this:
$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:01:6c:1a:2c:f3
inet addr:192.168.1.65 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::201:6cff:fe1a:2cf3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:156 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)
Interrupt:16 Base address:0xe000
Both computers are running via ethernet to the router. I have tried swapping cables and sockets to ensure that everything works. Have followed the handbook and tried each and every method of connecting to the network, but to no avail.
Any help would be gratefully received. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Dec 09, 2011 4:53 pm Post subject: |
|
|
Without clue except a "doesn't work" i'll gave you the two 99.99% top answers
Try that for network unreachable
Code: | route add default gw routerip |
Easy guess routerip should be a 192.168.1.x with x not = 255 and x not = 65, and as this is common default propably 192.168.1.1
And that one if you get the unknow google.com answer
echo "nameserver 8.8.8.8" >> /etc/resolv.conf |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Fri Dec 09, 2011 4:53 pm Post subject: |
|
|
It looks like you have an ip address, but there are no tx/rx packets. Have you run `/etc/init.d/net.eth0 restart` and/or added net.eth0 to your default run level?
Are you using a static ip, or dhcp?
Actually, can you post your /etc/conf.d/net? That will clear up questions about your configuration... |
|
Back to top |
|
|
py-ro Veteran
Joined: 24 Sep 2002 Posts: 1734 Location: Velbert
|
Posted: Fri Dec 09, 2011 5:19 pm Post subject: |
|
|
Booth machines have the same IP? That won't work.
Which way have you configured your interface?
Py |
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Fri Dec 09, 2011 5:22 pm Post subject: |
|
|
Quote: | route add default gw routerip | produces routerip: Unknown host
Quote: | /etc/init.d/net.eth0 restart | produces -bash: /etc/init.d/net.eth0: No such file or directory
configuration is dhcp |
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Fri Dec 09, 2011 5:26 pm Post subject: |
|
|
Quote: | Booth machines have the same IP? That won't work. |
How do I find what IP to submit for the Gentoo machine?
Sorry, I don't know what you're asking re configuring interface |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Dec 09, 2011 7:48 pm Post subject: |
|
|
csaenemy wrote: | Quote: | route add default gw routerip | produces routerip: Unknown host
Quote: | /etc/init.d/net.eth0 restart | produces -bash: /etc/init.d/net.eth0: No such file or directory
configuration is dhcp |
oh boy, you were suppose to replace the *routerip* (read it as Router IP, the IP of your router) with its address, something like 192.168.1.1
Let's retry, type that (yeah this time, nothing to change, just type it as it is)
Code: | ifconfig eth0 192.168.0.44
route add default gw 192.168.1.1
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
dmesg | grep eth
route -n
ping -c1 google.com
|
|
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Fri Dec 09, 2011 7:48 pm Post subject: |
|
|
csaenemy wrote: | Quote: | route add default gw routerip | produces routerip: Unknown host | That's because you need to enter your router's ip address for "routerip"
Although, don't worry about that. You only need to specify your gateway, nameservers, etc. when you are using a static ip. If your configuration is dhcp, you don't need to add anything to your /etc/conf.d/net, but you will need to create your eth0 init script.
Code: | ln -s /etc/init.dnet.lo /etc/init.d/net.eth0
/etc/init.d/net.eth0 start
rc-update add net.eth0 default |
More info in in the Gentoo Handbook here (look for the "Configuring your Network" section):
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8 |
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Sat Dec 10, 2011 6:48 pm Post subject: |
|
|
In response to krinn's suggestion:
After I typed the line Code: | route add default gw 192.168.1.1 |
I got the message Quote: | SIOCADDRT: Network is unreachable |
Code: | echo "nameserver 8.8.8.8" >> /etc/resolv.conf
dmesg | grep eth |
Quote: | jme: JMicron JMC2XX ethernet driver version 1.0.8
8139too 0000:02:03.0: eth0: RealTek RTL8139 at 0xf9bc6000, 00:01:6c:1a:2c:f3, IRQ 16
8139too 0000:02:03.0: eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
eth0: no IPv6 routers present
NETDEV WATCHDOG: eth0 (8139too): transmit queue 0 timed out
8139 too 0000:02:03.0: eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
8139 too 0000:02:03.0: eth0: link up, 100Mbps, full-duplex, lpa 0x41E1 |
Quote: | Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
|
Code: | ping -c1 google.com |
Quote: | ping: unknown host google.com
|
In response to mikegpitt:
Typing Code: | ln -s /etc/init.dnet.lo /etc/init.d/net.eth0
/etc/init.d/net.eth0 start |
gave me Quote: | -bash: /etc/init.d/net.eth0: No such file or directory |
and then Code: | rc-update add net.eth0 default |
gave Quote: | rc-update:service `net.eth0` does not exist | [/quote] |
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Sat Dec 10, 2011 7:47 pm Post subject: |
|
|
I have done
now when I do I get:
Quote: | eth0 Link encap:Ethernet HWaddr 00:01:6c:1a:2c:f3
inet addr:192.168.1.44 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::201:6cff:fe1a:2cf3/64 Scope:Link
UP BROADCAST RUNNING 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)
Interrupt:16 Base address:0xe000 |
so no improvement |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Sat Dec 10, 2011 8:15 pm Post subject: |
|
|
csaenemy,
Code: | eth0 Link encap:Ethernet HWaddr 00:01:6c:1a:2c:f3
inet addr:192.168.1.44 Bcast:192.168.1.255 Mask:255.255.255.0 | looks pretty normal.
Your earlier route -n output showed you were missin a defualt route, so you should be able to ping your router or the other machine at 192.168.1.65 but thats as far as it gets.
This suggests that your dhcp server is not set up properly as its not supplying a defualt route.
Your defualt route points to the net hop towrds the internet. Thats your router.
To use names rather than IP addresses you will also need a nameserver in /etc/resolv.conf _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Sat Dec 10, 2011 9:09 pm Post subject: |
|
|
Quote: | Your earlier route -n output showed you were missin a defualt route, so you should be able to ping your router or the other machine at 192.168.1.65 but thats as far as it gets. |
I tried that and get Code: | connect: Network is unreachable |
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Sat Dec 10, 2011 9:52 pm Post subject: |
|
|
csaenemy,
Boot the liveCD, run and show us the content of /etc/resolv.conf
and the output of route, ifconfig -a and lspci -k
Thats one file and three commands.
Does yur network work now ? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Sat Dec 10, 2011 11:04 pm Post subject: |
|
|
/etc/resolv.conf
Code: | #Generated by dhcpcd
#/etc/resolv.conf.head can replace this line
#/etc/resolv.conf.tail can replace this line
|
route
Code: | Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
loopback livecd.gentoo 255.0.0.0 UG 0 0 0 lo
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
|
ifconfig -a
Code: | eth0 Link encap:Ethernet HWaddr 00:01:6c:1a:2c:f3
inet addr:192.168.0.44 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::201:6cff:fe1a:2cf3/64 Scope:Link
UP BROADCAST RUNNING 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)
Interrupt:16 Base address:0xe000
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:16436 Metric:1
RX packets:326 errors:0 dropped:0 overruns:0 frame:0
TX packets:326 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6132 (5.9 KiB) TX bytes:6132 (5.9 KiB)
|
the output of lspci -k would take me ages to type out (obviously I can't copy and paste as this is coming from another pc). Is there a particular part that you need to see? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Sun Dec 11, 2011 6:42 pm Post subject: |
|
|
csaenemy,
Your dhcp server is broken, or not set up properly.
It gives you a sensible IP address but no nameserver and no default route.
No naameserver means you cannot use the internet by site names, like http://www.gentoo.org
No default route means you can only get to PCs on your subnet, thats 192.168.0.0/24
I wanted to see all of your Ethernet or Wireless interfaces listed in lspci -k together with the kernel modules in use.
I have a suspicion that you have several ethernet interfaces and have your cable plugged into one while the kernel tries to use another. The ethX names are not fixed to particular hardware ports. They can and do move around.
ifconfig -a suggests this is not the case but it won't show interfaces that have no driver loaded. lspci shows all interfaces thats have a AGP/PCI/PCIe signature.
/etc/resolv.conf should contain a line like
thats a public nameserver, so that entry would work until your dhcp lease expires, then it will be overwritten with nothing again.
On your working PC, look at the output of the route command. You need to duplicate its default entry on your Gentoo.
If its running windows, its a little harder.
You need to run cmd.exe then in the DOS box, run route print. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Mon Dec 12, 2011 4:38 am Post subject: |
|
|
csaenemy wrote: | In response to mikegpitt:
Typing Code: | ln -s /etc/init.dnet.lo /etc/init.d/net.eth0
/etc/init.d/net.eth0 start |
| Sorry... I had a typo in my above... it should read the same as in the Gentoo handbook:
Code: | ln -s /etc/init.d/net.lo /etc/init.d/net.eth0 |
|
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Mon Dec 12, 2011 9:17 am Post subject: |
|
|
NeddySeagoon
there is only one Ethernet interface and no wireless.
Ethernet controller: Realtek Semiconductor Co. Ltd. RTL-8139/8139c/8139C+ (rev 10)
Subsystem:Foxconn International, Inc. Device 0c77
Kernel driver in use: 8139too
Kernel modules: 8139too, 8139cp
I installed an old Pardus Linux onto the computer that I am trying to use Gentoo
There are a couple of nameservers listed there, but it still will not connect, even though the GUI indicates that it is connected.
Do you think I need to buy a new ethernet card? Would this help, and if I did would it become eth1?
The output of route on my working pc gives a default route:
bebox.config 0.0.0.0 UG 0 0 0 eth0
I don't know how I would add a default route to the other machine. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Mon Dec 12, 2011 7:59 pm Post subject: |
|
|
csaenemy,
As you have a IP address using dhcpcd, its unlikely there is anything wrong with your networks card.
If you were to add an ethernet card, yes, it would become eth1, but lets not go there yet.
The defualt route of the other machine is Code: | bebox.config 0.0.0.0 UG 0 0 0 eth0 | however beboc.config should be the name of your gateway.
To copy this route to your gentoo, you need its IP addess. will show that. For example I get Code: | $ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default router 0.0.0.0 UG 3 0 0 eth0
loopback localhost.local 255.0.0.0 UG 0 0 0 lo
192.168.100.0 * 255.255.255.0 U 0 0 0 eth0 | Not a very novel naime for my router and Code: | $ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.100.253 0.0.0.0 UG 3 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 | which shows my defuaklt route is via 192.168.100.253. You will probably have different numbers.
Code: | route add default gw 192.168.100.253 | addes the required default route. You need to swap 192.168.100.253 for the IP you get for your defualt route from your working machine. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Mon Dec 12, 2011 9:01 pm Post subject: |
|
|
I'm confused why the default route isn't being added by default when the ip address is fetched by dhcp...
Shouldn't the net.eth0 init script take care of everything? That is, assuming that there isn't a conflicting configuration in the /etc/conf.d/net.
Really, I've never really seen a problem with a machine that has an empty /etc/conf.d/net, and starting the service with the init script. The one exception was a machine I had years ago, where the kernel driver wouldn't fetch an ip address for the card, even though the card was detected by the system... this was fixed in a later kernel update. |
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Tue Dec 13, 2011 8:41 am Post subject: |
|
|
NeddySeagoon
OK, this is from working machine
Code: | chris@pardus2011 ~ $ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 1 0 0 eth0
loopback pardus2011 255.0.0.0 UG 0 0 0 lo
default bebox.config 0.0.0.0 UG 0 0 0 eth0
chris@pardus2011 ~ $ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 eth0
|
This is from Gentoo machine
Code: | route add default gw 192.168.1.254
SIOCADDRT: Network is unreachable
|
|
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Tue Dec 13, 2011 11:52 am Post subject: |
|
|
The output when I type Code: | dmesg | grep eth | less | immediately after booting from live cd
Code: | jme: JMicron JMC2XX ehternet driver version 1.0.8
8139too 0000:02:03.0: eth0: RealTek RTL8139 at 0xf9bce000, 00:01:6c:1a:2c:f3, IRQ 16
8139too 0000:02:03.0: eth0: link up, 100Mbps, full-duplex, lpa 0x41e1
eth0: No IPv6 routers present
NETDEV WATCHDOG:eth0 (8139too): transmit queue 0 timed out |
on the off chance that there are any clues here. |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Tue Dec 13, 2011 5:55 pm Post subject: |
|
|
csaenemy wrote: |
Code: | jme: JMicron JMC2XX ehternet driver version 1.0.8 |
| This line is interesting... perhaps your machine is loading two ethernet drivers, and it is causing a conflict?
You might want to try this after booting off the cd:
Code: | rmmod jme
rmmod 8139too
modprobe 8139too
/etc/init.d/net.eth0 restart
ping www.google.com
|
If the net.eth0 init script isn't on the live cd, create it:
Code: | ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
/etc/init.d/net.eth0 restart |
|
|
Back to top |
|
|
csaenemy n00b
Joined: 09 Dec 2011 Posts: 33 Location: Northamptonshire, UK
|
Posted: Wed Dec 14, 2011 10:32 am Post subject: |
|
|
Quote: | Code:
jme: JMicron JMC2XX ehternet driver version 1.0.8
This line is interesting... perhaps your machine is loading two ethernet drivers, and it is causing a conflict? |
Nope. there's no jme module in /proc/modules.
I have to admit I'm getting close to giving up on Gentoo , although I feel I'm learning, which is good. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Wed Dec 14, 2011 7:50 pm Post subject: |
|
|
csaenemy,
Your dmesg shows that the JMicron module loaded - even if its not loaded now.
Do Code: | modprobe -r 8139too
modprobe 8139too | to be sure it did not interfere with your correct Ethernet module.
Now restart net.eth0
Any luck ? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Wed Dec 14, 2011 8:32 pm Post subject: |
|
|
Could be my fault i'm sorry, made a mistake there, not about the gateway because i've guess a default gw ip, but when settings your IP range outside your network range.
So if you still configure it as i said
krinn wrote: |
Let's retry, type that (yeah this time, nothing to change, just type it as it is)
Code: | ifconfig eth0 192.168.0.44
route add default gw 192.168.1.1
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
dmesg | grep eth
route -n
ping -c1 google.com
|
|
redo with that instead (notice the switch from the faulty 192.168.0.44 to 192.168.1.44 and the good gw IP now)
Code: | ifconfig eth0 192.168.1.44
route add default gw 192.168.1.254
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
route -n
ping -c1 google.com
|
csaenemy wrote: | I have been using Linux for a few years, but felt the need for a new challenge |
csaenemy wrote: | I have to admit I'm getting close to giving up on Gentoo , although I feel I'm learning, which is good. |
Your challenge level is quiet low |
|
Back to top |
|
|
|