Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem automatically bringing eth0 up with new baselayout
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
divined
Apprentice
Apprentice


Joined: 23 Jul 2004
Posts: 153

PostPosted: Thu Jun 09, 2005 8:20 pm    Post subject: Problem automatically bringing eth0 up with new baselayout Reply with quote

I emerged baselayout-1.11.12-r4 today. I did all the necessary changes in /etc/conf.d and finally changed the /etc/init.d/net config file to the following :

Code:

config_eth0=( "192.168.0.3  broadcast 192.168.0.255 netmask 255.255.255.0" )


Now, I run the init script /etc/init.d/net.eth0 restart and all seems to go ok. Nonetheless, when I run ifconfig I can find no eth0 defined. The NIC is down with no IP assigned. I can bring it up manually giving

Code:

ifconfig eth0 192.168.0.3 netmask 255.255.255.0


but this is no solution. The driver of my network is loaded as a module and worked fine till I upgraded the baselayout. Any ideas as to might what might cause this behaviour?

thx, in advance

George Papadopoulos
Back to top
View user's profile Send private message
taipan67
l33t
l33t


Joined: 04 Dec 2004
Posts: 866
Location: England (i'm told...)

PostPosted: Thu Jun 09, 2005 9:21 pm    Post subject: Reply with quote

I don't think you need to do anything to any of the files in /etc/init.d/ - they're not config-files. It looks like you should only need the line
Code:
iface_eth0="192.168.0.3 broadcast 192.168.0.255 netmask 255.255.255.0"

...in /etc/conf.d/net (that's assuming the ip-values are correct).

The only other thing is that my /etc/init.d/net.eth0 script doesn't have a 'restart' option, so if it was me i'd need to
Code:
/etc/init.d/net.eth0 stop
/etc/init.d/net.eth0 start

If that works, then
Code:
rc-update add net.eth0 <runlevel>

... to get it to fire up at boot-time :D
_________________
"Anyone who goes to see a psychiatrist should have their head examined!"
Back to top
View user's profile Send private message
radfoj
Guru
Guru


Joined: 31 Dec 2004
Posts: 490
Location: Tísek, Czech Republic

PostPosted: Thu Jun 09, 2005 9:31 pm    Post subject: Reply with quote

I upgraded baselayout too today, but didnt change anything in /etc/init.d/ . But after emerging, I found postmerge notice:
Code:

 * WARNING: You have older net.eth* files in //etc/init.d/
 * They need to be converted to symlinks to net.lo.  If you haven't
 * made personal changes to those files, you can update with the
 * following command:
 *   # /bin/ls /etc/init.d/net.eth* | xargs -n1 ln -sfvn net.lo

I run it and everything is right after reboot. /etc/init.d/net.eth0 is now only symlink to /etc/init.d/net.lo ... I think.
Back to top
View user's profile Send private message
seppelrockt
Guru
Guru


Joined: 14 May 2004
Posts: 423

PostPosted: Thu Jun 09, 2005 9:53 pm    Post subject: Reply with quote

@ radfoj: Did you run etc-update? Sounds like you didn't and this might lead to some problems in the feature or at least you will not benefit from new baselayout features. baselayout changes 20+ files in /etc with etc-update.

Does anybody know whether there is a summary of new baselayout features and how to configure it properly?
Back to top
View user's profile Send private message
radfoj
Guru
Guru


Joined: 31 Dec 2004
Posts: 490
Location: Tísek, Czech Republic

PostPosted: Thu Jun 09, 2005 10:21 pm    Post subject: Reply with quote

Ok, correction, insteed etc-update I am using cfg-update. You are right, many changes in /etc/* today
Code:
# cfg-update -b | grep 2005-06-09
12  [2005-06-09]  /etc/skel/.bashrc
13  [2005-06-09]  /etc/skel/.bash_profile
22  [2005-06-09]  /etc/sysctl.conf
189 [2005-06-09]  /etc/networks
192 [2005-06-09]  /etc/services
196 [2005-06-09]  /etc/inittab
197 [2005-06-09]  /etc/inputrc
200 [2005-06-09]  /etc/conf.d/ntp-client
201 [2005-06-09]  /etc/conf.d/local.start
204 [2005-06-09]  /etc/conf.d/local.stop
205 [2005-06-09]  /etc/conf.d/rc
208 [2005-06-09]  /etc/profile
209 [2005-06-09]  /etc/rc.conf
212 [2005-06-09]  /etc/init.d/halt.sh
213 [2005-06-09]  /etc/init.d/hostname
214 [2005-06-09]  /etc/init.d/ntpd
216 [2005-06-09]  /etc/init.d/ntp-client
217 [2005-06-09]  /etc/init.d/net.eth0
218 [2005-06-09]  /etc/init.d/urandom
219 [2005-06-09]  /etc/init.d/numlock
220 [2005-06-09]  /etc/init.d/netmount
222 [2005-06-09]  /etc/init.d/clock
224 [2005-06-09]  /etc/init.d/local
225 [2005-06-09]  /etc/init.d/reboot.sh
227 [2005-06-09]  /etc/init.d/checkfs
229 [2005-06-09]  /etc/init.d/bootmisc
230 [2005-06-09]  /etc/init.d/domainname
231 [2005-06-09]  /etc/init.d/localmount
232 [2005-06-09]  /etc/init.d/keymaps
233 [2005-06-09]  /etc/init.d/checkroot
234 [2005-06-09]  /etc/init.d/rmnologin
235 [2005-06-09]  /etc/init.d/net.lo
236 [2005-06-09]  /etc/init.d/consolefont
237 [2005-06-09]  /etc/init.d/shutdown.sh
239 [2005-06-09]  /etc/init.d/modules
258 [2005-06-09]  /etc/modules.autoload.d/kernel-2.4
259 [2005-06-09]  /etc/modules.autoload.d/kernel-2.6
261 [2005-06-09]  /etc/protocols
262 [2005-06-09]  /etc/pear.conf
267 [2005-06-09]  /etc/shells
After system upgrade, I am using it (cfg-update). So unmodified files were auto-updated, few I edited myself. So net.eth0 and many others were overwriten with new ones automaticly.
Then I run command from post-merge notice and have now
Code:
# ls -l /etc/init.d/net.eth0
lrwxrwxrwx  1 root root 6 Jun  9 09:59 /etc/init.d/net.eth0 -> net.lo

Did I some mistake?
Back to top
View user's profile Send private message
drumz
Apprentice
Apprentice


Joined: 10 Nov 2002
Posts: 213

PostPosted: Thu Jun 09, 2005 10:32 pm    Post subject: Reply with quote

divined:

In the first post you list the broadcast included in the config_eth0 line. In looking at the handbook and the sample file (/etc/conf.d/net.example) they don't have it. Try taking it out and seeing if it makes a difference:

This:

Code:
config_eth0=( "192.168.0.3  broadcast 192.168.0.255 netmask 255.255.255.0" )


should become this:

Code:
config_eth0=( "192.168.0.3  netmask 255.255.255.0" )


I can say that after converting my home server to the above format it works (didn't try it with the broadcast though) so the conf.d/net file does work if it's set (I needed only 2 lines, config_eth0 and the routes_eth0.

I will say this: I'm pretty p'od that they gave no warning that the base layout was going to be changing the config file layout. On my laptop it totally killed my network connection. Fortunately I had read an earlier thread a few months ago about a possible change so I got lucky and remembered it. I love linux, and I love gentoo but these types of changes without warnings give linux a black eye.

EDIT:

While perusing the /etc/conf.d/net.example file while trying to figure out how to now properly configure my wireless card (using wpa) I came across this:

Code:
# We can also specify a broadcast
#config_eth0=( "192.168.0.2/24 brd 192.168.0.255" )
#config_eth0=( "192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" )

So you CAN still specify the broadcast in the config line - but the order is different than it was before (in the old configs). Don't know if that would make a difference or not - so this may/may not be the issue for you.


Last edited by drumz on Thu Jun 09, 2005 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1106
Location: 51:45:20N, 0:40:44W

PostPosted: Thu Jun 09, 2005 10:36 pm    Post subject: Reply with quote

Just to add to the problems reported here:

Upon booting I now get the following errors:
Code:
* You should stop using /etc/hostname & start using /etc/conf.d/hostname

Also:
Code:
* You should stop using /etc/dnsdomainname & start using /etc/conf.d/domainname

I've added in my /etc/conf.d/domainname the entry I have in /etc/dnsdomainname for the field: DNSDOMAIN="XXXX"
but it still gives me the same error.

Also, when I bring up my NIC:
Code:
# /etc/init.d/net.eth0 start
 * Starting eth0
 *   Bringing up eth0
 *     dhcp
 *       Running dhcpcd ...                                                 [ ok ]
 *       eth0 received address 192.168.0.2
 *   Adding routes
 *     default gw 192.168.0.1 ...                                           [ !! ]


Is there perhaps a link where all this is explained (I'm too tired tonight to be able to make sense of it myself).
_________________
Regards,
Mick
Back to top
View user's profile Send private message
xentric
Guru
Guru


Joined: 16 Mar 2003
Posts: 410
Location: Netherlands

PostPosted: Fri Jun 10, 2005 5:34 am    Post subject: Reply with quote

radfoj wrote:
Ok, correction, insteed etc-update I am using cfg-update. You are right, many changes in /etc/* today
Code:
# cfg-update -b | grep 2005-06-09
...
217 [2005-06-09]  /etc/init.d/net.eth0
...
After system upgrade, I am using it (cfg-update). So unmodified files were auto-updated, few I edited myself. So net.eth0 and many others were overwriten with new ones automaticly.
Then I run command from post-merge notice and have now
Code:
# ls -l /etc/init.d/net.eth0
lrwxrwxrwx  1 root root 6 Jun  9 09:59 /etc/init.d/net.eth0 -> net.lo

Did I some mistake?

I will check how cfg-update handles this situation. It looks like /etc/init.d/._cfg0000_net.eth0
was a link while the original /etc/init.d/net.eth0 was a file. Cfg-update should at least check
if the link-target exists and display a warning that the update will replace the file with a link.
I conclude that cfg-update shouldn't update a file automatically in such a situation...
Thanks for posting this info, I will test cfg-update and fix it if necessary!
_________________
When all else fails, read the manual...
Registered Linux User #340626
Back to top
View user's profile Send private message
divined
Apprentice
Apprentice


Joined: 23 Jul 2004
Posts: 153

PostPosted: Fri Jun 10, 2005 5:50 am    Post subject: Reply with quote

I checked /etc/inti.d/ to see what is going on with the intializatino scripts. Here is what I`ve got :

Code:

init.d # ls -la | grep net
lrwxrwxrwx   1 root root     6 Jun 10 23:11 net.eth0 -> net.lo
-rwxr-xr-x   1 root root   512 Jun 10 23:11 net.lo


These are the contents of net.eth0

Code:

#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.lo,v 1.10 2004/04/21 $

start() {
        ebegin "Bringing ${IFACE} up"
        /sbin/ifconfig lo 127.0.0.1 up 2>/dev/null
        /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 \
                gw 127.0.0.1 dev lo 2> /dev/null
        eend 0
}

stop() {
        ebegin "Bringing ${IFACE} down"
        /sbin/ifconfig ${IFACE} down &>/dev/null
        eend 0
}


and net.lo

Code:

#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.lo,v 1.10 2004/04/21 $

start() {
        ebegin "Bringing ${IFACE} up"
        /sbin/ifconfig lo 127.0.0.1 up 2>/dev/null
        /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 \
                gw 127.0.0.1 dev lo 2> /dev/null
        eend 0
}

stop() {
        ebegin "Bringing ${IFACE} down"
        /sbin/ifconfig ${IFACE} down &>/dev/null
        eend 0
}


The entries in /etc/conf.d/net are :

Code:

config_eth0=( "192.168.0.3 netmask 255.255.255.0 broadcast 192.168.255.0" )


and finally net.eth0 is in the default runlevel. However, when I reboot eth0 is not being initialized correctly. I can see eth0 but it has no IP, no netmask and no broadcast address.
Back to top
View user's profile Send private message
xsteadfastx
Tux's lil' helper
Tux's lil' helper


Joined: 27 Sep 2004
Posts: 132
Location: germany/belgium

PostPosted: Fri Jun 10, 2005 6:28 am    Post subject: Reply with quote

MickKi wrote:
Just to add to the problems reported here:

Upon booting I now get the following errors:
Code:
* You should stop using /etc/hostname & start using /etc/conf.d/hostname

Also:
Code:
* You should stop using /etc/dnsdomainname & start using /etc/conf.d/domainname

I've added in my /etc/conf.d/domainname the entry I have in /etc/dnsdomainname for the field: DNSDOMAIN="XXXX"
but it still gives me the same error.

Also, when I bring up my NIC:
Code:
# /etc/init.d/net.eth0 start
 * Starting eth0
 *   Bringing up eth0
 *     dhcp
 *       Running dhcpcd ...                                                 [ ok ]
 *       eth0 received address 192.168.0.2
 *   Adding routes
 *     default gw 192.168.0.1 ...                                           [ !! ]


Is there perhaps a link where all this is explained (I'm too tired tonight to be able to make sense of it myself).


whats up with that? we need to change it to the conf.d directory?
_________________
[ http://www.xsteadfastx.de ]
Back to top
View user's profile Send private message
Wim VDM
n00b
n00b


Joined: 12 Dec 2004
Posts: 21

PostPosted: Fri Jun 10, 2005 6:41 am    Post subject: Reply with quote

I had the same problem after using cfg-update.

I fixed it like this:
rm /etc/init.d/net.lo /etc/init.d/net.eth0 (remove the bad scripts)
emerge baselayout (reemerging baselayout creates the correct scripts)
etc-update (just to make sure every script is up to date, didn't do a thing though)


Hope this works for you...
Back to top
View user's profile Send private message
divined
Apprentice
Apprentice


Joined: 23 Jul 2004
Posts: 153

PostPosted: Fri Jun 10, 2005 7:25 am    Post subject: Reply with quote

That did it. I only used

Code:

emerge --noconfmem --oneshot baselayout


That solved it and I got the new scripts. I`m certain though that I had updated the init scripts in /etc/init.d the first time. Why did I still have the older scripts?
Back to top
View user's profile Send private message
Wim VDM
n00b
n00b


Joined: 12 Dec 2004
Posts: 21

PostPosted: Fri Jun 10, 2005 8:46 am    Post subject: Reply with quote

It must be a bug with cfg-update and symlinks as xentric says.

If cfg-update was written without considering that a file might be a link, I can see how that could srews things up.
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1106
Location: 51:45:20N, 0:40:44W

PostPosted: Fri Jun 10, 2005 10:10 am    Post subject: Reply with quote

Thanks guys,

I'll try it when I get home. BTW I used dispatch-conf which evidently did not do it right. Is cfg-update much different?
_________________
Regards,
Mick
Back to top
View user's profile Send private message
seppelrockt
Guru
Guru


Joined: 14 May 2004
Posts: 423

PostPosted: Fri Jun 10, 2005 10:43 am    Post subject: Reply with quote

For the hostname / domainname messages on boot - after setting those two in /etc/conf.d/hostname and /etc/conf.d/domainname you can savely delete /etc/hostname and /etc/dnsdomainname - and the messages will magically disappear ;-)

For all those who have troubly it might be worse mentioning that the network section of the gentoo handbook was updated for the new baselayout and describes very detailed how to set everything right - including WLAN. Did this last night and it just works (tm).
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1106
Location: 51:45:20N, 0:40:44W

PostPosted: Fri Jun 10, 2005 7:24 pm    Post subject: Reply with quote

OK, I am reading the file /etc/conf.d/domainname and it says:
Code:
# When setting up resolv.conf, what should take precedence?
# If you wish to always override DHCP/whatever, set this to 1.
OVERRIDE=1
What happens exactly when it is set to 1 and what when it is set to 0? An example would be nice.:)
_________________
Regards,
Mick
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1106
Location: 51:45:20N, 0:40:44W

PostPosted: Fri Jun 10, 2005 10:47 pm    Post subject: Reply with quote

Updating /etc/conf.d/hostname and /etc/conf.d/domainname partly did the trick, but I am still getting the gateway error as shown above:
Quote:
* Adding routes
* default gw 192.168.0.1 ... [ !! ]

My /etc/conf.d/net had this entry:
Code:
# For setting the default gateway
gateway="eth0/192.168.0.1"
which I changed in line with the net.example:
Code:
# For setting the default gateway
routes_eth0=(
        "default via 192.168.0.1"
)
#gateway="eth0/192.168.0.1"
However, I keep getting the same error. At this late hour (again!) I find all this quite confusing. Any ideas?
_________________
Regards,
Mick
Back to top
View user's profile Send private message
drumz
Apprentice
Apprentice


Joined: 10 Nov 2002
Posts: 213

PostPosted: Sat Jun 11, 2005 12:53 am    Post subject: Reply with quote

When I did all of my updated, I used etc-update to handle the files except for a few that I hand-edited, so that may be one reason why my change over was a little bit less strenuous than what some of you experienced.

MickKi: That line for the routes looks ok, but try changing the 'via' to 'gw'. The handbook says to use 'via', but the net.example file uses 'gw' instead. I started out using the 'via' thing, but had some problems, read the handbook, changed it, didn't see any change (after a /etc/init.d/net.eth0 stop/start) so I then rebooted and all was well.
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1106
Location: 51:45:20N, 0:40:44W

PostPosted: Sat Jun 11, 2005 8:05 am    Post subject: Reply with quote

Thanks drumz,

I always start my eth0 by hand (after the machine has booted up). I've tried changing the "via" to "gw" as you suggest, but neither seem to work. :evil:

The same error shows up every time as if the /etc/conf.d/net is not being read, or as if "via" and "gw" do the same thing.

I even tried:
Code:
# route add default gw 192.168.0.1
SIOCADDRT: File exists
and I get the above warning and the same error when /etc/init.d/net.eth0 starts. :( Which file is it referring to? /etc/conf.d/net, or another file perhaps?

Meanwhile, adsl works fine.

When I comment out the gateway lines altogether, adsl works fine again and of course when I run the /etc/init.d/net.eth0 script there is now no attempt to set my router as the default gateway.

What's going on here? Surely this has to be more straight forward.:roll:
_________________
Regards,
Mick
Back to top
View user's profile Send private message
drumz
Apprentice
Apprentice


Joined: 10 Nov 2002
Posts: 213

PostPosted: Sat Jun 11, 2005 11:45 am    Post subject: Reply with quote

Here are the only two lines I have in my /etc/conf.d/net:

Code:
config_ath0=( "192.168.1.11 netmask 255.255.255.0" )
routes_ath0=( "default gw 192.168.1.1" )


I checked, and if I execute the command manually to add a default route ('route add default gw ....') after networking has already been set up (and working) I get the same error you show (SIOCADDRT: File exists).

So the fact that your adsl works AND you get that error message it indicates that your default route is being set somehow/someplace else (and explains the error warning you get when you execute the /etc/init.d/net.eth0 script).

Do you have any other lines in your /etc/conf.d/net not commented out?
Did you at any point modify any of your other startup scripts to set the default route? (I had to originally because of using wireless on my laptop. Good place to look would be /etc/conf.d/local.start. You could also grep through /etc, /etc/conf.d for your router IP to see if it's set in some other file.)

If you execute the command 'netstat -rn' you will see that your default route is set:

Code:
netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 ath0
127.0.0.0       127.0.0.1       255.0.0.0       UG        0 0          0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 ath0


Here you can see that addresses for the 192.168.1.x are handled locally, 127.x.x.x are handled via lo (internal) and all other addresses get routed out the ath0 interface to the gateway 192.168.1.1 - that's the important line and your adsl line wouldn't be working if it wasn't being set someplace.
Back to top
View user's profile Send private message
xentric
Guru
Guru


Joined: 16 Mar 2003
Posts: 410
Location: Netherlands

PostPosted: Sat Jun 11, 2005 12:54 pm    Post subject: Reply with quote

This is what I have in /etc/conf.d/net
Code:
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
gateway="eth0/192.168.0.1"

Check the version/date of your /etc/init.d/net.lo file!
Here's the top part of my /etc/init.d/net.lo
Code:
#!/sbin/runscript
# Copyright (c) 2004-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-src/rc-scripts/net-scripts/init.d/net.lo,v 1.38.2.19 2005/05/16 18:45:35 uberlord Exp $
...

Check that /etc/init.d/net.eth0 is a link to /etc/init.d/net.lo
Code:
xentric@kbl-vlis3383 852MHz 54C ~ $ ls -al /etc/init.d/net*
lrwxrwxrwx  1 root root     6 May  7 00:55 /etc/init.d/net.eth0 -> net.lo
-rwxr-xr-x  1 root root 24246 May  7 00:25 /etc/init.d/net.lo
-rwxr-xr-x  1 root root  2873 May  7 00:25 /etc/init.d/netmount

Check that /etc/conf.d/net.eth0 is a link to /etc/conf.d/net
Code:
xentric@kbl-vlis3383 852MHz 54C ~ $ ls -al /etc/conf.d/net*
-rw-r--r--  1 root root  1265 May 27 07:16 /etc/conf.d/net
lrwxrwxrwx  1 root root    15 Apr 24 21:59 /etc/conf.d/net.eth0 -> /etc/conf.d/net
-rw-r--r--  1 root root 17603 May  7 00:25 /etc/conf.d/net.example
-rw-r--r--  1 root root  3308 Nov 20  2004 /etc/conf.d/net.ppp0
-rw-r--r--  1 root root  1052 Nov 21  2004 /etc/conf.d/net.static

Here's what I get:
Code:
root@kbl-vlis3383 852MHz 52C xentric # /etc/init.d/net.eth0 start
 * Starting eth0
 *    Bringing up eth0
 *       192.168.0.2                                                                    [ ok ]
 *    Adding routes
 *       default gw 192.168.0.1 ...                                                     [ ok ]

_________________
When all else fails, read the manual...
Registered Linux User #340626


Last edited by xentric on Sun Jun 12, 2005 8:57 am; edited 1 time in total
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1106
Location: 51:45:20N, 0:40:44W

PostPosted: Sun Jun 12, 2005 8:42 am    Post subject: Reply with quote

Thanks guys! :)

Something is wrong with my box. My /etc/conf.d/net indeed has the same two lines like yours:
Code:
iface_eth0="dhcp"
gateway="eth0/192.168.0.1"
As I've said above I' ve also tried:
Code:
routes_eth0=(
       "default via 192.168.0.1"
)
but the gateway error remained.

However, here's where the differences start. I did not have the /etc/conf.d/net.eth0 to /etc/conf.d/net link! 8O /etc/conf.d/net.eth0 did not exist in my /etc/conf.d/*:
Code:
# ls -la /etc/conf.d/net*
-rw-r--r--  1 root root   987 Jun 11 20:37 /etc/conf.d/net
-rw-r--r--  1 root root 17603 Jun  9 21:01 /etc/conf.d/net.example
So I created it, but the problem still remains.

On the other hand, I do have the link between /etc/init.d/net.eth0 and /etc/init.d/net.lo:
Code:
# ls -la /etc/init.d/net*
lrwxrwxrwx  1 root root     6 Jun  9 21:01 /etc/init.d/net.eth0 -> net.lo
-rwxr-xr-x  1 root root 24402 Jun  9 21:01 /etc/init.d/net.lo
-rwxr-xr-x  1 root root  2873 Jun  9 21:01 /etc/init.d/netmount


The default gateway is being set alright, but I am not sure what script does that.

What else would you suggest I have a look at?
_________________
Regards,
Mick
Back to top
View user's profile Send private message
drumz
Apprentice
Apprentice


Joined: 10 Nov 2002
Posts: 213

PostPosted: Sun Jun 12, 2005 11:22 am    Post subject: Reply with quote

The only thing I can think of is to try grepping through /etc for your router IP address:

Code:
grep -r "192.168.1.1" /etc


That may flush out a file that has the ip in it (change the above with yours).

Maybe also take a look at what scripts are running at startup:

Code:
run-update -s


Then look to see what scripts are running.
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1106
Location: 51:45:20N, 0:40:44W

PostPosted: Sun Jun 12, 2005 3:42 pm    Post subject: Reply with quote

Thanks again drumz!

This is what I get:
Code:
# grep -r "192.168.0.1" /etc/*
/etc/conf.d/net:#       "default via 192.168.0.1"
/etc/conf.d/net:gateway="eth0/192.168.0.1"
/etc/conf.d/wireless.example:#dns_servers_ESSID=( "192.168.0.1" "192.168.0.2" )
/etc/conf.d/wireless.example:#mac_dns_servers_001122334455=( "192.168.0.1" "192.168.0.2" )
/etc/conf.d/net.example:#       "default via 192.168.0.1"
/etc/conf.d/net.example:#fallback_route_eth0=( "default via 192.168.0.1" )
/etc/conf.d/net.example:#dns_servers_ESSID=( "192.168.0.1" "192.168.0.2" )
/etc/conf.d/net.example:#mac_dns_servers_001122334455=( "192.168.0.1" "192.168.0.2" )
/etc/conf.d/net.example:#config_ippp0=( "192.168.0.1/24" )
/etc/conf.d/net.example:#config_tun1=( "192.168.0.1/24")
/etc/conf.d/net.example:#config_br0=( "192.168.0.1/24" )
/etc/conf.d/net.eth0:#  "default via 192.168.0.1"
/etc/conf.d/net.eth0:gateway="eth0/192.168.0.1"
/etc/resolv.conf:nameserver 192.168.0.1
/etc/resolv.conf.sv:nameserver 192.168.0.1
/etc/sane.d/saned.conf:#192.168.0.1
/etc/sane.d/saned.conf:#192.168.0.1/29
Only two files contain the same IP address. First is /etc/conf.d/net which contains 192.168.0.1 as the default gateway and second is /etc/resolv.conf, which contains 192.168.0.1 as the nameserver (my router acts as domain name server for the LAN).

Nothing untoward (I believe) is shown in my rc services:
Code:
# rc-update -s
               acpid |                               
           alsasound | boot                         
            bootmisc | boot                         
             checkfs | boot                         
           checkroot | boot                         
               clock | boot                         
            coldplug | boot                         
         consolefont | boot                         
         crypto-loop |                               
               cupsd |                               
          domainname |      default                 
                famd |                               
           freepopsd |                               
                 gpm |                               
              hdparm |      default                 
            hostname | boot                         
             hotplug |      default                 
             keymaps | boot                         
                lisa |                               
               local |      default nonetwork       
          localmount | boot                         
       mDNSResponder |                               
       microcode_ctl |      default                 
             modules | boot                         
            net.eth0 |                               
              net.lo | boot                         
            netmount |      default                 
                nifd |                               
                nscd |                               
             numlock |                               
             portmap |                               
               psion |                               
             reslisa |                               
           rmnologin | boot                         
              rsyncd |                               
              serial | boot                         
              splash |                               
                sshd |                               
           syslog-ng |      default                 
             urandom | boot                         
          vixie-cron |      default                 
                 xdm |                               
                 xfs |
I am really confused about this problem. What else could it be?
_________________
Regards,
Mick
Back to top
View user's profile Send private message
Conditional_Zenith
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2004
Posts: 144
Location: Australia

PostPosted: Mon Jun 13, 2005 1:14 am    Post subject: Reply with quote

MickKi: I had the same problem as you. It seems that setting the gateway in /etc/conf.d/net should only be done for static IP's. Comment out your gateway lines and dhcpcd should set the gateway for you. What was happening before (I think) is that dhcpcd was setting the gateway, and then the init script was trying to set it again, but got an error as that route was already set.

If you want to check that the gateway is set, run /sbin/route and you should see something like this:

Code:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0


The last line tells you that anything not matched by the first 2 rules goes via 192.168.0.1/eth0, ie. the gateway has been set.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum