You are not logged in.

#1 2008-01-06 09:13:20

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

netcfg v2.0.3

netcfg2 is a refined network profile system for Arch Linux, replacing the current implementation. Through this, it has also gained various features and improvements which are listed on the development wiki page (http://wiki.archlinux.org/index.php/Network_Scripts)

Wireless Detection
This kinda big feature in this release is "including" wireless detection support.
To detect on boot, may add "auto-wireless $interface" to your NETWORKS=() line. This can even be added among other profiles, for example:

NETWORKS=(auto-wireless ipw0 ethernet)

To run after boot, run: /usr/bin/netcfg-auto-wireless

Changlog
* Added: fancy auto detection support
* Added: Explicitly specify menu default via NETWORKS_MENU_DEFAULT in rc.conf
* Added: Explicitly set menu timeout with NETWORKS_MENU_TIMEOUT in rc.conf
* Added: Recording of last setup profile as $PROFILE_DIR/last symlinked to last profile
* Tidied: rc.d/net-profiles
* Fixed: typos in some example configs
* Fixed: Workaround for some drivers who crash on ifconfig down

Install
It's currently in testing. If you're not running testing, uncomment it at the end of your pacman.conf, and then whether you're using testing or not:

pacman -S testing/netcfg

netcfg v2 will be out of testing soon, keep an eye on the mailing list. x86_64 package will be updated later tonight

Documentation
* netcfg manpage
* Detailed examples in /etc/network.d/examples
* Wiki: http://wiki.archlinux.org/index.php/Network_Profiles

Last edited by iphitus (2008-01-06 09:23:35)

Offline

#2 2008-01-06 09:22:27

DeveloperDave
Member
Registered: 2007-12-25
Posts: 9

Re: netcfg v2.0.3

This is great, nice work mate, and thank you smile


- Dave

Offline

#3 2008-01-06 12:25:28

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: netcfg v2.0.3

I have tested the new auto-wireless. But I get

[pierre@satellite ~]$ LANG=C sudo /etc/rc.d/net-profiles restart
 > Profile "last" does not exist
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
grep: /etc/network.d/last: Too many levels of symbolic links
:: skynet up                                                                                                                            [BUSY]  > Profile "last" does not exist

Offline

#4 2008-01-06 13:14:52

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.0.3

Pierre: Try replacing /usr/bin/netcfg-auto-wireless with the one I just put into git

http://projects.archlinux.org/git/?p=ne … a7d42e3205

Thanks!

Offline

#5 2008-01-06 13:31:37

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: netcfg v2.0.3

Well, I got the same error. Then I just deleted the broken link "last". Now I allways get "Profile "last" does not exist".
Here are some more questions/suggestions:

* What is this "last" link for?
* auto-wireless scans for all networks and connects if a matching profile exists, right?
* Just cosmetics, but it would be nice to have some output like "Scanning for available networks". Currently it looks like as if something hangs.
* Would it be possible to detect if a lan cabel is connected or not in order to stop trying to connect if there is no cable inserted?

Thanks for the great work. Those scripts are really a step forward especially for notebook users.

Offline

#6 2008-01-06 15:27:23

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: netcfg v2.0.3

Reporting in (using 2.0.3-1)

Manually connecting works, but the auto-script doesn't. My setup looks like this:
rc.conf

INTERFACES = (eth0 wlan0)
NETWORKS = (auto-wireless wlan0 wired)
DAEMONS = (... net-profiles ...)

ls /etc/network.d/

wired wl-VanHoutte wl-Coppens

wl-VanHoutte

CONNECTION="wireless"
DESCRIPTION="Verbinding met draadloos netwerk thuis in DDL"
INTERFACE=wlan0
SCAN="no"
SECURITY="wep"
ESSID="VanHoutte"
KEY="MyKey"
IP="dhcp"
TIMEOUT=15

wl-Coppens is exactly the same, except for the ESSID. Wired network is same as the example.

Now, this is what the auto-script outputs:

[root@mcc-laptop martin]# netcfg-auto-wireless wlan0
/usr/bin/netcfg-auto-wireless: line 12: : Bestand of map bestaat niet
No network found
[root@mcc-laptop martin]# ifconfig
lo        Link encap:Local Loopback

Now, this is what the manual way outputs:

[root@mcc-laptop martin]# netcfg2 wl-VanHoutte
:: wl-VanHoutte up                                                       [DONE] 
[root@mcc-laptop martin]# ifconfig
lo        Link encap:Local Loopback  
...
wlan0     Link encap:Ethernet  HWaddr 00:1C:BF:24:2E:1C  
...
wmaster0  Link encap:UNSPEC  HWaddr 00-1C-BF-24-2E-1C-00-00-00-00-00-00-00-00-00-00

Is this a bug or am I doing something wrong? Thx for your efforts - looks like it's getting there!

Zl.

Last edited by zenlord (2008-01-06 15:29:37)

Offline

#7 2008-01-07 18:29:32

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: netcfg v2.0.3

I took a peek inside the auto-script and with my limited scripting-experience, my guess is the variable $PROFILE_DIR/ is not set (correctly), which would explain the errormessage 'could not find the file or directory in line 12'.

Zl.

Offline

#8 2008-01-09 03:10:25

carrouf
Member
Registered: 2007-01-06
Posts: 34

Re: netcfg v2.0.3

After issuing this command (which targets my eth1 wireless device):

netcfg2 -d myprofile

the network interface is still UP and RUNNING while the connection is down:

eth1      Link encap:Ethernet  HWaddr 00:19:D2:B8:33:3E
          inet6 addr: fe80::219:d2ff:feb8:333e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

This behavior is not he the same than in 2.0.1 anymore. After a profile disconnection, the ifconfig command did not return the targeted interface, and now it does.

Is it a bug ?

Offline

#9 2008-01-09 09:33:10

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.0.3

ok smile thanks for the testing guys.
Pierre

* What is this "last" link for?

Someone wanted a record of the last network they connected to, so i created that symlink. Seems i didnt think it through enough... I'll change it in the next release. 
Could you try removing the 'last' symlink, and then remove lines 210 and 211 in /usr/lib/network/network.subr? Then make sure there's no traces to last in /var/run/network.

* auto-wireless scans for all networks and connects if a matching profile exists, right?

Correct.

* Just cosmetics, but it would be nice to have some output like "Scanning for available networks". Currently it looks like as if something hangs.

Will do.

* Would it be possible to detect if a lan cabel is connected or not in order to stop trying to connect if there is no cable inserted?

Already supported and on by default on ethernet profiles, provided your card works with 'mii-tool'. I just leave ethernet in the NETWORKS=() line, and if there's no cable it simply spits out:

:: ethernet up  - No connection available           [FAIL]

zenlord
Odd. I'll give the auto script some more thorough testing and get back to you on that, I have an idea.

For auto to work, networks _must_ appear in an iwlist scan. Do yours not appear in a regular iwlist scan?

It's not PROFILE_DIR causing the problem, it's defined in /usr/lib/network/network.subr which is source'd by the auto script.

carrouf
Intentional. The network is no longer configured, so despite the device being up, it's effectively disconnected. I've been told it's bad practice to 'down' interfaces, and on top of that, it causes at least one driver to crash. I'm still not sure on what to do here, but the current situation works in all cases. If you'd like it down for sure, you could always set

POST_DOWN="ifconfig $INTERFACE down"

Last edited by iphitus (2008-01-09 09:33:28)

Offline

#10 2008-01-09 09:48:12

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,556

Re: netcfg v2.0.3

No intensive testing here but using latest netcfg with iwl3945 1.2.23 + WPA and everything is working as it should. Automatic detection is definitely a great improvement, congrats & thanks for your work.

Offline

#11 2008-01-09 09:58:06

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.0.3

bangkok_manouel wrote:

No intensive testing here but using latest netcfg with iwl3945 1.2.23 + WPA and everything is working as it should. Automatic detection is definitely a great improvement, congrats & thanks for your work.

Thanks, good to hear it works for more than me tongue

Offline

#12 2008-01-09 13:16:55

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: netcfg v2.0.3

iphitus wrote:

zenlord
Odd. I'll give the auto script some more thorough testing and get back to you on that, I have an idea.

For auto to work, networks _must_ appear in an iwlist scan. Do yours not appear in a regular iwlist scan?

It's not PROFILE_DIR causing the problem, it's defined in /usr/lib/network/network.subr which is source'd by the auto script.

THX for listening!

My ESSID is hidden and I found this - it might be related. I didn't test iwlist scan yet - I'll try it tonight when I get home.

I saw the link to /usr/lib/network/network.subr, but I'm not familiar with the script-grammar. It's rather high on my to-learn-list, but time is very precious...

Zl.

Offline

#13 2008-01-09 14:22:10

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.0.3

If it's hidden, then netcfg2's scan, auto function or iwlist scan will not find it, as you showed, manually connection works, so that bug you linked is probably irrelevant.

Thanks for that though, i think I know what caused that error message you had with it anyway.

Last edited by iphitus (2008-01-09 14:22:38)

Offline

#14 2008-01-09 21:16:51

nDray
Member
From: Portugal
Registered: 2007-01-21
Posts: 143
Website

Re: netcfg v2.0.3

It just came to me, and I'm not testing, so I don't know if this has already been done...
Give the user the ability to define the authentication timeout for wpa_supplicant... Here at my university sometimes 20 secs is not enough.... :S I manually changed it, but wouldn't be a bad option to define it in the profile...

Offline

#15 2008-01-09 21:54:10

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: netcfg v2.0.3

You're right iwlist scan doesn't work with a hidden ESSID:

[martin@mcc-laptop ~]$ iwlist wlan0 scan
wlan0     No scan results
[martin@mcc-laptop ~]$ su
Wachtwoord: 
[root@mcc-laptop martin]# iwlist wlan0 scan
wlan0     Interface doesn't support scanning : Network is down
[root@mcc-laptop martin]# netcfg2 wl-VanHoutte
:: wl-VanHoutte up                                                       [DONE]

Last edited by zenlord (2008-01-09 21:54:55)

Offline

#16 2008-01-09 22:54:55

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: netcfg v2.0.3

zenlord, iwlist eth1 on my computer works for hidden networks, it just shows "ESSID: <hidden>" instead.  try sitting outside a walmart and running that, you get like 30 hidden networks show up! tongue

Last edited by rson451 (2008-01-09 22:55:06)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#17 2008-01-10 00:18:16

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.0.3

nDray wrote:

It just came to me, and I'm not testing, so I don't know if this has already been done...
Give the user the ability to define the authentication timeout for wpa_supplicant... Here at my university sometimes 20 secs is not enough.... :S I manually changed it, but wouldn't be a bad option to define it in the profile...

The option is already there, TIMEOUT=

Yes, hidden networks do show up in iwlist, but <hidden> isnt much use :)

Offline

#18 2008-01-10 00:29:02

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: netcfg v2.0.3

iphitus wrote:

yes, hidden networks do show up in iwlist, but <hidden> isnt much use smile

i completely agree, but because he cant even see that, maybe there are deeper problems with his wireless. oh well. i tried smile


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#19 2008-01-10 03:31:09

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.0.3

rson451 wrote:
iphitus wrote:

yes, hidden networks do show up in iwlist, but <hidden> isnt much use smile

i completely agree, but because he cant even see that, maybe there are deeper problems with his wireless. oh well. i tried smile

forgot to add, scan usually doesnt return results when run as a user, run it as root (was run as a user above). Either way, if scan isnt showing anything as root, that's a driver bug, not netcfg and should be reported to the driver's developers.

Offline

#20 2008-01-10 04:09:33

carrouf
Member
Registered: 2007-01-06
Posts: 34

Re: netcfg v2.0.3

I have a question : can netcfg be used by a non-root user ?

Offline

#21 2008-01-10 08:23:32

BlueFightingCat
Member
From: Helsinki
Registered: 2007-12-22
Posts: 72

Re: netcfg v2.0.3

Hi,

When will this version be able for Arch64? I tried to install this yesterday but the pacman couldn't find it in the repositories.

BFC

Offline

