You are not logged in.

#1 2009-06-10 23:20:50

syntaxerrormmm
Member
From: Italy
Registered: 2008-10-22
Posts: 80
Website

[Solved] Additional IP address on eth0

Hi all,

I have to put up a little LAN for a party (a service machine, a switch and a lot of clients, no connection to Internet); I was going to configure my laptop as a server, which should do:
* DHCP and possibly DNS for the local network (magic word should be dnsmasq)
* SAMBA sharing (possibly with WINS)
* game server (Nexuiz, Sauerbraten, Wormux, etc.)

My goal is to have a machine that starts up already configured for the purpose.

My first issue is configuring an additional IP address on the eth0 using network profiles.
Correct me if I'm wrong, adding an IP manually should be something like:

ifconfig eth0:1 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255

So I came out with this net profile:

CONNECTION="ethernet"
DESCRIPTION="LAN per BgLUG@Festa della Birra"
INTERFACE=eth0:1
IP="static"
IFOPTS="10.6.18.1 netmask 255.255.255.0 broadcast 10.6.18.255"
GATEWAY="10.6.18.1"

It brings up correctly, but testing it and bringing it down, shows:

# netcfg -d ethadd.bglug-fdb 
:: ethadd.bglug-fdb down                                                 [BUSY] 
SIOCDELRT: No such process
SIOCSIFFLAGS: Cannot assign requested address
SIOCSIFFLAGS: Cannot assign requested address
                                                                         [FAIL]

Obviously, I'm not able to refresh the configuration since the profile is already running on the subsequent upping of the profile.

Has someone already done something like that and could help setting things up? And sorry for the long post.

Thanks, regards,

Last edited by syntaxerrormmm (2009-06-11 16:54:13)


syntaxerrormmm - Homepage

Offline

#2 2009-06-10 23:40:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: [Solved] Additional IP address on eth0

I've had similar problems: http://bbs.archlinux.org/viewtopic.php?id=68469

I've worked around it by adding a POST_UP directive to the config for eth0:

POST_UP='ip a a 192.168.132.189/17 dev eth0'

Last edited by fukawi2 (2009-06-10 23:40:24)

Offline

#3 2009-06-11 12:42:56

syntaxerrormmm
Member
From: Italy
Registered: 2008-10-22
Posts: 80
Website

Re: [Solved] Additional IP address on eth0

Thanks a lot fukawi2,

I wasn't aware of iproute2 and I think I'll use it from now on. Also, your hint to use POST_UP made me think about adding that to the main net profile, instead of concoct a separate one for the additional address. I used these lines:

POST_UP="ip address add 10.6.18.1/24 label eth0:1 dev eth0"
PRE_DOWN="ip address del 10.6.18.1/24 dev eth0"

Thank you very much again.


syntaxerrormmm - Homepage

Offline

#4 2009-06-11 22:48:46

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: [Solved] Additional IP address on eth0

Yes, that's what I do. Not ideal, but it works smile

Offline

Board footer

Powered by FluxBB