# [SOLVED] Problems with managing networks & resolvconf-gentoo

## Silenzium

I'm having problems configuring my network on my laptop in a way that it satisfies my demands. The laptop is being used in wired and wireless networks of different kinds. I just don't want to change my config files whenever I change a network area.

For example:

At my parents' home, the laptop is connected to a wired network or a wireless network with WPA encryption, both with dhcp. In my student hostel it's connected to a wired network with static IP, but a dhcp server is running, too. The dhcp is only used for internal purposes, while the static IP is used to connect to the internet. On the campus I'm using wireless LAN again. The nameserver often changes.

At the moment, I have to edit /etc/conf.d/net and /etc/resolv.conf manually whenever I have to switch from static IP to dynamic IP or/and whenever the nameserver changes.

I'm using wpa_supplicant for wireless LAN and netplug to suspend the wired LAN if the cable is plugged out of my laptop with ipw2200.

I know there is the possibility of an fallback option in baselayout, but I didn't manage to get it work with a static IP while the dhcp is running in the network.

Yesterday, I tried to solve the nameserver issues by emerging resolvconf-gentoo, but I think I'm too stupid to configure it correctly. I added the current nameserver by executing 

```

echo "nameserver 123.45.67.89" |  resolvconf -a eth0

```

It works until I restart my network with "/etc/init.d/net.eth0 restart". Afterwards my nameserver-settings are gone and I have to add them again. Where's the fault?

btw: Is there more stuff to read about than "man resolvconf"?

I also played around with NetworkManager, but I found it pretty buggy and it didn't do what I wanted it to do. Currently I'm using wpa_gui for switching wireless networks.

When starting my wireless LAN and wpa_supplicant doesn't find a network in /etc/wpa_supplicant.conf that matches, the output tells me:

```

# /etc/init.d/net.eth1 start

 * Starting eth1

 *   Starting wpa_supplicant on eth1 ...            [ ok ]

 *   Starting wpa_cli on eth1 ...                   [ ok ]

 *     Failed to configure eth1 in the background   [ !! ]

 
```

Any option I missed?

Is there any possibility to start the wireless LAN, when the button on my laptop is pressed? It's normally switched off when I don't need wlan. There is a keycode regognized, but it looks like I can't map it. Something like netplug?

/etc/conf.d/net

```

## wireless

modules=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"

wpa_timeout_eth1=60

config_eth1=( "dhcp" )

## wired

# static IP

config_eth0=( "123.45.67.89 netmask 255.255.255.0 broadcast 123.45.67.255" )

routes_eth0=( "default gw 123.45.67.1" )

# dhcp

#config_eth0=( "dhcp" )

#dhcp_eth0="-t 60"

```

Last edited by Silenzium on Thu Jun 08, 2006 3:54 pm; edited 3 times in total

----------

## UberLord

```
dns_servers_eth0="123.45.67.89"
```

----------

## Silenzium

Ok thanks, now the nameserver stays when restarting net.eth0, but what about changing networks? Does the script recognize a different network? Like the one with tatic IP and dhcp? And what about fallback?

----------

## UberLord

Well, wireless setup can take care of itself via ESSID

```
config_ESSID=( "dhcp" )
```

For wired, arping is your man like so

```
gateways="192.168.0.1 10.1.1.1"

config_192168000001=( "dhcp" )

config_010001001001=( "10.1.1.2/24" )

dns_servers_010001001001="10.1.1.1"
```

If you have the same gateways on different networks then wait for baselayout-1.12.1 or use the patch on the below bug

https://bugs.gentoo.org/show_bug.cgi?id=134253

----------

## Silenzium

I didn't manage to get the arping stuff up and running. Do I have to specify config_eth0=( "arping" )? The problem is, that I can't see what the script is doing, because it's always backgrounding. (I didn't activate backgrounding and RC_VERBOSE is activated, too.) Is there a log anywhere? I'm just doing "try and error" right now...

----------

## UberLord

 *Silenzium wrote:*   

> I didn't manage to get the arping stuff up and running. Do I have to specify config_eth0=( "arping" )?

 

Good catch - yes you do  :Smile: 

 *Quote:*   

> The problem is, that I can't see what the script is doing, because it's always backgrounding. (I didn't activate backgrounding and RC_VERBOSE is activated, too.) Is there a log anywhere? I'm just doing "try and error" right now...

 

With wpa_supplicant-0.4.x and baselayout-1.12 we default to backgrounding.

If you don't like it then do this for a 10 second timeout.

```
associate_timeout_wlan=10
```

You may also have to remove /etc/wpa_supplicant/wpa_cli.sh and/or /sbin/wpa_cli.action depending on which version installed to force it to the foreground.

----------

## Silenzium

My wired network is backgrounding, too. How do I change that?

----------

## UberLord

Backgrounding is good  :Smile: 

What is means is that netplugd or ifplugd will bring it up completely when it detects the cable has been plugged in.

If it does not then please report a bug on bugs.gentoo.org

But if you really don't want it to background then add this to conf.d/net

```
modules=( "!plug" )
```

----------

## Silenzium

I just wanted to deactivate backgrounding temporary to see exactly what the script is doing. I helped me finding out how to configure the arping stuff.

This is how my /etc/conf.d/net looks now:

```
## wired

config_eth0=( "dhcp" )

dhcpcd_eth0=( "-t 5" )

fallback_eth0=( "arping" )

gateways_eth0="192.168.0.1"

config_192168000001=( "123.45.67.89 netmask 255.255.255.0 broadcast 123.45.67.255" )

routes_192168000001=( "default via 123.45.67.1" )

dns_servers_192168000001=( "123.45.67.2" )

## wireless

modules=( "wpa_supplicant" )

wpa_supplicant_eth1=( "-Dwext" )

wpa_timeout_eth1=60

config_eth1=( "dhcp" )

#config_ESSID=( "dhcp" )

config_example-1=( "dhcp" )

config_example_2=( "dhcp" )

```

At least my wired network works as intended and my wireless network is pretty close.  :Smile: 

Some questions about wireless LAN:

The line config_example-1=( "dhcp" ) in /etc/conf.d/net gives me an syntax error:

```
/etc/conf.d/net: line xx: syntax error near unexpected token `"dhcp"'

/etc/conf.d/net: line xx: `config_example-1=( "dhcp" )'
```

Only happens with "-" in the ESSID. Is this a bug or feature?

I often forget to switch on my hardware WLAN-switch. This is what happens:

```
*   Wireless radio has been killed for interface eth1                             [ !! ]
```

I know this has been asked once or twice before, but I didn't find a solution. How can I activate WLAN after switching on the button and without starting  net.eth1 manually in the console?

When starting wireless LAN and none of the access points in /etc/wpa_supplicant.conf can be found, this happens:

```
*   Starting wpa_supplicant on eth1 ...                                           [ ok ]

*   Starting wpa_cli on eth1 ...                                                  [ ok ]

*     Waiting for association                                                     [ ok ]

*     Failed to configure eth1 in the background                                  [ !! ]

```

It consumes a lot of time during boot. How can I speed it up? (This is why I normally turn off my hardware switch.)

Thanks a lot for your patience.   :Smile: 

----------

## UberLord

 *Silenzium wrote:*   

> Some questions about wireless LAN:
> 
> The line config_example-1=( "dhcp" ) in /etc/conf.d/net gives me an syntax error:
> 
> ```
> ...

 

bash limitation

Basically you cannot have non alpha numerics in variable names. Our documentation indicates that you should change these characters to underscores _

```
config_example_1=( "dhcp" )
```

 *Quote:*   

> I often forget to switch on my hardware WLAN-switch. This is what happens:
> 
> ```
> *   Wireless radio has been killed for interface eth1                             [ !! ]
> ```
> ...

 

You'll need to write a hook into acpid in a script.

Depends on your laptop model.

Hunt around the net for examples on this.

 *Quote:*   

> 
> 
> When starting wireless LAN and none of the access points in /etc/wpa_supplicant.conf can be found, this happens:
> 
> ```
> ...

 

Don't set wpa_timeout_eth1  :Smile: 

----------

## Silenzium

This solved my last problems apart from the acpid script, but I will have a look into it.

Thanks a lot for your help.   :Very Happy: 

Marking this thread as [SOLVED].  :Smile: 

----------

## frozenJim

Wow, you guys have really lost me on a couple of points.   :Embarassed: 

I'm trying to figure out what "arping" does.  My requirement is for a laptop that uses static IP on two networks and then dhcp for anything else.  Will arping allow me to identify a network?

----------

## UberLord

 *frozenJim wrote:*   

> Will arping allow me to identify a network?

 

Sort of. If you know of two gateways, servers or always on fixed IP machines that are unique between the 2 networks then yes. Otherwise no.

----------

## lefsha

 *UberLord wrote:*   

> Backgrounding is good 
> 
> 

 

Backgrounding is UGLY!

I need to see what IP I got from DHCP.

I see absolutely NO reason to hide it from user.

 *UberLord wrote:*   

> 
> 
> But if you really don't want it to background then add this to conf.d/net
> 
> ```
> ...

 

Thanks. But I hate to change system every time if some idi.. developer changed

the normal behaviour!

Why I need to tune my system every time if it's happend?

May be better let the default behaviour without any change and if someone need

new behaviour let him set it up?

P.S. If you are a developer you should at least know, that if one got some IP

from DHCP it doesn't mean that networking = Internet is up !

Absolutely NOT !

And if one can't see the IP, then he can wait for the networking till

the end of time...

----------

## UberLord

 *lefsha wrote:*   

>  *UberLord wrote:*   Backgrounding is good 
> 
>  
> 
> Backgrounding is UGLY!
> ...

 

You of course are entitled to your opinion.

 *UberLord wrote:*   

> 
> 
> But if you really don't want it to background then add this to conf.d/net
> 
> ```
> ...

 

Thanks. But I hate to change system every time if some idi.. developer changed

the normal behaviour!

Why I need to tune my system every time if it's happend?

May be better let the default behaviour without any change and if someone need

new behaviour let him set it up?[/quote]

Default behaviour isn't to use netplug or ifplugd as by default they aren't even installed.

You chose to install them, so we developers decided that if you installed it then we'll make it so easy that by default you don't have to change anything because - guess what? you installed it.

 *Quote:*   

> P.S. If you are a developer you should at least know, that if one got some IP
> 
> from DHCP it doesn't mean that networking = Internet is up !
> 
> Absolutely NOT !

 

Did I say that? No, I don't think so.

DHCP success just means you got an IP address leased - internet could be down through a router.

What was your point again or was that just a general rant?

 *Quote:*   

> And if one can't see the IP, then he can wait for the networking till
> 
> the end of time...

 

ifconfig will tell you the IP address

----------

## lefsha

First try to get your quoting working if you are developer...

 *UberLord wrote:*   

> Default behaviour isn't to use netplug or ifplugd as by default they aren't even installed.You chose to install them, so we developers decided that if you installed it then we'll make it so easy that by default you don't have to change anything because - guess what? you installed it.
> 
> 

 

Oh, really?

Let's check it...

```

           alsasound | boot

             apache2 |      default

            bootmisc | boot

             checkfs | boot

           checkroot | boot

               clock | boot

            coldplug | boot

         consolefont | boot

                dbus |      default

                hald |      default

              hdparm | boot

            hostname | boot

             keymaps | boot

                lisa |      default

               local |      default nonetwork

          localmount | boot

             modules | boot

               mysql |      default

            net.eth0 |      default

              net.lo | boot

            net.ppp0 |      default

          ntp-client |      default

           rmnologin | boot

           syslog-ng |      default

             urandom | boot

          vixie-cron |      default

                 xdm |      default

                 xfs |      default

```

Could you, please, find here something you are talking about?

You are developer, you have to...   :Confused: 

 *UberLord wrote:*   

> 
> 
> What was your point again or was that just a general rant?
> 
> 

 

I hate if people try to do Windows from Linux.

You can make backgrounding or what ever you want,

but you have to not hide the information from the user.

----------

## UberLord

 *lefsha wrote:*   

> First try to get your quoting working if you are developer...
> 
>  *UberLord wrote:*   Default behaviour isn't to use netplug or ifplugd as by default they aren't even installed.You chose to install them, so we developers decided that if you installed it then we'll make it so easy that by default you don't have to change anything because - guess what? you installed it.
> 
>  
> ...

 

By installed I mean installed. Verify this with the below command.

[[ -x /usr/sbin/ifplugd || -x /sbin/netplugd ]] && echo "ifplugd or netplug is installed"

I did not say "added to runlevel"

And trust me, I know what I'm talking about as I wrote the entire Gentoo networking scripts

So I think I may know a thing or two about how it works and how it was designed.

 *Quote:*   

> You are developer, you have to...  

 

I have to what exactly?

 *Quote:*   

>  *UberLord wrote:*   
> 
> What was your point again or was that just a general rant?
> 
>  
> ...

 

Since when is information being hidden? It's an IP address - you can find this out via many means like ifconfig.

Try turning setting RC_PARALLEL_STARTUP="yes" in /etc/conf.d/rc

OMFG we're now hiding all the information that init script print!

Why is this? Because it's all starting in parallel and if we printed it then it would appear all jumbled on the console.

Backgrounding is important for laptop and wireless users where network devices are enabled but no carrier is available.

This is not trying to be Windows, this is just using what you have installed of your own accord - don't like it then disable or remove it.

----------

## lefsha

 *UberLord wrote:*   

> 
> 
> By installed I mean installed. Verify this with the below command.
> 
> [[ -x /usr/sbin/ifplugd || -x /sbin/netplugd ]] && echo "ifplugd or netplug is installed"
> ...

 

And that is wrong !

Do I still need to explain why?

 *UberLord wrote:*   

> 
> 
> And trust me, I know what I'm talking about as I wrote the entire Gentoo networking scripts
> 
> So I think I may know a thing or two about how it works and how it was designed.
> ...

 

Thanks for your work. But it's designed not that well.

That is similar misconcept as USE flags feature. If you have some package installed

it will be linked to another one even if certain USE flags are off.

Please, look at what is working!!! in given configuration and not what is installed.

Installed software has no sence in respect to daemons especially! Only that is working (turned on) might be taken as an assumption of a certain behaviour.

Please change your script! I have no wish install and uninstall the software every time

I need different beahviour! It looks even uglier then in Windows.

If notebook owner need this functionality he need just to turn it on and not to play

with install/uninstall.

I can't imaging that so simple things could be not obviously...

But you showed me that is all possible in this life.   :Wink: 

----------

## UberLord

 *lefsha wrote:*   

>  *UberLord wrote:*   
> 
> By installed I mean installed. Verify this with the below command.
> 
> [[ -x /usr/sbin/ifplugd || -x /sbin/netplugd ]] && echo "ifplugd or netplug is installed"
> ...

 

Well, seeing as I designed it that way, yes!

 *Quote:*   

>  *UberLord wrote:*   
> 
> And trust me, I know what I'm talking about as I wrote the entire Gentoo networking scripts
> 
> So I think I may know a thing or two about how it works and how it was designed.
> ...

 

Think of it as a USE default then - which we have.

You have to explictly turn it off. pam is a good example of this.

 *Quote:*   

> Installed software has no sence in respect to daemons especially! Only that is working (turned on) might be taken as an assumption of a certain behaviour.
> 
> Please change your script! I have no wish install and uninstall the software every time
> 
> I need different beahviour! It looks even uglier then in Windows.

 

No

 *Quote:*   

> I can't imaging that so simple things could be not obviously...
> 
> But you showed me that is all possible in this life.  

 

So simple as

modules=( "!plug")

Or, as you like to compare to portage

USE="-pam"

----------

## lefsha

 *UberLord wrote:*   

> 
> 
> Well, seeing as I designed it that way, yes!
> 
> 

 

The main reason is to hold standard behaviour we had for a long time.

If you really intended to make reliable system which is ready for production

you have always to look at it. You may change things if it's really needed

and not if you just want to change it! In many cases you have to not follow

your wishes and "improve" system by doing this. In some cases it is not critical

but annoying. But there are also some other cases. And if keep yourself doing this way

sometimes you will come thru some of them.

If I see people like you working for Gentoo I just have to confirm the broading meaning

that Gentoo is not ready for production by default. It is not that distributive

you may rely on.

So as I told you, this is the main reason which being a killer for any others.

Second is just a logic, I have explained you already.

There is no sence what is installed on you machine.

Thinking like you I have to start Apache httpd server just because it's installed

on my system. But that is not always the case, as you may expect...

 *UberLord wrote:*   

> 
> 
> Think of it as a USE default then - which we have.
> 
> You have to explictly turn it off. pam is a good example of this.
> ...

 

Unfortunately not. Doing this Gentoo come into the contradiction with it's own slogan

"Gentoo is all about choices!". I don't have to have pam USE flag to get working

system and there is no reason of doing this. Only if you need pam features

you have to turn it on. And because I can't expect which new USE flag will come

into the next release my first USE flags is -*. Either you introduce Desktop USE flags etc

or or make default list clean. There should be only those flags there, without which you can't !!! buld the working system. And pam is in any case none of them.

You all Gentoo developers have to decide either you stick with Gentoo or

you plan to make Ubuntu from it. Trust me, I don't need the second Ubuntu.

If I ever will need it, I will install real Ubuntu, not that you have done from Gentoo.

That is why you can read my words below.

 *UberLord wrote:*   

> 
> 
> So simple as
> 
> 

 

No. I'm sorry that have not unsderstood your wrong view on the concept.

----------

## UberLord

As I said earlier you are entitled to your opinion.

The current behaviour will not be changing for as long as I am a dev.

----------

## frozenJim

 *lefsha wrote:*   

> Gentoo - bad realization of a good idea. 

 

Ok, enough already.  If you dislike Gentoo enough to make your signature a hate-slogan, then simply don't use Gentoo.  It really IS all about choice.  If you want a package to be installed differently then write your own package.  Are you missing the point of Gentoo?

If your comments are meant to be constructive criticism, which is fine, then they are appreciated by everyone.  But when they sound like hate-mail, then nobody wants to hear it.  You may speak for yourself, but I am perfectly content with the way things are going right now.  It is my belief that Gentoo is NOT designed as a "production-desktop" operating system.  It's for power-users and admins.  It's for me to roll-out to my users in a way that is 100% managed by me.   Gentoo is the closest thing to perfect that exists for my needs.

Perhaps you meant to say "Thanks Uberlord for an awsome system!" and accidentally had a bit of a rant instead?  Have a beer my friend!  You will feel better tomorrow!   :Very Happy: 

Just to keep our devs feeling loved: Thank you Uber for your awsome level of support and your great work on our networking systems!

----------

## onemoreuser

I am Gentoo user, switched from Debian. I liked the way Gentoo organized I liked its openness flexibility and simple straight forward configuration. Yesterday I had nice working system, today I have upgraded to brand new baselayout-1.12.4-r6 as result I do not have my networks. Both interfaces (eth0-wired and eth1-wireless) doesn't work anymore. I've got very strange Backgrounding (tomorrow Foregrounding, then middlegrounding? ) ... I tried turned it off using modules=( "!plug" ) it didn't help .. So I've been forced to uninstall the netplug (though I need it).  I managed to fix everything. So this is not an issue.

The issue as I see is in your approach and attitude. I agree that the Gentoo is open system and the best approach to change something is to develop your own package and I realize how much work has been done by UberLord and thank you Uberlord for this.

Though if a lot of people have started rely on your work, in my understanding, how things are supposed to be,  is "do not harm". Look in the forum how many users complain about the latest upgrade. Shouldn't it be an alarm for everyone? But instead I see "The current behaviour will not be changing for as long as I am a dev". So no discussion, no ideas, no opinions, no way to change? I've seen this somewhere .. In Windows ..

I know I have freedom to choose and it seems I will use it..

----------

## frozenJim

Yeah, I know the feeling.  It works today, I do an upgrade and BLAMMO!! - no more network (or word processor, or mmorpg game etc...).

At first it made me crazy, I guess I'm just used to it now.  The path is always the same: try 100 different fixes, break 50 things in the process, then find the right answer.  Maybe you have to recompile your compiler...  in the end, my system makes me proud again.  And I do not envy the users of other more "stable" distros because they just don't "own" their machine the way that I do.

Is it possible that the problem isn't so much in the packages as it is in the lack of documentation?  It seems like if you just wait a month BEFORE doing the upgrades, somebody has documented HOW to do it right.

When I unmask something - I presume that I am one of those who becomes responsible for the documentation.  Almost like the package.keywords file is the equivalent of a waiver.  Most of the time, my contribution to the documentation project is as simple as describing my struggle in the forum here and then printing "[SOLVED]" in the title once I have the answer.  Fortunately, for every problem that I tackle here, there are 100 others being tackled at the same time by others - in the end, we have a great documentation guide right here on the forum if we all accept our share of the pain. (grin)

At least that's how I come to grips with the decidedly STEEP LEARNING CURVE that comes with using Gentoo and unmasking packages.  I test first on my "blow-up" system and learn BEFORE I do these upgrades on a client machine.

It isn't easy.  It's Gentoo.

Question:  Are we obligated to use the networking system of Uberlord if we don't approve of his packages?  Before I snottily suggest that someone write their own package - is this a realistic solution or is there some reason why one MUST use the networking packages that bother them so much?  If the freedom of choice is correct, then simply don't emerge the packages that offend you. 

And again, for clarity: following Uber's advice has turned my laptop networking into a dream.  I am 100% THRILLED at what he has done for me - and for all of us.

----------

## UberLord

 *onemoreuser wrote:*   

> I am Gentoo user, switched from Debian. I liked the way Gentoo organized I liked its openness flexibility and simple straight forward configuration. Yesterday I had nice working system, today I have upgraded to brand new baselayout-1.12.4-r6 as result I do not have my networks. Both interfaces (eth0-wired and eth1-wireless) doesn't work anymore. I've got very strange Backgrounding (tomorrow Foregrounding, then middlegrounding? ) ... I tried turned it off using modules=( "!plug" ) it didn't help .. So I've been forced to uninstall the netplug (though I need it).  I managed to fix everything. So this is not an issue.

 

If netplug is still an issue for you, please open a bug as it's new to me

 *Quote:*   

> Though if a lot of people have started rely on your work, in my understanding, how things are supposed to be,  is "do not harm". Look in the forum how many users complain about the latest upgrade. Shouldn't it be an alarm for everyone? But instead I see "The current behaviour will not be changing for as long as I am a dev". So no discussion, no ideas, no opinions, no way to change? I've seen this somewhere .. In Windows ..

 

It's a default setting for gods sake. It's not the end of the world.

You can change the default to match how you like it.

There was also a discussion on the mailing lists over a year ago when I first wrote it. Too bad you weren't there to put in your input.

As to many people complaining, then maybe we don't have enough testers. People, it's been in ~ARCH for over a year and now you want to bitch about it? You had your chance, but you didn't take it.

 *Quote:*   

> I know I have freedom to choose and it seems I will use it..

 

Bye!

----------

## lefsha

 *UberLord wrote:*   

> 
> 
> If netplug is still an issue for you, please open a bug as it's new to me
> 
> 

 

Are you still on developing Gentoo???

Can I file a bug on it?

It's crazy. We already talked about it more then one month ago.

Now I'v got a new update... (baselayout-1.12.5) There are no messages about backgrounding which is fine, but also no messages about my network at all !!!!!

And it takes 2-3 minutes to restart network service, cause I have to restart all services which more or less have something to do with network

just by doing 

```
./net.eth0 restart
```

Is it not clear here, that I want to restart only net.eth0 service ????

At least it worked so till yesterday evening. But now....

Is it some other flags or options or what ever I have to add to see IP I got from DHCP???

The last time you told me that I have to add this 

```
modules=( "!plug" )
```

 to net config file to be able again to see ordinary behaviour.

What I have to do next?...

Why I still have a new behaviour which I don't asked for???

Why you are not able to get your fingers away from the working system????

Or is it right, what other guy said here : "It's not easy - it's Gentoo..."

Fine. What will be the next you will to break?

Feel free, just put it here. I have to know if it is just a sick or I have to switch to Ubuntu?

----------

