# The new OpenRC networking script

## Etal

The new OpenRC (0.5.1) got this new flag:

```
oldnet: Install the old type of network init-scripts with a symlink net.IFACE for each interface
```

So apparently now, instead of the usual net.eth0, net.wlan0, etc., there is a new way to do things; however, I can not find anything about it except the 0.5 announcement and announcement of the networking change...

Is there any any actual documentation on how to migrate to and use the new network script (aside for the comments in the file)?

----------

## pdw_hu

 *AM088 wrote:*   

> The new OpenRC (0.5.1) got this new flag:
> 
> ```
> oldnet: Install the old type of network init-scripts with a symlink net.IFACE for each interface
> ```
> ...

 

Wondering myself...

Anyway the good old, wpa_supplicant -Dwext -B -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0 + dhcpcd wlan0 works as always but it really seems this openrc update was a bit rushed without any proper info to get it working. 

Why would you want to stick with anything that has "old" in it's name after an update? :D

----------

## ziggysquatch

Over at Funtoo there is some documentation on it.  Not sure if it applies to Gentoo but i would think it's the same.

http://www.funtoo.org/en/funtoo/networking/

----------

## rahulthewall

Follow this thread: (openRC support thread - there is some information there)

https://forums.gentoo.org/viewtopic-t-790100-postdays-0-postorder-asc-start-25.html

----------

## d2_racing

In fact, it's time to have an official migration guide or something that we can read more about it officially.

The Funtoo doc is good, but we need a Gentoo guide too here  :Razz: 

----------

## Etal

 *d2_racing wrote:*   

> In fact, it's time to have an official migration guide or something that we can read more about it officially.
> 
> The Funtoo doc is good, but we need a Gentoo guide too here 

 

Yeah, an official guide is really needed. 

The Funtoo guide, though, is actually different from openrc - they're trying to get rid of the networking configuration "infrastructure" entirely, and just use the tools like ifconfig directly. Which actually sounds really nice, except there does not seem to be a comprehensive guide so that I could learn how to do what I want without ending up with no internet.

Here's what I currently have and what I want to keep: netplug manages which interface is used based on whether the ethernet is plugged in, wpa_supplicant manages the wireless, and the IP addresses are acquired via dhcpcd. How to start it all up manually, I have no clue.

----------

## d2_racing

In fact, I have no clue too.

 *Roy wrote:*   

> 
> 
> But what about the other DHCP clients - I want to use dhclient with ifplugd/wpa_supplicant. You have two options here - keep on using the exiting network modules or script ifplugd/wpa_supplicant yourself. Or use something else like  NetworkManager. 
> 
> 

 

----------

## d2_racing

Maybe if you use the use flag that disable the new stuff from OpenRc, then maybe you will be able to run like you are used to do.

If you find something, just post here  :Razz: 

----------

## Etal

 *d2_racing wrote:*   

> Maybe if you use the use flag that disable the new stuff from OpenRc, then maybe you will be able to run like you are used to do.
> 
> If you find something, just post here 

 

I am running with oldnet, so it is working fine. The reason I'm posting here is because I want to learn a new way  :Very Happy: 

I guess I'll have to wait until I have a few days of free time and read some docs on how all the components fit together. Can't do it now because losing the Internet connection would be a big no-no for me.   :Sad: 

----------

## d2_racing

In fact, testing some network stuff can be pretty hard if you actually crash your internet connection.

----------

## d2_racing

Until the release of an official guide, I will mask the 0.5 version or at least I will use new the use flag that remove all the new stuff.Last edited by d2_racing on Tue Oct 13, 2009 1:26 am; edited 1 time in total

----------

## rahulthewall

 *d2_racing wrote:*   

> ... at least I will use new the use flag that remove all the new stuff.

 

What does that mean?

----------

## JC99

 *d2_racing wrote:*   

> Until the release of an official guide, I will mask the 0.5 version or...

 

What if we already installed 0.5.1?

I installed it yesterday, THEN read about all this stuff. I am afraid to reboot my system fearing my network/internet will no longer work.

Do you have a general idea about when an official guide will be released? I would like to learn the new way of doing things too.

Update: I see openrc has the "oldnet" useflag set, does this mean my net.ethx will work and I can reboot without any problems?

----------

## d2_racing

 *EvilEye wrote:*   

> Update: I see openrc has the "oldnet" useflag set, does this mean my net.ethx will work and I can reboot without any problems?

 

As far as I know, yes.

----------

## d2_racing

 *rahulthewall wrote:*   

>  *d2_racing wrote:*   ... at least I will use new the use flag that remove all the new stuff. 
> 
> What does that mean?

 

I mean the new use flag oldnet

```

# quse -D oldnet

local:oldnet:sys-apps/openrc: Install the old type of network init-scripts with a symlink net.IFACE for each interface

```

----------

## huckabuck

I have openrc 0.5.1 installed now for a few days, and oldnet useflag was set by default profile. Reboot has not been a problem.

----------

## sylware

Come on, drop ifconfig support for good in the new openrc!

What is this mess with bsd kernel tools and linux kernel tools?? Have specific scripts for each kernel, bloody hell!

----------

## UberLord

 *sylware wrote:*   

> Come on, drop ifconfig support for good in the new openrc!

 

iproute2 only exists in Linux, so no.

 *Quote:*   

> What is this mess with bsd kernel tools and linux kernel tools?? Have specific scripts for each kernel, bloody hell!

 

Again no, scripts should be portable across kernels and tools where possible.

I see no benefit in ignoring ifconfig for this  :Smile: 

----------

## sylware

 *UberLord wrote:*   

>  *sylware wrote:*   Come on, drop ifconfig support for good in the new openrc! 
> 
> iproute2 only exists in Linux, so no.

 

I forgot to add for the Linux kernel.

 *UberLord wrote:*   

>  *Quote:*   What is this mess with bsd kernel tools and linux kernel tools?? Have specific scripts for each kernel, bloody hell! 
> 
> Again no, scripts should be portable across kernels and tools where possible.
> 
> I see no benefit in ignoring ifconfig for this 

 

I do not agree, I think that anything which is too intimate with a kernel should have specific code and scripts (and I see BSD code as a threat so it does not help). Moreover bsd ifconfig is different from linux ifconfig (which has been meant to be replaced by iproute2 for years), that's why you have many switches in the script to handle the 2 ifconfig differently.

Well Roy Marple choices are different and I don't have time to allocate in order to maintain a lean and clean GPL linux version of openrc, then I shut up and sharpen my anger silentely.

What's up with initng and upstart for gentoo?

----------

## sera

 *UberLord wrote:*   

> 
> 
> Again no, scripts should be portable across kernels and tools where possible.
> 
> I see no benefit in ignoring ifconfig for this 

 

Across kernels I agree, if Gentoo want's pure linux init scripts it can provide them itself. But across tools is exactly the old net.lo approach. So I was wondering myself why the current script "network" doesn't come as three different scripts. As net.loopback, net.ifconfig, net.iproute2 for example. This would also allow neater configuration files I guess.

----------

## pappy_mcfae

I tried the new setup. It works quietly, and quite well. My only question/suggestion is perhaps the next version might be intuitive enough to not change things back once you get the new script setup. This change might inspire me to put baselayout-2/openrc on another of my machines.

Blessed be!

Pappy

----------

## pappy_mcfae

Sheepish head slap! I suppose using -oldnet is a good way to get that done. Who needs intuitive? hehehe

Good work on this one. I have it set up properly now. Love it!

Blessed be!

Pappy

----------

## d2_racing

So right now, do you have a working lan card and what about your Wifi card ?

Can you tell us more about your experiment ?

----------

## sera

 *d2_racing wrote:*   

> So right now, do you have a working lan card and what about your Wifi card ?
> 
> Can you tell us more about your experiment ?

 

For the wlan card.

Build the wpa_supplicant init script as described in post: 6008568.

Add it to the boot or default runlevel.

Put something like:

```
wpa_supplicant_conf="/etc/wpa_supplicant/wpa_supplicant.conf"

wpa_supplicant_if="wlan0"
```

into /etc/conf.d/wpa_supplicant.

Done.

If it does not exactly what you want edit the init script.

----------

## gerard27

I use a wired connection to the internet (net.eth0).

Reading this thread I got scared because I updated openrc to 5.1-r1.

I checked /etc/conf.s/net and it had oct 15th datestamp.

The emerge had copied the contents of my previous file into it!

The same happened to /etc/conf.d/network.

I've rebooted and no problems.

Gerard.

----------

## d2_racing

@gerard82, do you use the oldnet use flag or not ?

----------

## gerard27

I do not have that flag in /etc/make.conf.

I tried emerge -pv openrc and that didn't show that flag either.

Hope this answers your question.

Gerard.

----------

## d2_racing

Can you post this :

```

# emerge -av openrc

```

----------

## Etal

It was removed, and oldnet is now set for everyone.

```
[ebuild     U ] sys-apps/openrc-0.5.1-r1 [0.5.1] USE="ncurses pam unicode -debug (-oldnet%*)" 0 kB
```

```
*openrc-0.5.1-r1 (15 Oct 2009)

  15 Oct 2009; Mike Frysinger <vapier@...org> +openrc-0.5.1-r1.ebuild,

  openrc-9999.ebuild:

  Rewrite the oldnet handling and make it the default for everyone.
```

----------

## pappy_mcfae

 *d2_racing wrote:*   

> So right now, do you have a working lan card and what about your Wifi card ?
> 
> Can you tell us more about your experiment ?

 

Yes, I have a working wired LAN connection. The machine on which I set this up is core-too, and it doesn't have wireless. For the moment, I'm going to experiment a bit more with it, and update another machine. I want to make sure that this is both stable, and set to be around a while before I set up pappy-lap to use it. I'd have to completely rethink my automatic networking setup. At the moment, I'm not that inspired.

As to what I found out with my experiment:

1. If you're going to do it, make sure you emerge openresolv first. It will be called by the script. If it's not there, the script, and your networking, will fail.

2. If you're going to use the new scripting, add -oldnet to your /etc/make.conf USE flags list, or add the line sys-apps/openrc -oldnet to /etc/portage/package.use. This will keep openrc from rewriting the script if you reemerge openrc.

3. move the following files somewhere where they won't get in the way:

a. /etc/conf.d/net

b. /etc/conf.d/net.eth0

c. /etc/runlevels/default/net.eth0

d. /etc/runlevels/boot/net.lo

e. /etc/init.d/net.lo

4. modify the script below to fit your system.

```
#!/sbin/runscript

# Copyright 2009 Funtoo Technologies, LLC

# All rights reserved. Released under the 2-clause BSD license.

IP=192.168.0.130

NM=255.255.255.0

GW=192.168.0.1

INT=eth0

DOM=no.org

NS1=65.68.49.50

NS2=65.68.49.51

NS3=192.168.0.1

depend() {

        provide net

        after net.lo

}

start() {

        ebegin "Bringing up network interface $INT"

        ifconfig $INT $IP netmask $NM up && \

        route add default gw $GW $INT && \

        resolvconf -a $INT << EOF

domain $DOM

nameserver $NS1

nameserver $NS2

nameserver $NS3

EOF

        eend $?

}

stop() {

        ebegin "Shutting down network interface $INT"

        resolvconf -d $INT && \

        route del default gw $GW $INT && \

        ifconfig $INT down

        eend $?

}

```

5. make the script executable, and place it in /etc/init.d

6. rc-update add <net_script_name> default, where <net_script_name> is the name you give your finalized script.

7. rc-update add network boot.

8. reboot.

[below edited for correctness.]

Upon reboot, it should be noted that if done properly, you will only see the interface declared as INT in the above script. In the case of my machine, I saw Bringing up network interface eth0.... There was no other mention of network activation.

If you see networking warning messages, that means something wasn't done correctly (most likely the script itself). Trust me, I just set up my second machine, and I had some issues with the script. Once those were fixed, the problems went away.

[ /edit]

Notes and observations so far:

a. if you are using kweather, you need to make sure that one of your nameservers is the same as the default gateway. If you don't do this, kweather will not update properly. Note that one of the three name servers is the default gateway. 

b. You can name the script anything you desire. You just have to make sure that the script is executable.

c. You can start and stop the interfaces by simply typing /etc/init.d/<network_script_name> start or /etc/init.d/<network_script_name> stop. No more fancy incantations required.

d.  for reference, see this article. 

Note that the only divergence I've seen from the article in what I did is naming the script. The article seems to want to maintain the net.eth0 naming standard, yet naming the script net.eth0 will make openrc throw an error message during emerge. The message can be ignored as long as things are starting and running properly.

Blessed be!

Pappy

----------

## gerard27

@d2racing,

Makes no difference.

The posts before this explain what's happening.

Gerard.

----------

## JC99

pappy_mcfae, thanks for posting that information. I am about to take the plunge and try out openrc-0.5.1-r1

I have 3 question....

My computer currently has net.eth0 AND net.eth1. net.eth0 connects to the internet while net.eth1 connects to my network. The script you posted above only mentions INT=eth0 . Do I use that script again but just changed it to say INT=eth1 Then give both scripts different names, make executable, place in /etc/init.d and configure to run at boot?

Does this also apply to wireless networking, just use INT=wlan0?

What about Ethernet bridging (net.br0)?

Thanks in advance

----------

## pappy_mcfae

 *EvilEye wrote:*   

> pappy_mcfae, thanks for posting that information. I am about to take the plunge and try out openrc-0.5.1-r1
> 
> I have 3 question....
> 
> My computer currently has net.eth0 AND net.eth1. net.eth0 connects to the internet while net.eth1 connects to my network. The script you posted above only mentions INT=eth0 . Do I use that script again but just changed it to say INT=eth1 Then give both scripts different names, make executable, place in /etc/init.d and configure to run at boot?

 

Good question. Between you and I, and everyone else reading, I don't know. My assumption is that you would make an individual script for each interface you wish to bring up, and load them all into /etc/runlevels/default.

UberLord, if you read this, is this assumption correct?

 *Quote:*   

> Does this also apply to wireless networking, just use INT=wlan0?

 

Yes, there are several scripts available. The unfortunate thing is they're in new stage3's from funtoo. Fortunately for all concerned, I downloaded a recent funtoo stage-3, and I have all the scripts. I would have to untar the tarball again to get them, but when I do, I will post them on my server, and make a URL available.

 *Quote:*   

> What about Ethernet bridging (net.br0)?
> 
> Thanks in advance

 

Yes, there is a bridging script. Please allow me about a half hour or so to respond to other emails, and I will get the scripts and make them available. 

Blessed be!

Pappy

----------

## pappy_mcfae

Alright. I've got it all set. Point your browser to http://www.kernel-seeds.org/funtoo-netscripts-1.1.tar.bz2 . Download the tarball (2.2k), untar, and check them out. They aren't well documented, but then again, they are very self-explanatory.

Blessed be!

Pappy

----------

## UberLord

 *sera wrote:*   

>  *UberLord wrote:*   
> 
> Again no, scripts should be portable across kernels and tools where possible.
> 
> I see no benefit in ignoring ifconfig for this  
> ...

 

You can use /etc/ifconfig.eth0 if you like  :Smile: 

Yes, that's not the normal Gentoo way, but it also means we're configuration compatible with some of the BSD based RC systems.

----------

## JC99

 *pappy_mcfae wrote:*   

>  *EvilEye wrote:*   pappy_mcfae, thanks for posting that information. I am about to take the plunge and try out openrc-0.5.1-r1
> 
> I have 3 question....
> 
> My computer currently has net.eth0 AND net.eth1. net.eth0 connects to the internet while net.eth1 connects to my network. The script you posted above only mentions INT=eth0 . Do I use that script again but just changed it to say INT=eth1 Then give both scripts different names, make executable, place in /etc/init.d and configure to run at boot? 
> ...

 

