Static IP: Sabayon 4.2 KDE [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

Static IP: Sabayon 4.2 KDE [Solved]

Postby sproot » Thu Jul 30, 2009 8:46

I need a static IP (to work with NFS on my NAS) so I used the information here and everything seems ok, but eth0 never starts up with an IP address. I can get it to work immediately by running net-setup but it can't be necessary to do this every time I boot.

I've removed knetworkmanager, NetworkManager, and dhcdbd.

There's an interesting thread here that implies maybe I should have left NetworkManager running, the last comment refers to some problems when it has been removed. Unfortunately, although it says there are 10 posts, I can only see four :shock:

Code: Select all
# cat /etc/conf.d/net
# Sabayon Linux static network configuration tool
config_eth0="192.168.1.3 broadcast 192.168.1.255 netmask 255.255.255.0"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="208.67.220.220"

# rc-update show | grep "net\."
               net.lo |                            boot
             net.eth0 |                            boot


/etc/conf.d/net above is how net-setup configures it.

After I boot eth0 is up, it has an ip6 address but it never gets an ip4 address. I always have to run net-setup, running 'ifconfig eth0 up' (or down then up) has no effect.

Anyone have any ideas?
sproot
Simple Hen
 
Posts: 46
Joined: Wed May 06, 2009 16:20
Location: London, UK

Re: Static IP: Sabayon 4.2 KDE

Postby sproot » Thu Jul 30, 2009 15:28

A bit more info then: On the Gentoo forum I found the command
Code: Select all
IN_BACKGROUND=true /etc/init.d/net.eth0 --debug --verbose start

and this gives me an error, which is almost certainly the cause of the problem.
I won't print the whole trace, it's huge, but the error is

Code: Select all
+ eval 'config=$config_0'
++ config='192.168.1.3 broadcast 192.168.1.255 netmask 255.255.255.0'
+ '[' -z '192.168.1.3 broadcast 192.168.1.255 netmask 255.255.255.0' ']'
+ set -- 192.168.1.3 broadcast 192.168.1.255 netmask 255.255.255.0
+ ebegin 192.168.1.3
*   192.168.1.3...
+ eindent
+ EINFO_INDENT=4
+ '[' 4 -gt 40 ']'
+ export EINFO_INDENT
+ case "$1" in
+ _add_address 192.168.1.3 broadcast 192.168.1.255 netmask 255.255.255.0
+ '[' 192.168.1.3 = 127.0.0.1/8 -a eth0 = lo ']'
+ '[' broadcast = netmask ']'
+ '[' eth0 = lo ']'
+ case "$1" in
+ case "$@" in
+ ip addr add 192.168.1.3 broadcast 192.168.1.255 netmask 255.255.255.0 dev eth0
Error: either "local" is duplicate, or "netmask" is a garbage.
.
.
* ERROR: net.eth0 failed to start


So I checked the man page for ip and it doesn't appear to support 'netmask' like that, if I run it from the command line I get the same error. I looked in net.eth0 and its called in a function '_add_address', but I have no idea what language it's written in and I can't work out which file provides that function.

I changed /etc/conf.d/net so that instead of reading
Code: Select all
# Sabayon Linux static network configuration tool
config_eth0="192.168.1.3 broadcast 192.168.1.255 netmask 255.255.255.0"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="208.67.222.222"

as it was created by net-setup, it now looks like
Code: Select all
# Sabayon Linux static network configuration tool
config_eth0="192.168.1.3/24 broadcast 192.168.1.255"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="208.67.222.222"

and now it will start successfully with
Code: Select all
IN_BACKGROUND=true /etc/init.d/net.eth0 start


I don't know whether this is a bug in net-setup or net.eth0, but I suspect the former.

I haven't tried a reboot yet, but I don't see why it wouldn't work, so I'm happy :D
sproot
Simple Hen
 
Posts: 46
Joined: Wed May 06, 2009 16:20
Location: London, UK

Re: Static IP: Sabayon 4.2 KDE

Postby Fitzcarraldo » Thu Jul 30, 2009 16:54

Props for investigating yourself and posting the (successful) results. :thumleft: You can earn even more Brownie points by editing the SL Wiki article you referenced and adding your fix! :)
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7331
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Static IP: Sabayon 4.2 KDE [Solved]

Postby sproot » Sun Aug 02, 2009 12:45

Cool, I'm new to Wikis but I'll give it a go. Is it worth raising a bug for it too?
Or do I have to find out which bit (net-setup / net.lo) is at fault first :?:
sproot
Simple Hen
 
Posts: 46
Joined: Wed May 06, 2009 16:20
Location: London, UK

Re: Static IP: Sabayon 4.2 KDE [Solved]

Postby Fitzcarraldo » Sun Aug 02, 2009 13:19

Great. Editing existing articles in the SL Wiki is not difficult. (Creating a new article is a little more convoluted, but you can refer to the sticky thread How to create a new article in the Sabayon Linux Wiki if you want to create any new articles in the future.)

Yes, it would be worth raising a bug in the Sabayon Issue Tracker/Sabayon Bug Tracker (previously known as SL Bugzilla) at http://bugs.sabayonlinux.org/. If you're not sure of the cause you can still go ahead and file the bug, giving as much information as you can so that the developers have as much as possible to work with.

Setting up SL for a static IP address is a perennial topic/problem that crops up in the SL forums, so your latest find will probably be of great interest to some SL users. I recall a post not too long ago about the problem, and I have a feeling that it was not resolved. I'm going to search for it now and link to this thread so that it gets flagged to the posters in that thread.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7331
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Static IP: Sabayon 4.2 KDE [Solved]

Postby sproot » Sun Aug 02, 2009 15:07

You're right, editing them isn't difficult, not making them look like cr*p is harder though :oops:
I'll revisit it when I've looked into the difference between iproute2 and ifconfig. I noticed in the example /etc/conf.d/net file there were both formats shown for config_ethX, and a comment that it didn't matter which was used, so maybe something's changed recently.

I've updated bug 712 because it seemed to relate, hopefully someone will be able to work out what's wrong.
sproot
Simple Hen
 
Posts: 46
Joined: Wed May 06, 2009 16:20
Location: London, UK


Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 1 guest