#22 2008-01-10 08:59:16

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,556

Re: netcfg v2.0.3

It's there but doesn't seem to be the latest version (2.0.1-1 on ftp.archlinux.org at least).

I think you know that but you need [testing] to be enabled.

Otherwise, you may want to grab the PKGBUILD and build it by yourself.

Offline

#23 2008-01-10 11:59:01

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: netcfg v2.0.3

carrouf wrote:

I have a question : can netcfg be used by a non-root user ?

Only via sudo, and I don't recommend that, as netcfg is a bash script, so it's trivial to compromise it and gain full system access.

Here's the sudo line I use:

%users localhost=NOPASSWD: /usr/bin/netcfg2

Erm, Arch64, i'll upload the package now, sorry about that!

James

Offline

#24 2008-01-10 12:51:57

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: netcfg v2.0.3

iphitus wrote:

Either way, if scan isnt showing anything as root, that's a driver bug, not netcfg and should be reported to the driver's developers.

Reported: http://bughost.org/bugzilla/show_bug.cgi?id=1499#c10
As I'm very new to reporting bugs (and even Linux in general) I hope I did it in the correct way.

Zl.

Offline

#25 2008-01-10 22:13:19

Jansson
Member
From: Sweden
Registered: 2006-09-10
Posts: 106

Re: netcfg v2.0.3

iphitus wrote:

Could you try removing the 'last' symlink, and then remove lines 210 and 211 in /usr/lib/network/network.subr? Then make sure there's no traces to last in /var/run/network.

Similar error, and this solved it for me smile

Fredrik

Offline

Board footer

Powered by FluxBB