UberLord, do you know if that assumption is correct? (This is from pappy_mcfae's post 3 posts up)Last edited by JC99 on Fri Oct 16, 2009 10:16 pm; edited 1 time in total

----------

## costel78

I have in /etc/conf.d/network:

```
ip_eth0="192.168.2.2/24; 10.0.1.5/8"

ip_eth1="192.168.5.4/24"

defaultroute="192.168.2.1"

```

I have few questions:

1. What is the keyword for add a route/interface ? Something like old style found in /etc/conf.d/net routes_ethX=" gateway_ip "

2. Is there (with new style) a way for specify MTU/interface ? (mtu_eth0="1492")

3. I deleted /etc/init.d/net.eth0, /etc/init.d/net.eth1 (were symlinked to net.lo), /etc/conf.d/net, edited /etc/conf.d/network and added network script to boot level (rc-update add network boot). Am I correct ?

1. 2. - for now I'm using /etc/conf.d/local.start to proper set everything, but it not seems to be right way.

Thank you!

Edited: path correction

----------

## pappy_mcfae

costel78,

before we go further, please post the results of emerge --info.

Blessed be!

Pappy

----------

## UberLord

 *pappy_mcfae wrote:*   

>  *EvilEye wrote:*   pappy_mcfae, thanks for posting that information. I am about to take the plunge and try out openrc-0.5.1-r1
> 
> I have 3 question....
> 
> My computer currently has net.eth0 AND net.eth1. net.eth0 connects to the internet while net.eth1 connects to my network. The script you posted above only mentions INT=eth0 . Do I use that script again but just changed it to say INT=eth1 Then give both scripts different names, make executable, place in /etc/init.d and configure to run at boot? 
> ...

 

Here's my take on it - if you want to roll scripts in whatever way you want and it works for you then got for it!

OpenRC-0.5.x. init.d/network is meant to be single use - ie configures all static interfaces. It's mean to be used alongside dhcpcd-5.x as that handles a lot of dynamic foo the old net.xxx scripts did.

Or putting it another way, pappy_mcfae doesn't really bring anything to the table that /etc/init.d/network doesn't have.

openresolv can be configured directly, no need for a script.

----------

## JC99

 *UberLord wrote:*   

> Or putting it another way, pappy_mcfae doesn't really bring anything to the table that /etc/init.d/network doesn't have.
> 
> openresolv can be configured directly, no need for a script.

 

Am I correct in understanding that I don't need to use the script that was posted by pappy_mcfae for eth0 or eth1 and the other script pappy_mcfae posted for download for br0?

----------

## pappy_mcfae

 *Quote:*   

> Or putting it another way, pappy_mcfae doesn't really bring anything to the table that /etc/init.d/network doesn't have. openresolv can be configured directly, no need for a script.

 

It was my intent, at the request of d2_racing, to set this up on my machine, and put together a loose how-to for the folks on the Gentoo Quebec forums. There was a lot of buzz, but no information. I did so, and I think I did an admirable job, in comparison to all the other information there is about this on the Gentoo Forums. Oh that's right this thread is the only one that contains a how-to.

I didn't post a script for openresolv. I posted my /etc/resolvconf.conf. That does have to be modified, unless I missed something in the documentation. Did I?

You're the expert. I'm just a guy who can read things, translate them out of digitalese, and make them understandable to others. If doing that isn't bringing something to the table, then what is? 

Perhaps when others ask questions, and you sit silently, you might take time to thank me for the effort of at least trying to get YOUR setup out to the masses. I thought that was the idea in the first place.

Thanks.

Blessed be!

Pappy

----------

## d2_racing

 *pappy_mcfae wrote:*   

> It was my intent, at the request of d2_racing, to set this up on my machine, and put together a loose how-to for the folks on the Gentoo Quebec forums. There was a lot of buzz, but no information. I did so, and I think I did an admirable job, in comparison to all the other information there is about this on the Gentoo Forums. Oh that's right this thread is the only one that contains a how-to.
> 
> 

 

That's right, I read all the threads from gentoo-dev list and man that openRc thread was a real flamewar. Vapier removed the new stuff so that everyone can have a working network without reading the actual code of openRc or the Funtoo doc.

----------

## UberLord

I didn't mean to cause offence  :Sad: 

If I seem quiet it's because I'm very busy, I don't tend to ignore these forums.

Anyway, you can do this in conf.d/network

```

ifconfig_eth0="192.168.0.130 netmask 255.255.255.0"

defaultroute="192.168.0.1"
```

There is no clean way of interacting with resolvconf here, but we could write this

```

ifup_eth0="printf \"nameserver 65.68.49.50\nnameserver 65.68.49.51\n192.168.0.1\ndomain no.org\" | resolvconf -a \$int"

```

Or this don't bother with the network script and do this in /etc/dhcpcd.conf (requires dhcpcd-5.x)

```

interface eth0

static ip_address=192.168.0.130/24

static routers=192.168.0.1

static domain_name=no.org

static domain_servers=65.68.49.50 65.68.49.51 192.168.0.1
```

All this was documented in /etc/conf.d/network AND the dhcpcd.conf man page.

If you feel this documentation was lacking in any way or form, then please help me update it!

----------

## UberLord

 *d2_racing wrote:*   

>  *pappy_mcfae wrote:*   It was my intent, at the request of d2_racing, to set this up on my machine, and put together a loose how-to for the folks on the Gentoo Quebec forums. There was a lot of buzz, but no information. I did so, and I think I did an admirable job, in comparison to all the other information there is about this on the Gentoo Forums. Oh that's right this thread is the only one that contains a how-to.
> 
>  
> 
> That's right, I read all the threads from gentoo-dev list and man that openRc thread was a real flamewar. Vapier removed the new stuff so that everyone can have a working network without reading the actual code of openRc or the Funtoo doc.

 

That's not entirely accurate.

The flag controlling the network script was removed, but the old and new style networking scripts are installed by default. So you get to choose what you like on disk.

The flamewar was regarding people expecting their existing configs to work with the new style scripts and whether packages like openrc should be in ~arch right away.

----------

## pappy_mcfae

I was a bit offended, but I have lived through worse. 

I am all about Gentoo Linux. I want to help it grow. I've met some really cool people here, and I feel like I make a difference. When you said what you said, I felt a bit belittled. 

I'm really liking the new scripting as well. For use with my setup, it's perfect. It's the first thing I've seen with openrc that even made me consider switching more than one machine. That should say something.

I do what I can to further the community. I hope that the how-to might be adapted, or modified into becoming the official how to. I didn't write it to cause issue. I try very hard to be very mellow in the forums. Please understand that.

FYI, my script came from Daniel Robbins' Funtoo Networking Guide. The only change I did was to add the gateway as a third name server.

Blessed be!

Pappy

----------

## UberLord

 *pappy_mcfae wrote:*   

> FYI, my script came from Daniel Robbins' Funtoo Networking Guide. The only change I did was to add the gateway as a third name server.

 

I have a nice long chat with Daniel last night. I made him aware of exactly what dhcpcd-5 can do these days and he was very impressed. So impressed said he was going to re-do a lot of the Funtoo Networking around it. Or at least document it more  :Smile: 

----------

## pappy_mcfae

Does that mean there's even a simpler way?

BB!

P

----------

## costel78

 *pappy_mcfae wrote:*   

> costel78,
> 
> before we go further, please post the results of emerge --info.
> 
> Blessed be!
> ...

 

emerge --info

```
Portage 2.2_rc46 (default/linux/amd64/10.0/desktop, gcc-4.4.1, glibc-2.10.1-r0, 2.6.31-reiser4-r3-costel x86_64)

=================================================================

System uname: Linux-2.6.31-reiser4-r3-costel-x86_64-Intel-R-_Core-TM-_i7_CPU_860_@_2.80GHz-with-gentoo-2.0.1

Timestamp of tree: Sat, 17 Oct 2009 08:00:01 +0000

app-shells/bash:     4.0_p33

dev-java/java-config: 2.1.9-r1

dev-lang/python:     2.6.3, 3.1.1-r1

dev-util/cmake:      2.6.4-r3

sys-apps/baselayout: 2.0.1

sys-apps/openrc:     0.5.1-r1

sys-apps/sandbox:    2.1

sys-devel/autoconf:  2.13, 2.63-r1

sys-devel/automake:  1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11

sys-devel/binutils:  2.20.51.0.2

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.6a

virtual/os-headers:  2.6.30-r1

ACCEPT_KEYWORDS="amd64 x86 ~amd64 ~x86"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -pipe -march=native -mtune=native -floop-interchange -floop-strip-mine -floop-block"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib64/fax /usr/share/X11/xkb /usr/share/config /var/bind /var/lib/hsqldb /var/spool/fax/etc"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -pipe -march=native -mtune=native -floop-interchange -floop-strip-mine -floop-block"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests candy distlocks fixpackages lmirror news nodoc parallel-fetch preserve-libs sfperms strict suidctl unmerge-logs unmerge-orphans userfetch userpriv"

GENTOO_MIRRORS="http://localhost http://mirrors.xservers.ro/gentoo/ http://ftp.roedu.net/pub/mirrors/gentoo.org/ http://mirrors.evolva.ro/gentoo/ http://distfiles.gentoo.org/ http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LANG="ro_RO.UTF-8"

LC_ALL="ro_RO.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu"

LINGUAS="ro en en_GB"

MAKEOPTS="-j8 --load-average=10"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_EXTRA_OPTS="--progress --delete-before --human-readable"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/added /usr/portage/local/mozilla /usr/portage/local/gnome /usr/portage/local/rusxmms"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X a52 aac acl acpi alsa amd64 apache2 aspell audio berkdb big-tables bluetooth branding bzip2 cairo cdr clamav cleartype cli consolekit cracklib crypt cups curl custom-cflags dbus dhcp directfb dovecot-sasl dri dts dvd dvdr eds emboss encode esd evo extras faac faad fam fbcon fbcondecor ffmpeg firefox flac fontconfig fontforge fortran fuse gd gdbm geoip gif git gmp gnome gnutls gpm graphviz gsm gstreamer gtk hal hddtemp iconv icotools icu idn ieee1394 imagemagick iproute2 ipv6 isdnlog ithreads jack java jpeg jpeg2k justify kde kde3 kdehiddenvisibility kerberos lame lcms ldap libcaca libnotify lm_sensors lzma mad matroska mikmod mmx mng modules mp3 mp4 mpeg mplayer mudflap multilib multipath mysql mysqli ncurses nls nptl nptlonly nsplugin nvidia ogg openal openexr opengl openmp oss pam pango pch pcre pdf perl pg-intdatetime plugins png policykit postgres ppds pppd pulseaudio python qt3support qt4 quicktime rcc readline realms reflection replytolist restrict-javascript rle rrdtool samba sasl schroedinger sdl session sip slang smbclient sndfile snmp socks5 sound spamassassin spell spl sql sqlite sse sse2 ssh ssl startup-notification subversion svg swat symlink sysfs syslog tcl tcpd theora threads thunar tiff tk tools truetype unicode urandom usb utf utf8 v4l v4l2 vdpau vhosts video vorbis wav webdav webkit win64 winetools x264 xattr xcb xcomposite xinerama xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_alias cern_meta charset_lite dumpio log_forensic proxy_ftp version actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias asis substitute" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ro en en_GB" LIRC_DEVICES="hauppauge" NETBEANS_MODULES="apisupport harness ide java nb cnd groovy gsf identity j2ee mobility php profiler soa visualweb webcommon websvccommon xml dlight ergonomics ruby enterprise" USERLAND="GNU" VIDEO_CARDS="nv nvidia" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

```

Any help it's very appreciated. Thank you!

----------

## sera

 *UberLord wrote:*   

>  *sera wrote:*    *UberLord wrote:*   
> 
> Again no, scripts should be portable across kernels and tools where possible.
> 
> I see no benefit in ignoring ifconfig for this  
> ...

 

I wasn't actually talking about splitting the configuration but the script. Using "/etc/ifconfig.eth0" doesn't feel natural enough for my taste anyway.  :Smile:  However, I guess the second argument of neater config files dies with that.

Something else I was wondering. You add two routes for the loopback interface where one ends up unreachable. Neither the old script nor the BSD path do this. Seems like I can't find the answer without already knowing it. At lest the search engines let me down on this matter.

----------

## Etal

I've began playing with the new network setup, and I am a complete newbie when it comes to networking because it "just worked" and I never bothered to figure out how exactly how...

So, if I want to connect to the wired network using DHCP, is this really the only thing that needs to be run?

```
dhcpcd eth0
```

(That's basically the content of /etc/init.d/dhcpcd)

So if I use DHCP, there's no need to run ifconfig, route or resolvconf? Is it really that simple, or am I going to find a nasty surprise later on? Is this all that it boils down to?  :Shocked: 

----------

## UberLord

Yes, it's that simple.

Just add dhcpcd to the default runlevel to get it to start automatically  :Smile: 

----------

## JC99

 *AM088 wrote:*   

> ... it "just worked"

 

Yeah, me too. I installed openrc-0.5-r1, ran etc-update, rebooted and everything "just worked"

...of course this makes me wonder whats going on. /etc/conf.d/network just contains examples of how to do things, it doesn't actually have anything in it that configures stuff and my /etc/init.d/net.ethx don't look like that script pappy_mcfae posted(On page 2 of this thread). I don't have dhcpcd-5 installed and I guess I don't need it cause I have a static IP?

----------

## pappy_mcfae

Actually, I noticed that if there isn't a script, or if openrc thinks there isn't a script, it will just set up for dhcp. I found that out because openrc has a bone against calling the script net.eth0. I had done an update to openrc -0.5.1-r1, and the net.eth0 script was renamed to something else, and the machine reset itself for old style networking. 

Should I say it tried. When the machine couldn't find an acceptable script, it started a dhcp session instead. I've fixed the issue by calling the script eth0. Openrc doesn't seem to have a problem with that, at least on a reemerge of openrc -0.5.1-r1.

This is really fascinating stuff.

And yes, once everything is in place, it does just work. That's just too cool.

<edit>The above assumption is incorrect. The /etc/init.d/dhcpcd script has to be placed in /etc/runlevel/default in order for dhcp operation to occur. If there is no script like the one I show in a previous posting in this thread, or the dhcp script set in /etc/runlevels/default, there will be no network operation besides lo. I have verified this operation on two different machines.</edit>

Blessed be!

Pappy

----------

## platojones

 *EvilEye wrote:*   

>  *AM088 wrote:*   ... it "just worked" 
> 
> Yeah, me too. I installed openrc-0.5-r1, ran etc-update, rebooted and everything "just worked"
> 
> ...of course this makes me wonder whats going on. /etc/conf.d/network just contains examples of how to do things, it doesn't actually have anything in it that configures stuff and my /etc/init.d/net.ethx don't look like that script pappy_mcfae posted(On page 2 of this thread). I don't have dhcpcd-5 installed and I guess I don't need it cause I have a static IP?

 

Well, I guess I'll let Roy answer this...I'll just say that I have a very simple network setup (static IP with one wired interface) using the old net.ethX script linked to net.lo.  When I upgraded to the latest baselayout and openrc, ran etc-update and rebooted, everything worked exactly as before.  So, I suspect the the /etc/conf.d/network config file only comes into play for more sophisticated network setups.

----------

## UberLord

 *platojones wrote:*   

> Well, I guess I'll let Roy answer this...I'll just say that I have a very simple network setup (static IP with one wired interface) using the old net.ethX script linked to net.lo.  When I upgraded to the latest baselayout and openrc, ran etc-update and rebooted, everything worked exactly as before.  So, I suspect the the /etc/conf.d/network config file only comes into play for more sophisticated network setups.

 

I suspect that you have both the old and the new style installed. This means that you effectively continue to use the old style until you manually change to the new style. And no, it's for less sophisticated setups  :Smile: 

----------

## UberLord

 *pappy_mcfae wrote:*   

> Actually, I noticed that if there isn't a script, or if openrc thinks there isn't a script, it will just set up for dhcp. I found that out because openrc has a bone against calling the script net.eth0. I had done an update to openrc -0.5.1-r1, and the net.eth0 script was renamed to something else, and the machine reset itself for old style networking. 
> 
> Should I say it tried. When the machine couldn't find an acceptable script, it started a dhcp session instead. I've fixed the issue by calling the script eth0. Openrc doesn't seem to have a problem with that, at least on a reemerge of openrc -0.5.1-r1.
> 
> 

 

You're mixing things.

OpenRC has no bone about calling something net.eth0 as that's a designated name for the old style scripts.

The new style init script network handles ALL interfaces statically at once, therefore giving it an interface name is wrong.

And yes, the old style scripts do default to DHCP if nothing configured. New style does not do this (no dhcp stuff!).

 *Quote:*   

> This is really fascinating stuff.
> 
> And yes, once everything is in place, it does just work. That's just too cool.
> 
> 

 

Glad you think so  :Smile: 

----------

## platojones

 *Quote:*   

> I suspect that you have both the old and the new style installed. This means that you effectively continue to use the old style until you manually change to the new style. And no, it's for less sophisticated setups 

 

Oh, ok...yep.  So, if I want to easily move to the new config style, I just need to remove the /etc/init.d/net.ethX from the default runlevel and remove the symlink, then comment out the /etc/conf.d/net config file and put the ifconfig info in /etc/conf.d/networks?  Should I put anything into the default runlevel for networking (I[/quote]'ve already got net.lo there)? 

I like to completely convert to the new way of doing things when I do an upgrade like this.

----------

## JC99

 *platojones wrote:*   

> I'll just say that I have a very simple network setup (static IP with one wired interface) using the old net.ethX script linked to net.lo.  When I upgraded to the latest baselayout and openrc, ran etc-update and rebooted, everything worked exactly as before.

 

For me eth0 has a static ip. eth1 is wired and connects to my network. I guess I have both the old way and new way of networking installed (openrc-0.5.1-r1 is installed) but am using the old way. I am not sure how to make the switch to the new way so I guess I will just wait until an official guide comes out on how to make the switch (My server does all the IP masquerading so if the internet in my house is down for too long my mom and brother start yelling at me to get it working.).

It is not as important that I get the other stuff I have installed working properly right away (A wireless card setup as a wireless access point and a bridge).

----------

## Ant P.

Do we need to do anything to get IPv6 working with the new stuff, or will it just work like before?

----------

## Etal

 *UberLord wrote:*   

> Yes, it's that simple.
> 
> Just add dhcpcd to the default runlevel to get it to start automatically 

 

Awesome!   :Very Happy: 

----------

## d2_racing

I have a quick question : How can I configure my wireless card that use dhcp instead of a static IP ?

I only found that:

```

#!/sbin/runscript

#!/sbin/runscript                                                             

#copyright 2009 Funtoo Technologies, LLC                                       

# All rights reserved. Released under the 2-clause BSD license.               

IP=192.168.0.5

NM=255.255.255.0

GW=192.168.0.5

INT=wlan0       

DOM=exemple.org         

NS1=0.0.0.0

NS2=0.0.0.0

WPA=/etc/wpa_supplicant/wpa_supplicant.conf

depend() {

        provide net

        after net.lo

}

start() {

        ebegin "Bringing up network interface $INT"

        ifconfig $INT $IP netmask $NM up && \

        route add default gw $GW $INT &&\

        resolvconf -a $INT << EOF

nameserver $NS1

nameserver $NS2

EOF

        wpa_supplicant -i$INT -c$WPA  -Dwext -B

        eend $?

}

stop() {

        ebegin "Shutting down network interface $INT"

        resolvconf -d $INT &&\

        route del default gw $GW $INT &&\

        ifconfig $INT down

        rm /var/run/wpa_supplicant/$INT

        eend $?

}

```

So do I have to create only a script file for wlan0 and only use this :

```

#!/sbin/runscript

INT=wlan0      

GW=192.168.0.5  

WPA=/etc/wpa_supplicant/wpa_supplicant.conf

depend() {

        provide net

        after net.lo

}

start() {

        ebegin "Bringing up network interface $INT"

        ifconfig $INT $IP netmask $NM up && \

        route add default gw $GW $INT &&\

        resolvconf -a $INT << EOF

        wpa_supplicant -i$INT -c$WPA  -Dwext -B

        eend $?

}

stop() {

        ebegin "Shutting down network interface $INT"

        resolvconf -d $INT &&\

        route del default gw $GW $INT &&\

        ifconfig $INT down

        rm /var/run/wpa_supplicant/$INT

        eend $?

}

```

----------

## d2_racing

Ok I see sera  :Razz: 

1. 

```

# cd /tmp

# tar xvjpf /usr/portage/distfiles/openrc-0.5.1.tar.bz2

# cd openrc-0.5.1/init.d.misc

# make

# install wpa_supplicant /etc/init.d 

```

2.

```

# nano /etc/conf.d/wpa_supplicant

wpa_supplicant_conf="/etc/wpa_supplicant/wpa_supplicant.conf"

wpa_supplicant_if="wlan0"

```

So, if I want to start manually my wireless card, I only run this :

```

# /etc/init.d/wpa_supplicant start

```

Basically, all the scripts are use when you use Ip static or a wireless device. For the rest, if you are using a lan card with dhcp, then you don't even have to bother to create some scripts.

Am I right ?

----------

## Mike Hunt

I'm not sure, can you configure that in /etc/dhcpcd.conf instead of a script? 

```
allowinterfaces wlan0
```

----------

## pappy_mcfae

Actually, when I removed the script from /etc/runlevel/default, I got no net start-up at all. No dhcp. Using the command /etc/init.d/eth0 start started the net. 

Let me do a bit more research (like looking at the scripts), and I'll get back to you on this.

BB!

P

----------

## Mike Hunt

I don't use any script. Nothing in runlevels.

There is only net.lo which belongs to openrc.

My static IP is configured in /etc/dhcpcd.conf (see man dhcpcd.conf)

That's it.  :Smile: 

----------

## pappy_mcfae

Mike Hunt,

If you're using the old networking setup, that is very true. However, with the new scripted networking setup with openec-0.5 and above, you would at least have to have /etc/runlevels/boot/network and /etc/runlevels/default/dhcpcd to get the new setup to work for dhcpcd. 

d2_racing,

It looks like you use the entire wpa_supplicant script, AND, you'd also have to follow that with either the dhcpcd script (for dhcp), or use a script similar to what I have above with with INT=wlan0 instead of INT=eth0.

Blessed be!

Pappy

----------

## sera

 *d2_racing wrote:*   

> Basically, all the scripts are use when you use Ip static or a wireless device. For the rest, if you are using a lan card with dhcp, then you don't even have to bother to create some scripts.
> 
> Am I right ?

 

You can even set static ip's with dhcpcd this days. Alternatively you can set it in /etc/conf.d/network or create an own script for it. Having it in a separate script means you do not have to start it together with the lo interface as you want it for the wlan to be the case.

I'd say the network and wpa_supplicant script are enough for 95% of the people.

I'd would be possible to set up the wlan in network but far more complicated then adding the wpa_supplicant script.

I guess the simplest approach is to use network to bring the ethernet interfaces up.

Use the wpa_supplicant script for wireless.

Use dhcpcd to configure static and dynamic ip's.

ps: yes, /etc/init.d/wpa_supplicant start  instead of  adding it to a runlevel works.

----------

## d2_racing

Ok now I know how to manage a Wifi connexion using a dhcp, now if I want to manage my eth0 interface like in the old days, do I need to setup a script ?

Because, if I use dhcpcd without any config for my e1000 lan card, how do I manage it to actually stop it when I want to start my wireless connexion ?

If someone can tell me that, I think that I will be able to complete the Wiki with Pappy  :Razz: 

----------

## sera

 *d2_racing wrote:*   

> Because, if I use dhcpcd without any config for my e1000 lan card, how do I manage it to actually stop it when I want to start my wireless connexion ?

 

What to you mean by stopping? Bringing the interface down? If so this hardly matters for power consumption (unlike wifi) so why would you want that anyway?

 *d2_racing wrote:*   

> now if I want to manage my eth0 interface like in the old days, do I need to setup a script

 

What have you done beside brining the interface up at startup and bringing it down at shutdown?

The only thing which might be useful and is so far unmentioned is enabling the rf-switch for wifi. As I don't have use for it myself here an untested approach to do so:

Add the following to /etc/udev/rules.d/90-network.rules:

```

KERNEL=="wlan0", ACTION=="add",   RUN+="/etc/init.d/wpa_supplicant start"

KERNEL=="wlan0", ACTION=="remove",  RUN+="/etc/init.d/wpa_supplicant stop"

```

Remove wpa_supplicant from any runlevel.

----------

## Mike Hunt

 *pappy_mcfae wrote:*   

> ... with the new scripted networking setup with openec-0.5 and above, you would at least have to have /etc/runlevels/boot/network and /etc/runlevels/default/dhcpcd to get the new setup to work for dhcpcd. 

 

Yes, my mistake. I did indeed add dhcpcd to the default runlevel. 

But there is no network in the boot runlevel

```
# eselect rc show boot          

Status of init scripts in runlevel "boot" 

  alsasound                 [started]     

  bootmisc                  [started]     

  fsck                      [started]

  hostname                  [started]

  hwclock                   [started]

  keymaps                   [started]

  localmount                [started]

  lvm                       [started]

  modules                   [started]

  mtab                      [started]

  procfs                    [started]

  root                      [started]

  swap                      [started]

  sysctl                    [started]

  termencoding              [started]

  udev-postmount            [started]

  urandom                   [started]

```

This is with openrc-0.5.0-r2 btw.

----------

## sera

Mike Hunt,

what returns 

```
route
```

 for you?

----------

## Mike Hunt

sera,

```
# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.2.0     *               255.255.255.0   U     202    0        0 eth0

loopback        *               255.0.0.0       U     0      0        0 lo

default         mymodem         0.0.0.0         UG    202    0        0 eth0
```

----------

## sera

Do you have network in the default runlevel or another for that matter?

----------

## Mike Hunt

No, not likely  :Smile:  

```
# stat /etc/init.d/network

stat: cannot stat `/etc/init.d/network': No such file or directory
```

----------

## sera

 *Mike Hunt wrote:*   

> No, not likely  
> 
> ```
> # stat /etc/init.d/network
> 
> ...

 

Are you actually on gentoo? What brings your loopback interface up. Have you some leftovers of the old net stuff around which might be called?

Edit: I've overred  *Quote:*   

> There is only net.lo which belongs to openrc. 

 

This is the old networking. Probably there is a symlink to it named net.eth0 and udev starts the interface for you as in the old days.

----------

## Mike Hunt

the only net.* in /etc/init.d is the new net.lo which is started by openrc

```
# cat net.lo

#!/sbin/runscript

# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>

# All rights reserved. Released under the 2-clause BSD license.

depend() {

        provide net

}

start() {

        ebegin "Bringing up network interface lo"

        ifconfig lo 127.0.0.1 netmask 255.0.0.0 up && \

        route add -net 127.0.0.0 netmask 255.0.0.0 dev lo

        eend $?

}

stop() {

        ebegin "Shutting down network interface lo"

        route del -net 127.0.0.0 netmask 255.0.0.0 dev lo &&

        ifconfig lo down

        eend $?

}

```

It looks to me like dhcpcd takes care of all the rest automatically now. 

this is dhcpcd-5.1.2-r1 openrc-0.5.0-r2 and openresolv-3.3.2 on funtoo btw. Does that make a difference?

----------

## sera

The net.lo script which I still have here is about 15k. On Gentoo net.lo is the dedicated name for the AllInOneSuperDuperMegaNetworkScript which is supposed to be replaced.

Your net.lo is included in our network init script. About the eth0 interface I don't know what is responsible in your case.

----------

## Mike Hunt

My eth0 interface connects my computer nic to the modem - just like before. What else could it be?

My understanding is, now net.lo only performs the task of setting up the lo interface, and nothing else. And dhcpcd handles everything else automatically that does not require special commands.

In my case I use a static IP, so it is configured in /etc/dhcpcd.conf, 

```
interface eth0

static ip_address=192.168.2.10

static routers=192.168.2.1

static domain_name_servers=192.168.2.1

```

hence my question about configuring the wlan0 interface in /etc/dhcpcd.conf - but I don't know if this is correct, it's just a guess 

```
allowinterfaces wlan0
```

cheers.  :Smile: 

----------

## sera

 *Mike Hunt wrote:*   

> My eth0 interface connects my computer nic to the modem - just like before. What else could it be?

 

With responsible I mean what is actually calling "ifconfig eth0 up".

 *Quote:*   

> My understanding is, now net.lo only performs the task of setting up the lo interface, and nothing else.

 

The net.lo script you posted does only that, yes. Funtoo differs here from gentoo.

 *Quote:*   

> And dhcpcd handles everything else automatically that does not require special commands.

 

Yeah, most beside brining up the interface itself.

 *Quote:*   

> In my case I use a static IP, so it is configured in /etc/dhcpcd.conf, 
> 
> ```
> interface eth0
> 
> ...

 

This is a good example on how to set up a static configuration.

 *Quote:*   

> hence my question about configuring the wlan0 interface in /etc/dhcpcd.conf - but I don't if this is correct, it's just a guess 
> 
> ```
> allowinterfaces wlan0
> ```
> ...

 

You configure the wlan part of dhcp as you do with ethernet. There is no difference.

allowinterfaces wlan0 tells dhcpcd to only manage wlan0 and ignore all other interfaces.

I suspect udev for brining up your interfaces. You might want to have a look into the udev rules on your system.

----------

## d2_racing

 *sera wrote:*   

>  What to you mean by stopping? Bringing the interface down? If so this hardly matters for power consumption (unlike wifi) so why would you want that anyway?
> 
> 

 

I mean, I'm at home on my lazyboy on the net, so I have started /etc/init.d/wpa_supplicant start and I going back to my office on the third floor, so basically, I may want to disable my wireless connection to actually use my lan cable.

So how do I renew my IP adress with my lan interface eth0 ? Does dhcpcd do it automagically ? Or, maybe the best is to use WICD ?

----------

## Mike Hunt

 *sera wrote:*   

> 
> 
> ```
> allowinterfaces wlan0
> ```
> ...

 

According to man dhcpcd.conf that is what "interface" does. Subsequent options are only parsed for this interface.

 *sera wrote:*   

> I suspect udev for brining up your interfaces. You might want to have a look into the udev rules on your system.

 

In fact, yes it looks that way.

```
# cat /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.

# PCI device 0x14e4:0x1677 (tg3)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<mac address>", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
```

That's with sys-fs/udev-135-r9 btw.

My apologies if I caused any confusion.  :Smile: 

----------

## sera

 *Mike Hunt wrote:*   

> According to man dhcpcd.conf that is what "interface" does. Subsequent options are only parsed for this interface.

 

The interface keyword is to create sections for the different interfaces. They start at the keyword interface and end before the next keyword interface or at EOF.

allowinterfaces and denyinterfaces are global withe- resp. blacklists.

 *Quote:*   

> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<mac address>", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"[/code]

 

That's not it, this line is only to make sure a certain nic always gets the same interface name. Useful in case of multiple nics.

----------

## Mike Hunt

This is what I have in the /etc/udev/rules.d folder

```
64-device-mapper.rules  70-persistent-cd.rules   98-devkit.rules

70-libgphoto2.rules     70-persistent-net.rules

70-libsane.rules        90-hal.rules
```

I don't see anywhere else eth0 is started except dhcpcd - I did grep -r eth0 /etc/* - this is all there is

```
# grep '^[^#]' /etc/dhcpcd.conf

hostname

option domain_name_servers, domain_name, domain_search, host_name

option ntp_servers

option interface_mtu

require dhcp_server_identifier

nohook lookup-hostname

interface eth0

static ip_address=192.168.2.10

static routers=192.168.2.1

static domain_name_servers=192.168.2.1
```

----------

## sera

 *d2_racing wrote:*   

> So how do I renew my IP adress with my lan interface eth0 ? Does dhcpcd do it automagically ? Or, maybe the best is to use WICD ?

 

Just plugging in the network cable should give you a lease. Dhcpcd is supposed to do all for you here.

----------

## sera

 *Mike Hunt wrote:*   

> This is what I have in the /etc/udev/rules.d folder
> 
> ```
> 64-device-mapper.rules  70-persistent-cd.rules   98-devkit.rules
> 
> ...

 

I see you have devkit, this might be the reason for your magically brought up interface.

Better grep for net in /etc/udev/rules.d.

----------

## Mike Hunt

Oooh magical, cool   :Cool:  

```
# grep '^[^#].*net' /etc/udev/rules.d/*

/etc/udev/rules.d/70-persistent-net.rules:SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<mac address>", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
```

A deeper search gives these perhaps relevant lines

/etc/conf.d/udev:persistent_net="yes"

/etc/init.d/udevd:              udevadm trigger --subsystem-match=net

```
# cat /etc/udev/rules.d/98-devkit.rules

# pass all events to the DeviceKit daemon

RUN+="socket:/var/run/devkit/udev_socket"

```

----------

## sera

You could remove device-kit from any runlevel and restart your machine for a simple test.

----------

## d2_racing

 *Mike Hunt wrote:*   

> 
> 
> In my case I use a static IP, so it is configured in /etc/dhcpcd.conf, [code]interface eth0
> 
> static ip_address=192.168.2.10
> ...

 

So, what is the best method to do static IP then ? Using the script or using the dhcpcd.conf ?Last edited by d2_racing on Tue Oct 20, 2009 11:58 am; edited 1 time in total

----------

## Mike Hunt

 *d2_racing wrote:*   

> So, what is the best method to do static IP then ? Using the script or using the dhcpcd.conf ?

 

I'm not sure. I think (and/or hope) that it's what we are trying to figure out here. On my box it all works "magically", but it isn't quite clear yet why and how.Last edited by Mike Hunt on Mon Oct 19, 2009 8:03 pm; edited 2 times in total

----------

## d2_racing

That's why we need Roy to look at that actually.

----------

## Mike Hunt

In fact, I only did what UberLord said and it works "magically".   :Cool: 

----------

## pappy_mcfae

 *Mike Hunt wrote:*   

>  *pappy_mcfae wrote:*   ... with the new scripted networking setup with openec-0.5 and above, you would at least have to have /etc/runlevels/boot/network and /etc/runlevels/default/dhcpcd to get the new setup to work for dhcpcd.  
> 
> Yes, my mistake. I did indeed add dhcpcd to the default runlevel. 
> 
> But there is no network in the boot runlevel
> ...

 

Assumption number ten-million: I believe the presence of dhcpcd in /etc/runlevels/default will not only bring up itself, it would naturally have to bring up /etc/init.d/network as well. I will test that later, after I test the wpa_supplicant script.

Blessed be!

Pappy

----------

## Mike Hunt

 *pappy_mcfae wrote:*   

> I believe the presence of dhcpcd in /etc/runlevels/default will not only bring up itself, it would naturally have to bring up /etc/init.d/network as well. I will test that later, after I test the wpa_supplicant script.
> 
> Blessed be!
> 
> Pappy

 

I'm not quite sure about that: 

```
# stat /etc/init.d/network

stat: cannot stat `/etc/init.d/network': No such file or directory
```

----------

## sera

Seems even newer versions of dhcpcd bring up the interfaces themselves. Amazing.  :Very Happy: 

So no need to search any further. 

The wlan0 interface is brought up too. Still the wpa_supplicant script is needed unless you choose to go with iwconfig.

----------

## pappy_mcfae

Using the new networking, here is what I found. 

Yes, you need the wpa_supplicant script along with either the dhcpcd script or a script like the one I showed earlier. If you are using an unprotected AP (not a good idea), you don't need the wpa_supplicant script. This has been tested. Now, I'll eliminate /etc/runlevels/network, and see if the scripting still works.

There is no such thing as magic. Take that from a self-identified witch.

Blessed be!

Pappy

----------

## pappy_mcfae

On the question of whether or not /etc/init.d/network needs to be in /etc/runlevels/boot, the answer is, "yes." However, using net.lo at the same point will also work. The new networking does work with net.lo if /etc/init.d/network is non-existent, or un-started.

So, once again, there is no magic. 

Blessed be!

Pappy

----------

## sera

 *d2_racing wrote:*   

>  *Mike Hunt wrote:*   
> 
> In my case I use a static IP, so it is configured in /etc/dhcpcd.conf, [code]interface eth0
> 
> static ip_address=192.168.2.10
> ...

 

It's more a question of personal preferences. If you are using dhcpcd anyway I'd set it in dhcpcd.conf otherwise in network, no additional script needed.

----------

## d2_racing

If we refer to the Funtoo doc, then we should use the script.

----------

## sera

 *d2_racing wrote:*   

> If we refer to the Funtoo doc, then we should use the script.

 

As we learned in this thread Funtoo is not the same as Gentoo. Thy have a specialized loopback init script called net.lo, not to be confused with our net.lo.

Network on Gentoo is also to bring up the loopback interface but has a little more functionality on top. You can set routes, static IPs, create bridges and other things.

So unlike Gentoo, Funtoo really needs a separate script if not using dhcpcd.

----------

## d2_racing

Right now, I'm using OpenRc 0.5.2 without any net.lo,net.eth0 and you were right, dhcpcd is acting like ifplugd.

I have a valid dhcp adress when I plug my net cable and when I play with it, I have a new release of IP adress, so it's working pretty good.

And Wicd is working pretty well also with the new method too.

----------

## sera

 *d2_racing wrote:*   

> Right now, I'm using OpenRc 0.5.2 without any net.lo,net.eth0 and you were right, dhcpcd is acting like ifplugd.

 

That's another nice aspect of the new networking, ifplugd became obsolete.

----------

## d2_racing

In fact, I only need to test the wpa_supplicant script and I think that we will be go to go on writing a nice Wiki here  :Razz: 

----------

## pappy_mcfae

 *sera wrote:*   

>  *d2_racing wrote:*   If we refer to the Funtoo doc, then we should use the script. 
> 
> As we learned in this thread Funtoo is not the same as Gentoo. Thy have a specialized loopback init script called net.lo, not to be confused with our net.lo.

 

How did we learn this? Having two out of four machines running on funtoo stage3 tarballs, I can say this is false. If you are going to use openrc-0.5.0 or greater, then there is no distinction between Funtoo and Gentoo. 

The new networking setup isn't as picky as the old. It will run with net.lo, or it will run with network. One can't tell the actual difference once the network is up and running.

 *Quote:*   

> Network on Gentoo is also to bring up the loopback interface but has a little more functionality on top. You can set routes, static IPs, create bridges and other things.
> 
> So unlike Gentoo, Funtoo really needs a separate script if not using dhcpcd.

 

No. Once again, you see a distinction where none exists. I defy anyone to look at my machines and tell me which ones were born of Gentoo tarballs, and which ones were born of Funtoo tarballs. It can't be done!

There are a number of scripts available that allow for all of the above, and then some. I provided the tarball with these scripts. And while these changes may have begun with Funtoo, with proper use of the scripts, your Gentoo install can become a Funtoo install, at least networking wise.

I heartily suggest you do some research on your own. Experiment, don't just buy into the assumptions of others.

Blessed be!

Pappy

----------

## sera

Mike Hunt is using Funtoo, he doesn't have a script "network" and the content of his net.lo is completely different. I believe Mike here. Not just because he would have had to fake some of the output he presented in this thread.

With a lot of fuss I can also make a debian out of my gentoo that's not an argument.

Using the Gentoo net.lo defeats the purpose of this changes.

----------

## d2_racing

In fact, he has this file /etc/init.d/net.lo and on my Gentoo box, I don't have any and it's working since I can write on this forum  :Razz: 

----------

## d2_racing

He needs that file because of sshd and other network services.

----------

## Mike Hunt

The internet (eth0) still works without any scripts except /etc/dhcpcd.conf. 

net.lo sets up the lo interface that is needed by the networked services:

```
# mv /etc/init.d/net.lo /root

`/etc/init.d/net.lo' -> `/root/net.lo'

# rc

* Caching service dependencies...

Service `cherokee' needs non existant service `net'

Service `fetchmail' needs non existant service `net'

Service `git-daemon' needs non existant service `net'

Service `netmount' needs non existant service `net'

Service `ntp-client' needs non existant service `net'

Service `ntpd' needs non existant service `net'

Service `openvpn' needs non existant service `net'

Service `pydoc-2.6' needs non existant service `net'

Service `samba' needs non existant service `net'

Service `saslauthd' needs non existant service `net'

Service `slapd' needs non existant service `net'

Service `slpd' needs non existant service `net'

Service `spawn-fcgi' needs non existant service `net'

Service `squid' needs non existant service `net'

Service `sshd' needs non existant service `net'

Service `svnserve' needs non existant service `net'
```

So without the net.lo script all those services will fail to start at boot.

Just for the record, here it is again:

```
# cat /etc/init.d/net.lo

#!/sbin/runscript

# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>

# All rights reserved. Released under the 2-clause BSD license.

depend() {

        provide net

}

start() {

        ebegin "Bringing up network interface lo"

        ifconfig lo 127.0.0.1 netmask 255.0.0.0 up && \

        route add -net 127.0.0.0 netmask 255.0.0.0 dev lo

        eend $?

}

stop() {

        ebegin "Shutting down network interface lo"

        route del -net 127.0.0.0 netmask 255.0.0.0 dev lo &&

        ifconfig lo down

        eend $?

}
```

----------

## d2_racing

Are you running on Gentoo or on Funtoo ?

----------

## d2_racing

The French version of the Wiki is here : http://gentoo-quebec.org/wiki/index.php/500-Entretien:Migration_vers_openrc_0.5.x_Gentoo

----------

## pappy_mcfae

Written by yours truly! 

BB!

P

----------

## d2_racing

In fact, I wrote that one with Pappy and with the examples and all the stuff from this thread actually.

So, it's the first French doc at least for now.

----------

## d2_racing

About the static script :

```

#!/sbin/runscript 

# Copyright 2009 Funtoo Technologies, LLC 

# All rights reserved. Released under the 2-clause BSD license. 

IP=192.168.0.130 

NM=255.255.255.0 

GW=192.168.0.1 

INT=eth0 

DOM=no.org 

NS1=65.68.49.50 

NS2=65.68.49.51 

NS3=192.168.0.1 

depend() { 

        provide net 

        after net.lo 

} 

start() { 

        ebegin "Bringing up network interface $INT" 

        ifconfig $INT $IP netmask $NM up && \ 

        route add default gw $GW $INT && \ 

        resolvconf -a $INT << EOF 

domain $DOM 

nameserver $NS1 

nameserver $NS2 

nameserver $NS3 

EOF 

        eend $? 

} 

stop() { 

        ebegin "Shutting down network interface $INT" 

        resolvconf -d $INT && \ 

        route del default gw $GW $INT && \ 

        ifconfig $INT down 

        eend $? 

} 

```

I think that "after net.lo"  should be replace by "after network" since net.lo doesn't exist anymore on Gentoo ?

Can someone test that actually on Gentoo, I think that the script use net.lo since Funtoo use it.

----------

## jfp

I don't understand the comment

 *Quote:*   

>  think that "after net.lo" should be replace by "after network" since net.lo doesn't exist anymore on Gentoo ?

 

```
zippy ~ # equery belongs net.lo

[ Searching for file(s) net.lo in *... ]

sys-apps/openrc-0.5.2-r1 (/usr/share/openrc/net.lo -> /etc/init.d/net.lo)

sys-apps/openrc-0.5.2-r1 (/etc/init.d/net.lo)

```

It would seem that it "belongs" in Gentoo if you are using openRC. This item was one of the things I didn't quite understand in the wiki. (Thanks very much for that by the way)

----------

## sera

 *d2_racing wrote:*   

> 
> 
> I think that "after net.lo"  should be replace by "after network" since net.lo doesn't exist anymore on Gentoo ?
> 
> 

 

Nicely spotted. Yes, this should be changed.

----------

## sera

 *jfp wrote:*   

> It would seem that it "belongs" in Gentoo if you are using openRC. This item was one of the things I didn't quite understand in the wiki. (Thanks very much for that by the way)

 

You still have the net.lo script in Gentoo but it won't be used with the new networking.

----------

## d2_racing

Good, so Pappy will edit his post then  :Razz: 

----------

## Kaste

Hi guys

I tried following all the clues in here but I'm somewhat confused. I have a laptop i try to run under openrc. I need to check first if i get a dhcp server on eth0 (one network) then ping some gateways to figure out which of the static networks I'm on (2 others) and then if that doesn't work start wlan (a few others). 

Is this possible at all with openrc without too much fuss and if so how would i go about it?

Greets.

----------

## pappy_mcfae

There really isn't a need. Even if net.lo doesn't exist, the script will start and run properly. While it might be considered more correct to change the script, the fact that I have networking on my openrc machines means that there isn't an issue leaving things as is.

If someone else wishes to change the script and see if things still work, that's fine. For me, I've done enough research with the new networking setup that I am confident it works, even after the oldnet USE flag was removed, and after a few updates to openrc, and a few dozen reboots.

Blessed be!

Pappy

----------

## pappy_mcfae

 *Kaste wrote:*   

> Hi guys
> 
> I tried following all the clues in here but I'm somewhat confused. I have a laptop i try to run under openrc. I need to check first if i get a dhcp server on eth0 (one network) then ping some gateways to figure out which of the static networks I'm on (2 others) and then if that doesn't work start wlan (a few others). 
> 
> Is this possible at all with openrc without too much fuss and if so how would i go about it?
> ...

 

Probably not. I made up a "simple" script to automatically set this machine for wired or wireless networking depending on whether or not the NIC cable is installed. That script took me a about a week to get right. It will not work with baselayout-2/openrc. 

If you already have a setup that works, and does these things, hold on to it for a bit. I have been considering seeing if I can update my script to the new networking. I have to be absolutely sure the new networking works...reliably, before I jump on that horse. 

BB!

P

----------

## UberLord

 *d2_racing wrote:*   

>  *Mike Hunt wrote:*   
> 
> In my case I use a static IP, so it is configured in /etc/dhcpcd.conf, [code]interface eth0
> 
> static ip_address=192.168.2.10
> ...

 

Whatever works best for you  :Smile: 

My preference is for dhcpcd.conf because it allows much more easily and dhcpcd-5 replaces a lot of the functionality provided by the old scripts.

----------

## Kaste

I have a bunch of scripts that i call depending on where i am at the moment and what connection i prefer in that place but they aren't automated in any way yet in a sense of detecting itself which one should be called. 

So i need to invest the energy anyway, i am just trying to figure out if i can integrate that stuff into openrc which i use anyway.

Do you think this is a major hack or not?

----------

## UberLord

 *Kaste wrote:*   

> I have a bunch of scripts that i call depending on where i am at the moment and what connection i prefer in that place but they aren't automated in any way yet in a sense of detecting itself which one should be called. 
> 
> So i need to invest the energy anyway, i am just trying to figure out if i can integrate that stuff into openrc which i use anyway.
> 
> Do you think this is a major hack or not?

 

Yes, it's a major hack and I think the only viable reason for it would be to save cycles on devices where power efficiency is king and very desperate.

I normally keep all services running on my laptop (like sshd) and it picks up new interfaces and addresses just fine.

Obviously, this is not so good for servers (like apache) but they tend to have static IPs anyway.

Even then, you could write a hook in /etc/dhcpcd.exit-hook to start/stop services depending on overall network state. See dhcpcd-run-hooks( :Cool:  for details.

----------

## Kaste

Well my particular problem is one of the networks where there is a dhcp and it will shell out an adress just fine but that one won't allow me to connect to the internet. I need to set a static Ip in that case and the only way i can think of to detect if i am in that network is pinging the gateway. Is it possible to do this with the dhcpcd hooks?

----------

## UberLord

 *Kaste wrote:*   

> Well my particular problem is one of the networks where there is a dhcp and it will shell out an adress just fine but that one won't allow me to connect to the internet. I need to set a static Ip in that case and the only way i can think of to detect if i am in that network is pinging the gateway. Is it possible to do this with the dhcpcd hooks?

 

No need for that! dhcpcd-5 handles arping profiles also. See this example

```

interface eth0

arping 192.168.1.1

profile 192.168.1.1

static ip_address=192.168.1.4/24

```

----------

## bestia

Hi, everyone! It's my first post, so I just wanted to say that I'm impressed by such a great Gentoo community!

Here's my problem. After upgrade to baselayout-2 and openrc even though I have no net.* in my runlevels my wireless comes up with information:

```

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

net.eth1          |* Bringing up interface eth1

net.eth1          |*   Starting wpa_supplicant on eth1...                                                                                           [ ok ]

net.eth1          |*   Starting wpa_cli on eth1...                                                                                                  [ ok ]

net.eth1          |*   Backgrounding ......

net.eth1          |* WARNING: net.eth1 has started, but is inactive

```

Everything works, but wpa_supplicant gui is showing info "could not get status from wpa_supplicant".

After reading a thread about OpenRC and the "new net" way I decided to switch to it and start up my wireless with the wpa_supplicant script.

What happens is that wpa_supplicant starts up but there's no network (using the same wpa_supplicant.conf as with "old net" way).

My /etc/conf.d/wpa_supplicant:

```

 BESTIA bin # cat /etc/conf.d/wpa_supplicant

wpa_supplicant_conf="/etc/wpa_supplicant/wpa_supplicant.conf"

wpa_supplicant_if="eth1"

```

And runlevels :

```

BESTIA ~ # rc-update -s                                                                                                                       

               procfs |                                           boot                                                                        

              keymaps |                                           boot                                                                        

              hwclock |                                           boot                                                                        

                 dbus | default                                                                                                               

                local | default                 nonetwork                                                                                     

           consolekit | default

         termencoding |                                           boot

              urandom |                                           boot

          consolefont |                                           boot

                 fsck |                                           boot

           localmount |                                           boot

                  xdm | default

               dhcpcd | default

             netmount | default

             hostname |                                           boot

                 hald | default

              network |                                           boot

            savecache |                shutdown

                 root |                                           boot

               sysctl |                                           boot

             mount-ro |                shutdown

                devfs |                                   sysinit

                 mtab |                                           boot

              modules |                                           boot

            killprocs |                shutdown

                 swap |                                           boot

                dmesg |                                   sysinit

             bootmisc |                                           boot

       wpa_supplicant | default

                 udev |                                   sysinit

```

I don't really know where to start from, and I'm bit new to Gentoo as well so please, be emphatic ;]

Cheers, Bestia

----------

## d2_racing

Hi, first, can you post this :

```

# cd /etc/conf.d && ls -la

# cd /etc/init.d && ls -la

# cat /etc/wpa_supplicant/wpa_supplicant.conf

# lspci -v

# cat /etc/udev/rules.d/70-persistent-net.rules

# lsmod

# ifconfig -a

# iwconfig

```

----------

## bestia

Sure!

```

BESTIA ~ # cd /etc/conf.d && ls -la                                                                                                           

total 200                                                                                                                                     

drwxr-xr-x  2 root root 4096 Nov 15 21:53 .                                                                                                   

drwxr-xr-x 70 root root 4096 Nov 16 18:47 ..                                                                                                  

-rw-r--r--  1 root root    0 Sep 15 13:13 .keep                                                                                               

-rw-r--r--  1 root root  156 Oct 24 18:23 acpid                                                                                               

-rw-r--r--  1 root root  874 Oct 24 18:23 alsasound                                                                                           

-rw-r--r--  1 root root  257 Oct 24 18:23 bluetooth                                                                                           

-rw-r--r--  1 root root  186 Nov 12 00:05 bootmisc                                                                                            

-rw-r--r--  1 root root  879 Nov 12 00:05 consolefont                                                                                         

-rw-r--r--  1 root root  412 Oct 24 18:23 crypto-loop                                                                                         

-rw-r--r--  1 root root   15 Oct 29 19:58 device-mapper                                                                                       

-rw-r--r--  1 root root 3141 Oct 24 18:23 dmcrypt                                                                                             

-rw-r--r--  1 root root  117 Nov 12 00:05 dmesg                                                                                               

-rw-r--r--  1 root root  426 Nov  8 23:53 dnsextd                                                                                             

-rw-r--r--  1 root root  372 Oct 24 18:23 env_whitelist                                                                                       

-rw-r--r--  1 root root  891 Nov 12 00:05 fsck                                                                                                

-rw-r--r--  1 root root  700 Nov  9 18:44 git-daemon                                                                                          

-rw-r--r--  1 root root  580 Oct 24 18:23 gpm                                                                                                 

-rw-r--r--  1 root root  119 Nov  5 03:44 hald                                                                                                

-rw-r--r--  1 root root   56 Oct 24 18:23 hostname                                                                                            

-rw-r--r--  1 root root  623 Oct 24 18:23 hwclock                                                                                             

-rw-r--r--  1 root root  795 Nov 12 00:05 keymaps                                                                                             

-rw-r--r--  1 root root  385 Nov 12 00:05 local                                                                                               

-rw-r--r--  1 root root  123 Oct 24 18:23 local.start                                                                                         

-rw-r--r--  1 root root  217 Oct 24 18:23 local.stop                                                                                          

-rw-r--r--  1 root root  121 Nov 12 00:05 localmount

-rw-r--r--  1 root root  173 Oct 29 19:58 lvm

-rw-r--r--  1 root root   67 Nov  8 23:53 mDNSResponderPosix

-rw-r--r--  1 root root 1072 Nov 15 00:28 modules

-rw-r--r--  1 root root 3273 Oct 24 18:23 mysql

-rw-r--r--  1 root root 1009 Oct 24 18:23 mysqlmanager

-rw-r--r--  1 root root  229 Nov  4 23:02 nas

-rw-r--r--  1 root root  381 Nov 15 21:53 net.old

-rw-r--r--  1 root root 2628 Nov 12 00:05 network

-rw-r--r--  1 root root  988 Oct 24 18:23 pciparm

-rw-r--r--  1 root root  330 Nov  2 16:33 pydoc-2.6

-rw-r--r--  1 root root  330 Oct 24 18:23 pydoc-3.1

-rw-r--r--  1 root root 8722 Oct 24 18:23 rc

-rw-r--r--  1 root root  617 Oct 29 23:30 rdate

-rw-r--r--  1 root root  149 Oct 24 18:23 rsyncd

-rw-r--r--  1 root root 1243 Nov  9 02:18 samba

-rw-r--r--  1 root root  926 Oct 24 18:23 saslauthd

-rw-r--r--  1 root root 2806 Oct 29 19:06 splash

-rw-r--r--  1 root root  396 Oct 24 18:23 sshd

-rw-r--r--  1 root root  112 Nov 12 00:05 staticroute

-rw-r--r--  1 root root  113 Oct 24 18:23 sysklogd

-rw-r--r--  1 root root 1764 Oct 25 12:08 udev

-rw-r--r--  1 root root  277 Nov 12 00:05 urandom

-rw-r--r--  1 root root   88 Nov 15 21:56 wpa_supplicant

-rw-r--r--  1 root root 1262 Nov 14 21:46 xdm

```

```

BESTIA conf.d # cd /etc/init.d && ls -la                                                                                                      

total 356                                                                                                                                     

drwxr-xr-x  2 root root  4096 Nov 16 12:03 .                                                                                                  

drwxr-xr-x 70 root root  4096 Nov 16 18:47 ..                                                                                                 

-rwxr-xr-x  1 root root   818 Oct 24 03:34 acpid                                                                                              

-rwxr-xr-x  1 root root  6231 Oct 13 01:44 alsasound                                                                                          

-rwxr-xr-x  1 root root  1171 Oct 13 03:21 bluetooth                                                                                          

-rwxr-xr-x  1 root root  3749 Nov 12 00:05 bootmisc                                                                                           

-rwxr-xr-x  1 root root  1188 Oct 12 18:33 checkfs                                                                                            

-rwxr-xr-x  1 root root  3226 Oct 12 18:33 checkroot                                                                                          

-rwxr-xr-x  1 root root  1672 Nov 12 00:05 consolefont                                                                                        

-rwxr-xr-x  1 root root   586 Nov  2 16:25 consolekit                                                                                         

-rwxr-xr-x  1 root root  1729 Oct 24 00:18 crypto-loop                                                                                        

-rwxr-xr-x  1 root root   286 Nov 14 16:30 cupsd                                                                                              

-rwxr-xr-x  1 root root  1152 Nov  2 15:53 dbus                                                                                               

lrwxrwxrwx  1 root root    21 Oct 12 14:55 depscan.sh -> ../../sbin/depscan.sh                                                                

-rwxr-xr-x  1 root root   797 Nov 12 00:05 devfs                                                                                              

-rwxr-xr-x  1 root root   682 Oct 29 19:58 device-mapper                                                                                      

-rwxr-xr-x  1 root root   327 Nov 16 12:03 dhcpcd                                                                                             

-rwxr-xr-x  1 root root   660 Oct 12 19:48 dmcrypt                                                                                            

-rwxr-xr-x  1 root root   317 Nov 12 00:05 dmesg                                                                                              

-rwxr-xr-x  1 root root   536 Oct 29 19:58 dmeventd                                                                                           

-rwxr-xr-x  1 root root   998 Nov  8 23:53 dnsextd                                                                                            

-rwxr-xr-x  1 root root  2950 Nov 12 00:05 fsck                                                                                               

lrwxrwxrwx  1 root root    23 Nov 12 00:05 functions.sh -> /lib/rc/sh/functions.sh                                                            

-rwxr-xr-x  1 root root   741 Nov  9 18:44 git-daemon                                                                                         

-rwxr-xr-x  1 root root   951 Oct 18 16:44 gpm                                                                                                

-rwxr-xr-x  1 root root  1187 Nov  5 03:44 hald                                                                                               

-rwxr-xr-x  1 root root  5606 Oct 12 18:33 halt.sh                                                                                            

-rwxr-xr-x  1 root root   376 Nov 12 00:05 hostname                                                                                           

-rwxr-xr-x  1 root root  2635 Nov 12 00:05 hwclock                                                                                            

-rwxr-xr-x  1 root root  1896 Nov 12 00:05 keymaps                                                                                            

-rwxr-xr-x  1 root root   392 Nov 12 00:05 killprocs                                                                                          

-rwxr-xr-x  1 root root   696 Nov 12 00:05 local                                                                                              

-rwxr-xr-x  1 root root  1765 Nov 12 00:05 localmount                                                                                         

-rwxr-xr-x  1 root root   759 Oct 29 19:58 lvm                                                                                                

-rwxr-xr-x  1 root root  1247 Nov  8 23:53 mDNSResponderPosix                                                                                 

-rwxr-xr-x  1 root root   845 Nov  8 23:53 mdnsd                                                                                              

-rwxr-xr-x  1 root root  1472 Nov 12 00:05 modules                                                                                            

-rwxr-xr-x  1 root root  1028 Nov 12 00:05 mount-ro                                                                                           

-rwxr-xr-x  1 root root   907 Nov 12 00:05 mtab                                                                                               

-rwxr-xr-x  1 root root 10661 Oct 12 23:55 mysql                                                                                              

-rwxr-xr-x  1 root root  6632 Oct 12 23:55 mysqlmanager                                                                                       

-rwxr-xr-x  1 root root   557 Nov  4 23:02 nas                                                                                                

lrwxrwxrwx  1 root root     6 Oct 12 14:53 net.eth0 -> net.lo                                                                                 

lrwxrwxrwx  1 root root     6 Oct 15 17:08 net.eth1 -> net.lo                                                                                 

-rwxr-xr-x  1 root root 15143 Nov 12 00:05 net.lo                                                                                             

-rwxr-xr-x  1 root root  2031 Nov 12 00:05 netmount                                                                                           

-rwxr-xr-x  1 root root  5349 Nov 12 00:05 network                                                                                            

-rwxr-xr-x  1 root root  1526 Nov  9 01:18 nscd                                                                                               

-rwxr-xr-x  1 root root   717 Nov 12 00:05 numlock                                                                                            

-rwxr-xr-x  1 root root  1871 Oct 23 23:29 pciparm                                                                                            

-rwxr-xr-x  1 root root  1925 Nov 12 00:05 procfs                                                                                             

-rwxr-xr-x  1 root root   538 Oct 13 04:53 pwcheck                                                                                            

-rwxr-xr-x  1 root root   666 Nov  2 16:33 pydoc-2.6                                                                                          

-rwxr-xr-x  1 root root   666 Oct 18 17:11 pydoc-3.1                                                                                          

-rwxr-xr-x  1 root root   639 Oct 29 23:30 rdate                                                                                              

-rwxr-xr-x  1 root root   304 Nov 14 16:23 reboot.sh                                                                                          

-rwxr-xr-x  1 root root   276 Oct 12 18:33 rmnologin                                                                                          

-rwxr-xr-x  1 root root   653 Nov 12 00:05 root                                                                                               

-rwxr-xr-x  1 root root   558 Oct 24 00:20 rsyncd

lrwxrwxrwx  1 root root    23 Oct 12 14:55 runscript.sh -> ../../sbin/runscript.sh

-rwxr-xr-x  1 root root  1143 Nov  9 02:18 samba

-rwxr-xr-x  1 root root   525 Oct 13 04:53 saslauthd

-rwxr-xr-x  1 root root   813 Nov 12 00:05 savecache

-rwxr-xr-x  1 root root   385 Nov 14 16:23 shutdown.sh

-rwxr-xr-x  1 root root  2309 Oct 13 01:43 slpd

-rwxr-xr-x  1 root root  2159 Oct 24 17:59 sshd

-rwxr-xr-x  1 root root  1091 Nov 12 00:05 staticroute

-rwxr-xr-x  1 root root   791 Nov 12 00:05 swap

-rwxr-xr-x  1 root root   487 Nov 12 00:05 swclock

-rwxr-xr-x  1 root root   377 Nov 12 00:05 sysctl

-rwxr-xr-x  1 root root  1303 Nov 12 00:05 sysfs

-rwxr-xr-x  1 root root  1575 Oct 23 23:38 sysklogd

-rwxr-xr-x  1 root root   749 Nov 12 00:05 termencoding

-rwxr-xr-x  1 root root  5788 Oct 25 12:08 udev

-rwxr-xr-x  1 root root  2579 Oct 25 12:08 udev-dev-tarball

-rwxr-xr-x  1 root root  2680 Oct 25 12:08 udev-mount

-rwxr-xr-x  1 root root   683 Oct 25 12:08 udev-postmount

-rwxr-xr-x  1 root root   937 Nov 12 00:05 urandom

-rwxr-xr-x  1 root root   530 Oct 13 01:44 vixie-cron

-rwxr-xr-x  1 root root   435 Nov 16 11:32 wicd

-rwxr-xr-x  1 root root  1234 Nov 15 21:50 wpa_supplicant

-rwxr-xr-x  1 root root  6417 Nov 14 16:23 xdm

-rwxr-xr-x  1 root root   340 Nov 14 16:23 xdm-setup

```

```

BESTIA init.d # cat /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

network={

        ssid="SSID1"

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=CCMP TKIP

        group=CCMP TKIP

        psk="my_psk"

}

network={

ssid="SSID2"

key_mgmt=NONE

wep_key0=my_wep_key

wep_tx_keyidx=0

}

network={

   ssid="SSID3"

   key_mgmt=NONE

}

```

```

BESTIA init.d # lspci -v

00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)

        Subsystem: IBM ThinkPad Z60t                                                                           

        Flags: bus master, fast devsel, latency 0                                                              

        Capabilities: [e0] Vendor Specific Information <?>                                                     

00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03) (prog-if 00 [Normal decode])

        Flags: bus master, fast devsel, latency 0                                                                        

        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0                                                     

        I/O behind bridge: 00002000-00002fff                                                                             

        Memory behind bridge: b0100000-b01fffff                                                                          

        Prefetchable memory behind bridge: c0000000-c7ffffff                                                             

        Capabilities: [88] Subsystem: IBM Device 0578                                                                    

        Capabilities: [80] Power Management version 2                                                                    

        Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-                                                       

        Capabilities: [a0] Express Root Port (Slot+), MSI 00                                                             

        Capabilities: [100] Virtual Channel <?>                                                                          

        Capabilities: [140] Root Complex Link <?>                                                                        

        Kernel driver in use: pcieport-driver                                                                            

00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03) (prog-if 00 [Normal decode])

        Flags: bus master, fast devsel, latency 0                                                                                 

        Bus: primary=00, secondary=02, subordinate=02, sec-latency=0                                                              

        Memory behind bridge: b0200000-b02fffff                                                                                   

        Capabilities: [40] Express Root Port (Slot+), MSI 00                                                                      

        Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-                                                                

        Capabilities: [90] Subsystem: Gammagraphx, Inc. (or missing ID) Device 0000                                               

        Capabilities: [a0] Power Management version 2                                                                             

        Capabilities: [100] Virtual Channel <?>                                                                                   

        Capabilities: [180] Root Complex Link <?>                                                                                 

        Kernel driver in use: pcieport-driver                                                                                     

00:1c.2 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 3 (rev 03) (prog-if 00 [Normal decode])

        Flags: bus master, fast devsel, latency 0                                                                                 

        Bus: primary=00, secondary=03, subordinate=0a, sec-latency=0                                                              

        I/O behind bridge: 00003000-00003fff                                                                                      

        Memory behind bridge: b2000000-b3ffffff                                                                                   

        Prefetchable memory behind bridge: 00000000c8000000-00000000c80fffff                                                      

        Capabilities: [40] Express Root Port (Slot+), MSI 00                                                                      

        Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-                                                                

        Capabilities: [90] Subsystem: Gammagraphx, Inc. (or missing ID) Device 0000                                               

        Capabilities: [a0] Power Management version 2                                                                             

        Capabilities: [100] Virtual Channel <?>                                                                                   

        Capabilities: [180] Root Complex Link <?>                                                                                 

        Kernel driver in use: pcieport-driver                                                                                     

00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03) (prog-if 00 [UHCI])

        Subsystem: IBM Device 0565                                                                                    

        Flags: bus master, medium devsel, latency 0, IRQ 11                                                           

        I/O ports at 1800 [size=32]                                                                                   

        Kernel driver in use: uhci_hcd                                                                                

00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03) (prog-if 00 [UHCI])

        Subsystem: IBM Device 0565                                                                                    

        Flags: bus master, medium devsel, latency 0, IRQ 11                                                           

        I/O ports at 1820 [size=32]                                                                                   

        Kernel driver in use: uhci_hcd                                                                                

00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03) (prog-if 00 [UHCI])

        Subsystem: IBM Device 0565                                                                                    

        Flags: bus master, medium devsel, latency 0, IRQ 11                                                           

        I/O ports at 1840 [size=32]                                                                                   

        Kernel driver in use: uhci_hcd                                                                                

00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03) (prog-if 00 [UHCI])

        Subsystem: IBM Device 0565                                                                                    

        Flags: bus master, medium devsel, latency 0, IRQ 11                                                           

        I/O ports at 1860 [size=32]                                                                                   

        Kernel driver in use: uhci_hcd                                                                                

00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03) (prog-if 20 [EHCI])

        Subsystem: IBM Device 0566                                                                                             

        Flags: bus master, medium devsel, latency 0, IRQ 11                                                                    

        Memory at b0000000 (32-bit, non-prefetchable) [size=1K]                                                                

        Capabilities: [50] Power Management version 2                                                                          

        Capabilities: [58] Debug port: BAR=1 offset=00a0                                                                       

        Kernel driver in use: ehci_hcd                                                                                         

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3) (prog-if 01 [Subtractive decode])

        Flags: bus master, fast devsel, latency 0                                                       

        Bus: primary=00, secondary=0b, subordinate=0e, sec-latency=64                                   

        I/O behind bridge: 00004000-00007fff                                                            

        Memory behind bridge: b4000000-bfffffff                                                         

        Prefetchable memory behind bridge: 00000000d0000000-00000000d7ffffff                            

        Capabilities: [50] Subsystem: Gammagraphx, Inc. (or missing ID) Device 0000                     

00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)

        Subsystem: IBM Device 0567                                                                                        

        Flags: bus master, medium devsel, latency 0, IRQ 11                                                               

        I/O ports at 1c00 [size=256]                                                                                      

        I/O ports at 1880 [size=64]                                                                                       

        Memory at b0000800 (32-bit, non-prefetchable) [size=512]                                                          

        Memory at b0000400 (32-bit, non-prefetchable) [size=256]                                                          

        Capabilities: [50] Power Management version 2                                                                     

        Kernel driver in use: Intel ICH                                                                                   

        Kernel modules: snd-intel8x0                                                                                      

00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)

        Subsystem: IBM Device 0568                                                  

        Flags: bus master, medium devsel, latency 0                                 

00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03) (prog-if 80 [Master])

        Subsystem: IBM Device 056a                                                                      

        Flags: bus master, 66MHz, medium devsel, latency 0                                              

        I/O ports at 01f0 [size=8]                                                                      

        I/O ports at 03f4 [size=1]                                                                      

        I/O ports at 0170 [size=8]                                                                      

        I/O ports at 0374 [size=1]                                                                      

        I/O ports at 18c0 [size=16]                                                                     

        Capabilities: [70] Power Management version 2                                                   

        Kernel driver in use: ata_piix                                                                  

00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)

        Subsystem: IBM Device 056b                                                            

        Flags: medium devsel, IRQ 11                                                          

        I/O ports at 18e0 [size=32]                                                           

        Kernel driver in use: i801_smbus                                                      

