LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 11-21-2005, 01:03 AM   #1
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Rep: Reputation: 15
Internet in Gentoo


So, I have a computer with Windows on one hdd and Gentoo on the other. I had internet working on both at home. But now, I am at school and I cannot get internet working on Gentoo. Windows interenet is fine and the Gentoo installation CD can pick up internet.

Basically, gentoo is able to bring up eth0 (the interface I'm using), but then it runs dhcpcd and hangs for a while before goving up with exit code 14.

If I run /etc/init.d/netmount start (which is where problems occur during boot), after Running dhcpcd..., it gives
ERROR: Problem starting needed services.
"netmount" was not started.

I have tried running the command to see what module the LiveCD was using for internet, but the folder it brought me to was empty.

Since I have had this working before on this same computer (and the LiveCD works), I find it hard to believe that I have a incompatible ethernet card or sokmething like that, so the problem has to be in my configuration.

By the way, my /etc/conf.d/net file looks like:

iface_eth0="dhcp"
dhcpcd_eth0="-N"

Although I have tried many other combinations of commands for this file.

Thanks in advance.

- Ryan McLinko
 
Old 11-21-2005, 01:53 AM   #2
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
You may have forgotten something!

Ryan, what Gentoo versions do you use? (2005.0 or 2005.1)
These are the things you should keep in mind for a working network connection:[list=1][*] Configure your kernel good, include modules for any network card you have on that computer[*] If you have a RTL or Marvel based card use the NEW drivers included in the 2.6 kernels, not the old ones[*] Be sure to load the modules for your needed network devices at boot, they are listed in /etc/modules.autoload/kernel-2.6 for a 2.6 kernel[*] The order in which the modules are listed determines what ethX it is, i.e
Code:
8139too
e100
skge
would make the Realtek RTL based card eth0, the Intel PRO100 eth1, and so on[*] Be sure to have init scripts to bring the interfaces up, they are found in /etc/init.d/ and are in the form net.ethX. Actually they can be symlinks to the net.lo init script, so for every device you have do this
Code:
ln -sf net.lo net.eth0
ln -sf net.eth0 net.eth1
ln -sf net.eth1 net.eth2
And so on, this would build a 'symlink chain', but you can also link every device to net.lo(try the example first )
Here is my current state:
Code:
pauls@theenemy ~ $ ls -lha /etc/init.d/net.*
lrwxrwxrwx  1 root root   6 Nov 20 05:02 /etc/init.d/net.eth0 -> net.lo
lrwxrwxrwx  1 root root   8 Nov 16 17:13 /etc/init.d/net.eth1 -> net.eth0
lrwxrwxrwx  1 root root   8 Nov 16 17:13 /etc/init.d/net.eth2 -> net.eth1
-rwxr-xr-x  1 root root 24K Nov 20 12:33 /etc/init.d/net.lo
[*] Also make sure you have good configs for your DHCP client (I recommend the dhcp package with dhclient) and that it is installed [*] Your /etc/conf.d/net does not look right to me, here's mine:
Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
modules=( "dhclient" )          
modules=( "ifconfig" )          
                                
config_eth0=( "dhcp" )          
#dhcp_eth0="release nodns"      
fallback_eth0=( "85.x.x.x/24" )
fallback_route_eth0=( "default via 85.x.x.x" )
                                
config_eth1=( "noop" "192.168.0.1/24" )
#routes_eth1=( "default via 192.168.1.1" )
#config_eth2=( "noop" "192.168.1.1/24" )
#I don't use eth2 yet so:
config_eth2=( "null" )          
                                
#-----------------------------------------------------------------------------
# TUN/TAP                       
# For TUN/TAP support emerge sys-apps/usermode-utilities
#                               
# NOTE: The interface name must be either tun or tap followed by a number
#config_tun1=( "192.168.0.1/24")
                                
# For passing custom options to tunctl use something like the following.  This
# example sets the owner to adm
#tunctl_tun1="-u adm"
#-----------------------------------------------------------------------------
# Tunnelling
# For GRE tunnels
#iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255"

# For IPIP tunnels
#iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255"

# To configure the interface
#config_vpn0=( "192.168.0.2 pointopoint 192.168.1.2" )          # ifconfig style
#config_vpn0=( "192.168.0.2 peer 192.168.1.1" )                 # iproute2 style
[/list=1]
Don't understand something? Go to the Gentoo Handbook for x386, found on the site and on the install cd under /cdrom/doc
Come back if you need more help!
 
Old 11-24-2005, 12:21 AM   #3
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
I'm using 2005.0

So, I've modified my files just in case to match yours, but to no avail. Is there any way to see what the settings on the liveCD are since I can get internet working on it.
 
Old 11-24-2005, 12:42 AM   #4
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
So, here's my guess:

Since it is able to bring up eth0 successfully, that means that I have drivers set up for the NIC correctly, right?

The fact that it freezes when running dhcpcd seems to mean that I have a problem with the way I have set up dhcp on here.

Are those correct statements?
 
Old 11-24-2005, 01:05 AM   #5
emanresu
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 76

Rep: Reputation: 15
try to leave your /etc/conf.d/net file blank (comment out every single line, that is), and see if it makes a little difference. By default, all eth interfaces are assumed to be dhcp.

also, do a /sbin/ifconfig -a to see how many different eth interfaces you have. When I was installing my laptop, the liveCD recognized eth0 as THE card. But after the installation, I had a hell of a time trying to figure out why the ethernet stopped working anymore, only later to realize that it somehow became eth1, and eth0 was something else.

Last edited by emanresu; 11-24-2005 at 01:06 AM.
 
Old 11-24-2005, 03:28 AM   #6
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
I blanked the /etc/conf.d/net file and no difference. My only devices are eth0, lo, and sit0.
 
Old 11-24-2005, 03:59 AM   #7
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Sorry for the delay...

Hmm, this is what I think:
I had some difficulties at the begining to.
So if my guess is right, the problem is your dhcp client.
Try a different client.
Unfortunattely there was no client that worked perfect for me, from those that Gentoo provide.
One had a problem with releasing leases, one did not find some scripts, etc.
So most of the problems related to the scripts and config I tried to solve myself using the man pages to find their location and the sample files to actually build the configs and scripts(the man pages helped too). For example udhcp had a script in case of no lease can be obtained so I told it to stop eth and bring down the interface.
But one thing is for sure; the light clients are the most problematic. Don't use them, use the fully featured ones. Even if they are harder to set-up, there is probably no reason for them not to work.
Dhclient IIRC requested a dynamic dns update style for it to actually work, so you have to ad a line to the config.
Try to check your logs. Do tail -f /var/log/messages in another console and start the service, then watch what the logs write.
The 'problem starting needed devices' may be because you have an interface set up to run at a runlevel but there is no module or interface for it.
Try rc-update show and see what net.eth* you have set up to run. After that do rc-update del net.eth? that you want to remove from boot. And add the one that should and be sure to have the module for it in modules.autoload.d/kernel-2.6. For example rc-update add net.eth0 default.
If it still does not work then, if you can risk it, run the Live CD and start the ssh daemon, sshd by running just after booting the cd /etc/init.d/sshd start; and passwd to set up a root password. Then give access to someone, like me for example; to chroot in your environment and try to set-it up.
If you are sure you can risk that, then my email is djwman<at>gmail<dot>com.
 
Old 11-24-2005, 10:15 AM   #8
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
So, what modules should I be adding to modules.autoload.d/kernel-2.6? I had looked at that file under the liveCD to see what they used there and it was blank, but apparently that is irrelevant.

To get another dhcp client, I need to emerge it while under the LiveCD and then tell my /etc/conf.d/net file to use it instead, right?

If I can't get the modules or another dhcp client to work, I think I might give you a go with chrooting in.
 
Old 11-24-2005, 04:46 PM   #9
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Yes, the LiveCD uses hotplug and coldplug for detecting correct hardware and modules to load.
And yes, you need to use the LiveCD to install another dhcp client, if you haven't done so already.
Mount your partitions, proc filesystem, chroot in the environment, and emerge the clients.
Still from my experience you can not leave it at configuring ./conf.d/net; you have to check and edit the client's scripts too.
Have you seen; Gentoo Linux 2005.1-r1 was realeased, and the iso is about 200MB smaller since they did not include some stages, the stage-1's I guess.
Also there are some bug fixes, that I was confronted too. For example stage-3 sets wrong permission on root (/); to check this do stat / and see that your permissons are 0755.
And another one they said that skge module for Marvel based network cards, had some problems and the interface would go up and down; I haven't posted this on bugzilla but it happened to me too, but not with my Marvel Gigabit NIC, since I hardly have any use for it, but with my Intel PRO100/S Desktop Adapter.
You can use find to see what modules you have compiled for the current kernel.
Code:
find /lib/modules/<current_kernel_name>/ -type f -iname '*.ko' -or -iname '*.o'
I picked that up from the Gentoo Handbook . I still don't have time to learn bash better .
And if you want to do things faster you can do this to paste the ouptut to the ./modules.autoload.d/kernel-2.6
Code:
find /lib/modules/<current_kernel_name>/ -type f -iname '*.ko' -or -iname '*.o' > /etc/modules.autoload.d/kernel-2.6
Then edit your kernel-2.6 file and exclude the file paths (/lib/modules/<kernel>/*) and .ko, .o extensions.
Don't load any unnecessary modules. Some are loaded automatically if needed like agpgart for example.
You can do this very easy with the nano editor, just do nano -w <file> and then use the shortcuts pointed in the program to replace strings with <null> (meaning just press Enter at replace with).
What emanresu said is true, blanking the net file assumes dhcp but Gentoo uses dhcpcd for that by default, and if you don't have it installed...
Having more clients installed is not a problem, you can select wich to use at a per connection bassis in net.
I don't know if you will get lucky with me ssh-ing in your LiveCD soon, since there is something wrong at my ISP, and my connection stops frequently during rush hours. Presumably it's because of soo many requests from clients, and many installations/server reconfigs everyday. Maybe sometime at 2 or 3 o'clock in the morning?
What network connection do you have?
 
Old 11-25-2005, 02:14 AM   #10
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
So, I was able to put the modules into my kernel file.

I also tried using dhclient (I presume that's what you mena my dhclient iirc?), although I didn't have to emerge it.

So, I ran dhclient eth0, and it returns to me with:

Listening on LPF/eth0/00:01:29:f5:b7:9b
Sending on LPF/eth0/00:01:29:f5:b7:9b
Sending on Socket/fallback
receive_packet failed on eth0; Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
send_packet: Network is down.

If I plug in dhclient where I had dhcp in the net file, and then run netmount start, it fives me

No loaded modules provide "dhclient" (dhclient_start)

I'm not really sure what much of this means (please excuse my incompetance).

I am on a school LAN ethernet connection (a good one too, so my side of the internet is rather stable).
 
Old 11-25-2005, 03:55 AM   #11
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Hmmm...

Apparentely you network is ... down.
It purely can't send because you don't have it pluged in....
It says it listens for a DHCP broadcast of the service to identify any possible servers.
Then it sends on eth0, broadcsting a request.
Sending on LPF. This I don't know what is, LPF.
Then Sending on socket failed... do you have 'unix sockets' compiled in the kernel? Check that!
Your net should be simple for eth0:
config_eth0=( "dhcp" ) #This tells Gentoo that it should use a dhcp client
modules_eth0= "dhclient" #This tells Gentoo to use dhclient for eth0
# modules= "dhclient" #This says to use dhclient for all other eth that don't have a specific modules_eth
Apparently it's the kernel config too...
It this machine a router/gateway?
 
Old 11-25-2005, 10:47 AM   #12
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
How can I check the kernel compilation options after compiling (ie how do I see if 'unix sockets" was compiled)

My machine is not a router or gateway. When at home, I had my laptop acting as a router and the desktop (the computer we are talking about currently) plugged in to the laptop's LAN connection. Now, at school, I have both the laptop and desktop plugged into separate ethernet LAN jacks in my room.

Maybe I should just let you poke around and see what kind of eggregious error I have made in configuration (since I bet this is just some simple misconfiguration that I don't know about. Let me know when would be good for you and I'll set it up shortly before then.
 
Old 11-26-2005, 07:44 AM   #13
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
I strongly advise you to do things yourself since this is the only to learn. Doing this yourself you bump into something else, sometimes, and you learn things that are not directly related to your problem. But if you are desperate and you need this working,i.e. you'll get your ass kiked if not solve it in 2 days, then I would help you as fast as I can, but there seems to be a problem with my cable modem, I've tried a friends modem, and it works, but mine gets limited network speed and stop frequently, so I can guarantee this will work(fast) if I don't get another modem from my ISP in the next few days. So if you are ready send me a mail with the password for root one day before setting it up and be sure it will be about 20:00 hours GMT+2 (Bucharest time) or 8:00 PM GMT+2 when you'll do it, i.e. start the LiveCD and sshd.
 
Old 11-26-2005, 10:37 AM   #14
mclinkor
Member
 
Registered: Nov 2005
Posts: 63

Original Poster
Rep: Reputation: 15
Well, there's not really any urgency, so I guess I can continue to try meyself. Are there any other ideas that you have for me.
 
Old 11-26-2005, 06:25 PM   #15
Worksman
Member
 
Registered: Sep 2004
Location: Romania
Distribution: Ubuntu, Debian, Arch Linux, Gentoo, Slackware
Posts: 171
Blog Entries: 1

Rep: Reputation: 31
Well ... :D

Well I guess I should be starting teaching now I have some problems here too, pretty frustrating since this is my only PC, I would have trashed it and use another, but there is only one way I see that could help you and after that I cant see what else you could ask for; give you all my conf files, tell you every step to take, everything to write to the cli and youll get nowhere if this would not do it. My system is still a little unstable right now so let me clean things out for a couple of days and then if you cant do it by then, Ill write you a book Ill tell you every scenario I can think of, what can go wrong, what there is to do, etc. Or if someone else might volunteer? Still ssh seems much faster! It's your choice
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't connect to internet w/ Gentoo randcv Linux - Newbie 6 08-19-2005 01:03 PM
Gentoo boots without internet? D4ve G Linux - Newbie 7 07-19-2005 11:27 AM
gentoo - problem with internet draye Linux - Wireless Networking 1 06-05-2005 09:17 AM
Gentoo: Can't connect to internet black hole sun Linux - Software 5 08-10-2004 09:48 AM
Internet problem with Gentoo Mahony Linux - General 11 04-12-2004 12:24 PM


All times are GMT -5. The time now is 07:15 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration