You are not logged in.
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
This is great, nice work mate, and thank you
- Dave
Offline
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
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
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
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
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
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
ok 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
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
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
Offline
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
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
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
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
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!
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
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
yes, hidden networks do show up in iwlist, but <hidden> isnt much use
i completely agree, but because he cant even see that, maybe there are deeper problems with his wireless. oh well. i tried
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
iphitus wrote:yes, hidden networks do show up in iwlist, but <hidden> isnt much use
i completely agree, but because he cant even see that, maybe there are deeper problems with his wireless. oh well. i tried
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
I have a question : can netcfg be used by a non-root user ?
Offline
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
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
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
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
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
Fredrik
Offline