01:00.0 VGA compatible controller: ATI Technologies Inc M22 [Mobility Radeon X300] (prog-if 00 [VGA controller])

        Subsystem: IBM Device 056e                                                                              

        Flags: bus master, fast devsel, latency 0, IRQ 11                                                       

        Memory at c0000000 (32-bit, prefetchable) [size=128M]                                                   

        I/O ports at 2000 [size=256]                                                                            

        Memory at b0100000 (32-bit, non-prefetchable) [size=64K]                                                

        [virtual] Expansion ROM at b0120000 [disabled] [size=128K]                                              

        Capabilities: [50] Power Management version 2                                                           

        Capabilities: [58] Express Endpoint, MSI 00                                                             

        Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit+                                              

        Capabilities: [100] Advanced Error Reporting                                                            

        Kernel driver in use: radeon                                                                            

        Kernel modules: radeonfb                                                                                

02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751M Gigabit Ethernet PCI Express (rev 11)

        Subsystem: IBM ThinkPad Z60t                                                                      

        Flags: bus master, fast devsel, latency 0, IRQ 11                                                 

        Memory at b0200000 (64-bit, non-prefetchable) [size=64K]                                          

        Expansion ROM at <ignored> [disabled]                                                             

        Capabilities: [48] Power Management version 2                                                     

        Capabilities: [50] Vital Product Data                                                             

        Capabilities: [58] MSI: Enable- Count=1/8 Maskable- 64bit+                                        

        Capabilities: [d0] Express Endpoint, MSI 00                                                       

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [13c] Virtual Channel <?>

        Kernel driver in use: tg3

0b:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev 8d)

        Subsystem: IBM ThinkPad Z60t

        Flags: bus master, medium devsel, latency 168, IRQ 11

        Memory at b4000000 (32-bit, non-prefetchable) [size=4K]

        Bus: primary=0b, secondary=0c, subordinate=0d, sec-latency=176

        Memory window 0: d0000000-d3fff000 (prefetchable)

        Memory window 1: b8000000-bbfff000

        I/O window 0: 00004000-000040ff

        I/O window 1: 00004400-000044ff

        16-bit legacy interface ports at 0001

        Kernel driver in use: yenta_cardbus

        Kernel modules: yenta_socket

0b:02.0 Network controller: Intel Corporation PRO/Wireless 2915ABG [Calexico2] Network Connection (rev 05)

        Subsystem: Intel Corporation Device 1011

        Flags: bus master, medium devsel, latency 64, IRQ 11

        Memory at b4001000 (32-bit, non-prefetchable) [size=4K]

        Capabilities: [dc] Power Management version 2

        Kernel driver in use: ipw2200

        Kernel modules: ipw2200

```

```

BESTIA init.d #  cat /etc/udev/rules.d/70-persistent-net.rules

# Most of the comments deleted

# PCI device 0x14e4:0x167d (tg3)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:58:2a:5c:00", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x4224 (ipw2200)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:12:f0:b0:c7:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

```

```

BESTIA init.d # lsmod

Module                  Size  Used by

bnep                   10576  0      

sco                     8416  0      

rfcomm                 21084  0      

l2cap                  17476  4 bnep,rfcomm

ircomm_tty             16920  0            

ircomm                  8908  1 ircomm_tty 

irlan                  19640  0            

lib80211_crypt_tkip     8096  2

lib80211_crypt_ccmp     4664  0

lib80211_crypt_wep      3332  0

test_nx                 1848  0

acpi_cpufreq            6796  0

btusb                  10144  0

bluetooth              41880  5 bnep,sco,rfcomm,l2cap,btusb

hdaps                   5936  0

input_polldev           3116  1 hdaps

scsi_wait_scan          1012  0

pcmcia                 27356  0

michael_mic             2032  8

irtty_sir               4188  0

sir_dev                 9436  1 irtty_sir

irda                   86784  4 ircomm_tty,ircomm,irlan,sir_dev

yenta_socket           20492  1

rsrc_nonstatic          7884  1 yenta_socket

crc_ccitt               1596  1 irda

ipw2200               115544  0

snd_intel8x0           26384  5

pcmcia_core            27968  3 pcmcia,yenta_socket,rsrc_nonstatic

libipw                 22264  1 ipw2200

lib80211                4652  5 lib80211_crypt_tkip,lib80211_crypt_ccmp,lib80211_crypt_wep,ipw2200,libipw

snd_ac97_codec         86920  1 snd_intel8x0

ac97_bus                1316  1 snd_ac97_codec

```

```

BESTIA init.d # ifconfig -a                                                                              

eth0      Link encap:Ethernet  HWaddr 00:15:58:2a:5c:00                                                  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1                                                     

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0                                             

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0                                           

          collisions:0 txqueuelen:1000                                                                   

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                                                         

          Interrupt:11                                                                                   

eth1      Link encap:Ethernet  HWaddr 00:12:f0:b0:c7:98  

          inet addr:192.168.0.12  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::212:f0ff:feb0:c798/64 Scope:Link             

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1             

          RX packets:83890 errors:0 dropped:0 overruns:0 frame:0         

          TX packets:76038 errors:0 dropped:0 overruns:0 carrier:0       

          collisions:0 txqueuelen:1000                                   

          RX bytes:31058599 (29.6 MiB)  TX bytes:7827975 (7.4 MiB)       

          Interrupt:11 Base address:0x6000 Memory:b4001000-b4001fff      

irlan0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:4

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:838 errors:0 dropped:0 overruns:0 frame:0

          TX packets:838 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:24722 (24.1 KiB)  TX bytes:24722 (24.1 KiB)

sit0      Link encap:IPv6-in-IPv4

          inet6 addr: ::127.0.0.1/96 Scope:Unknown

          UP RUNNING NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

```

```

BESTIA init.d # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

eth1      IEEE 802.11g  ESSID:"SSID1"

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1E:69:67:BA:CE

          Bit Rate:54 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0

          Retry limit:7   RTS thr:off   Fragment thr:off

          Encryption key: encryption_key   Security mode:open

          Power Management:off

          Link Quality=89/100  Signal level=-40 dBm  Noise level=-73 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:81  Invalid misc:0   Missed beacon:1

irlan0    no wireless extensions.

```

----------

## d2_racing

Oh my god, you have a pretty old ipw2200 wireless card  :Razz: 

Right now, can you post this :

```

# iwconfig

```

Also, can you try this one instead :

```

cat /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

network={

        ssid="SSID1"

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=CCMP TKIP

        group=CCMP TKIP

        psk="my_psk"

       priority=5

 }

network={

ssid="SSID2"

key_mgmt=NONE

wep_key0=my_wep_key

wep_tx_keyidx=0

priority=10

}

network={

   ssid="SSID3"

   key_mgmt=NONE

   priority=15

} 

```

----------

## d2_racing

Can you post this :

```

# cat /etc/init.d/wpa_supplicant 

# rc-update show

```

----------

## bestia

To be honest, I've got a bit newer one - Intel's 2915 - which is still a pretty old one   :Razz: 

I didn't really try your wpa_supplicant.conf cause now I'm at university and can't play with things too much. I've seen you only added priorities to my config though, and the AP's are far from each other (roughly over few miles distance between them).

```

BESTIA init.d #  cat /etc/init.d/wpa_supplicant

#!/sbin/runscript                              

# Copyright (c) 2009 Roy Marples <roy@marples.name>

# All rights reserved. Released under the 2-clause BSD license.

command=/usr/sbin/wpa_supplicant

: ${wpa_supplicant_conf:=/etc/wpa_supplicant.conf}

wpa_supplicant_if=${wpa_supplicant_if:+-i}$wpa_supplicant_if

command_args="$wpa_supplicant_args -B -c$wpa_supplicant_conf $wpa_supplicant_if"

name="WPA Supplicant Daemon"                                                    

depend()

{       

        need localmount

        use logger     

        after bootmisc modules

        before dns dhcpcd net 

        keyword -shutdown     

}                             

find_wireless()

{              

        local iface=

        case "$RC_UNAME" in

        Linux)             

                for iface in /sys/class/net/*; do

                        if [ -e "$iface"/wireless -o \

                                -e "$iface"/phy80211 ]

                        then                          

                                echo "${iface##*/}"   

                                return 0              

                        fi                            

                done                                  

                ;;                                    

        *)                                            

                for iface in /dev/net/* $(ifconfig -l 2>/dev/null); do

                        if ifconfig "${iface##*/}" 2>/dev/null | \    

                                grep -q "[ ]*ssid "                   

                        then                                          

                                echo "${iface##*/}"                   

                                return 0                              

                        fi                                            

                done                                                  

                ;;                                                    

        esac                                                          

        return 1

}

append_wireless()

{

        local iface= i=

        iface=$(find_wireless)

        if [ -n "$iface" ]; then

                for i in $iface; do

                        command_args="$command_args -i$i"

                done

        else

                eerror "Could not find a wireless interface"

        fi

}

start_pre()

{

        case " $command_args" in

        *" -i"*) ;;

        *) append_wireless;;

        esac

}

```

And rc-update show (was in my first post):

```

BESTIA init.d # rc-update show

               procfs |                                           boot

              keymaps |                                           boot

              hwclock |                                           boot

                 dbus | default                                       

                local | default                 nonetwork             

           consolekit | default

         termencoding |                                           boot

              urandom |                                           boot

          consolefont |                                           boot

                 fsck |                                           boot

           localmount |                                           boot

                  xdm | default

               dhcpcd | default

             netmount | default

             hostname |                                           boot

                 hald | default

              network |                                           boot

            savecache |                shutdown

                 root |                                           boot

               sysctl |                                           boot

             mount-ro |                shutdown

                devfs |                                   sysinit

                 mtab |                                           boot

              modules |                                           boot

            killprocs |                shutdown

                 swap |                                           boot

                dmesg |                                   sysinit

             bootmisc |                                           boot

       wpa_supplicant | default

                 udev |                                   sysinit

```

 I forgot to mention, that iwconfig I stated was checked during /etc/init.d/net.eth1 started and /etc/init.d/wpa_supplicant stopped - in order to write  a post  :Smile:  . I'll post it for You now with wpa_supplicant script started:

```

BESTIA init.d # /etc/init.d/net.eth1 stop                                                                                 

net.eth1          |* Bringing down interface eth1

net.eth1          |*   Removing addresses

net.eth1          |*     10.20.110.248/16

net.eth1          |*     Stopping wpa_cli on eth1...                                                                                                [ ok ]

net.eth1          |*     Stopping wpa_supplicant on eth1...                                                                                         [ ok ]

BESTIA init.d # /etc/init.d/wpa_supplicant start

wpa_supplicant    |* Starting WPA Supplicant Daemon...                                                                                              [ ok ]

BESTIA init.d # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

eth1      radio off  ESSID:"SSID3" #I'm at university now

          Mode:Managed  Frequency:5.22 GHz  Access Point: 00:23:33:2C:14:AF

          Bit Rate:0 kb/s   Tx-Power=off   Sensitivity=8/0

          Retry limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

irlan0    no wireless extensions.

```

Cheers, Bestia

----------

## d2_racing

Ok, reboot your box and post this :

```

# iwlist scan

# /etc/init.d/wpa_supplicant start

# iwconfig

# ifconfig -a

# iwlist scan

# wpa_cli status

```

----------

## sera

 *Quote:*   

> # PCI device 0x8086:0x4224 (ipw2200)
> 
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:12:f0:b0:c7:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" 

 

This will force the interface name eth1 for your wlan card. You can remove this.

Also remove the corresponding symlink net.eth1 in /etc/init.d which causes udev to start your wlan at boot time using the old networking. See /etc/udev/rules/90-network.rules. That's probably the main problem here seeing you have renamed /etc/conf.d/net.

Removing net.eth0 and net.lo from /etc/init.d/ should be done as well. eth0 is handled by dhcpcd-5.x and net.lo is replaced by the script called network.

Using openrc and baselayout2 /etc/conf.d/rc was superseded by /etc/rc.conf and can be purged as well.

----------

## d2_racing

 *sera wrote:*   

>  *Quote:*   # PCI device 0x8086:0x4224 (ipw2200)
> 
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:12:f0:b0:c7:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"  
> 
> This will force the interface name eth1 for your wlan card. You can remove this.
> ...

 

Each time that he will reboot, this line will be created.

----------

## sera

 *d2_racing wrote:*   

> Each time that he will reboot, this line will be created.

 

I suspect the interface will be added as wlan0 this time. Eth1 is confusing  :Wink: 

----------

## bestia

First of all, wpa_supplicant doesn't start at boot because net.eth1 is being called first.

AP's scanning You asked for was done while net.eth1 was running:

```
BESTIA ~ # iwlist scan

lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

sit0      Interface doesn't support scanning.

eth1      Scan completed :

          Cell 01 - Address: 00:1E:69:67:BA:CE

                    ESSID:"SSID1"

                    Protocol:IEEE 802.11bg

                    Mode:Master

                    Frequency:2.412 GHz (Channel 1)

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s

                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Quality=95/100  Signal level=-31 dBm

                    IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (1) : TKIP

                        Authentication Suites (1) : PSK

                    Extra: Last beacon: 93ms ago

irlan0    Interface doesn't support scanning.

```

Then I did /etc/init.d/wpa_supplicant start which caused the following error:

```

BESTIA ~ # /etc/init.d/wpa_supplicant start

wpa_supplicant    |* Starting WPA Supplicant Daemon...

wpa_supplicant    |ctrl_iface exists and seems to be in use - cannot override it

wpa_supplicant    |Delete '/var/run/wpa_supplicant/eth1' manually if it is not used anymore

wpa_supplicant    |Failed to initialize control interface '/var/run/wpa_supplicant'.

wpa_supplicant    |You may have another wpa_supplicant process already running or the file was

wpa_supplicant    |left by an unclean termination of wpa_supplicant in which case you will need

wpa_supplicant    |to manually remove this file before starting wpa_supplicant again.

wpa_supplicant    |

wpa_supplicant    |* start-stop-daemon: failed to start `/usr/sbin/wpa_supplicant'

wpa_supplicant    |* Failed to start wpa_supplicant                                                                                                 [ !! ]

wpa_supplicant    |* ERROR: wpa_supplicant failed to start

```

Same as I see on boot.

To answer Your question I needed to stop net.eth1:

```

BESTIA ~ # /etc/init.d/net.eth1 stop

net.eth1          |* Bringing down interface eth1

net.eth1          |*   Removing addresses

net.eth1          |*     192.168.0.12/24

net.eth1          |*     Stopping wpa_cli on eth1...                                                                                                [ ok ]

net.eth1          |*     Stopping wpa_supplicant on eth1...                                                                                         [ ok ]

BESTIA ~ # /etc/init.d/wpa_supplicant start

wpa_supplicant    |* Starting WPA Supplicant Daemon...                                                                                              [ ok ]

BESTIA ~ # iwlist scan                     

lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

sit0      Interface doesn't support scanning.

eth1      No scan results

irlan0    Interface doesn't support scanning.

BESTIA ~ # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

eth1      radio off  ESSID:"SSID1"  

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1E:69:67:BA:CE   

          Bit Rate:0 kb/s   Tx-Power=off   Sensitivity=8/0                     

          Retry limit:7   RTS thr:off   Fragment thr:off                       

          Encryption key: encryption_key   Security mode:open

          Power Management:off                                                                                               

          Link Quality:0  Signal level:0  Noise level:0                                                                      

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0                                                           

          Tx excessive retries:0  Invalid misc:138   Missed beacon:0                                                         

irlan0    no wireless extensions.

BESTIA ~ # ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:15:58:2a:5c:00  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1     

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000                        

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)              

          Interrupt:11                                        

eth1      Link encap:Ethernet  HWaddr 00:12:f0:b0:c7:98  

          UP BROADCAST MULTICAST  MTU:1500  Metric:1     

          RX packets:1475 errors:0 dropped:138 overruns:0 frame:0

          TX packets:1181 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000                           

          RX bytes:905197 (883.9 KiB)  TX bytes:198544 (193.8 KiB)

          Interrupt:11 Memory:b4001000-b4001fff                   

irlan0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00  

          BROADCAST MULTICAST  MTU:1500  Metric:1        

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:4

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:389 errors:0 dropped:0 overruns:0 frame:0

          TX packets:389 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:11701 (11.4 KiB)  TX bytes:11701 (11.4 KiB)

sit0      Link encap:IPv6-in-IPv4

          inet6 addr: ::127.0.0.1/96 Scope:Unknown

          UP RUNNING NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

BESTIA ~ # wpa_cli status

Selected interface 'eth1'

wpa_state=SCANNING

```

I also tried commenting out the lines sera asked for, but as d2_racing said new ones where created at boot (looking the same, just not commented). Now I'll go for renaming all net.* files and let You know.

Cheers, Bestia

----------

## d2_racing

Hi, run that :

```

# rc-update del wpa_supplicant 

```

After that, reboot your box.

```

# iwconfig

# iwlist scan

# dmesg | tail

# dmesg | grep -i ipw

```

----------

## bestia

OK! After rebooting everything works flawlessly, wpa_supplicant starts, dhcpcd acquires IP's, simply great. The thing is that still my wpa_gui says "cannot get status... " :/ So basically that solved my problem was removing all of the net.* scripts. Since I didn't have them in any of my runlevels, I'm really wondered about what was bringing them up and what exactly was interfering work of wpa_supplicant. If You have any ideas, please let me know!

Thanks for Your help!  :Very Happy: 

----------

## d2_racing

No problem  :Razz: 

----------

## sera

 *bestia wrote:*   

> OK! After rebooting everything works flawlessly, wpa_supplicant starts, dhcpcd acquires IP's, simply great. The thing is that still my wpa_gui says "cannot get status... " :/ So basically that solved my problem was removing all of the net.* scripts. Since I didn't have them in any of my runlevels, I'm really wondered about what was bringing them up and what exactly was interfering work of wpa_supplicant. If You have any ideas, please let me know!
> 
> Thanks for Your help! 

 

I already explained, reread the post.

----------

## bestia

Ok, I understood that udev was responsible for it, but I wonder that caused it to do so. I have no such file like 90-network.rules in /etc/udev/rules.d/ - and any code which I've seen in other rules files doesn't seem to be related to networking. And still why, even while net.eth1 was manually stopped, was wpa_supplicant malfunctioning? Anyway, problem is solved and the solution is clear, so thanks again  :Wink: 

----------

## sera

 *bestia wrote:*   

> Ok, I understood that udev was responsible for it, but I wonder that caused it to do so. I have no such file like 90-network.rules in /etc/udev/rules.d/ - and any code which I've seen in other rules files doesn't seem to be related to networking. And still why, even while net.eth1 was manually stopped, was wpa_supplicant malfunctioning? Anyway, problem is solved and the solution is clear, so thanks again 

 

The script which get's called is

```
/lib/udev/net.sh
```

And the original rules file is:

```
/lib/udev/rules.d/90-network.rules
```

And /etc/init.d/net.eth1 was malfunctioning, this because the configuration was already gone.

----------

## UberLord

 *d2_racing wrote:*   

> Oh my god, you have a pretty old ipw2200 wireless card 

 

The ipw2200 card in my laptop is the fastest AND most reliable wireless card I have, for all OS's. Don't knock it  :Razz: 

I also have rt2500pci and 2x old style Atheros for my dev boxes.

----------

## d2_racing

 *UberLord wrote:*   

> The ipw2200 card in my laptop is the fastest AND most reliable wireless card I have, for all OS's. Don't knock it 

 

Yeah I know, it's one of the best card, but also one of the oldest too. It's back on 2004 I think or even before  :Razz: 

----------

## Dr_b_

As a follow on question, if you wanted to use multiple addresses per phy interface, using the new /etc/conf.d/network script, what would be the syntax? tried:

ifconfig_eth0="192.168.0.38/24; 192.168.0.39/24; 192.168.0.40/24"

and

ifconfig_eth0="192.168.0.{38..40}/24" 

as described in the net.example in /usr/share/doc/openrc-0.5.2-r2/net.example, and there isn't an example in the new /etc/conf.d/network script that i can see.

but they both only load one ip on the interface, being the last address in the range.  using legacy network definitions in the /etc/conf.d/net works however.

TIA.

----------

## UberLord

You need to use iproute2 for that I'm afraid.

I should work on my new ifconfig project, but I play WoW too much!

----------

